Se agregan validaciones en Input Documents y Cases
This commit is contained in:
@@ -321,7 +321,7 @@ class Cases
|
||||
$array['app_name'] = $array['caseName'];
|
||||
$array['app_status'] = $array['caseStatus'];
|
||||
$array['app_init_usr_uid'] = $array['caseCreatorUser'];
|
||||
$array['app_init_usr_username'] = $array['caseCreatorUserName'];
|
||||
$array['app_init_usr_username'] = trim($array['caseCreatorUserName']);
|
||||
$array['pro_uid'] = $array['processId'];
|
||||
$array['pro_name'] = $array['processName'];
|
||||
$array['app_create_date'] = $array['createDate'];
|
||||
@@ -412,7 +412,7 @@ class Cases
|
||||
$array['app_name'] = $array['caseName'];
|
||||
$array['app_status'] = $array['caseStatus'];
|
||||
$array['app_init_usr_uid'] = $array['caseCreatorUser'];
|
||||
$array['app_init_usr_username'] = $array['caseCreatorUserName'];
|
||||
$array['app_init_usr_username'] = trim($array['caseCreatorUserName']);
|
||||
$array['pro_uid'] = $array['processId'];
|
||||
$array['pro_name'] = $array['processName'];
|
||||
$array['app_create_date'] = $array['createDate'];
|
||||
@@ -529,6 +529,14 @@ class Cases
|
||||
if ($variables) {
|
||||
$variables = array_shift($variables);
|
||||
}
|
||||
$oProcesses = new \Processes();
|
||||
if (! $oProcesses->processExists($processUid)) {
|
||||
throw (new \Exception( 'Invalid value specified for \'pro_uid\''));
|
||||
}
|
||||
$oTask = new \Task();
|
||||
if (! $oTask->taskExists($taskUid)) {
|
||||
throw (new \Exception( 'Invalid value specified for \'tas_uid\''));
|
||||
}
|
||||
$fields = $ws->newCase($processUid, $userUid, $taskUid, $variables);
|
||||
$array = json_decode(json_encode($fields), true);
|
||||
if ($array ["status_code"] != 0) {
|
||||
@@ -570,6 +578,14 @@ class Cases
|
||||
} elseif ($variables == null) {
|
||||
$variables = array(array());
|
||||
}
|
||||
$oProcesses = new \Processes();
|
||||
if (! $oProcesses->processExists($processUid)) {
|
||||
throw (new \Exception( 'Invalid value specified for \'pro_uid\''));
|
||||
}
|
||||
$user = new \Users();
|
||||
if (! $user->userExists( $userUid )) {
|
||||
throw (new \Exception( 'Invalid value specified for \'usr_uid\''));
|
||||
}
|
||||
$fields = $ws->newCaseImpersonate($processUid, $userUid, $variables, $taskUid);
|
||||
$array = json_decode(json_encode($fields), true);
|
||||
if ($array ["status_code"] != 0) {
|
||||
|
||||
@@ -14,6 +14,10 @@ class InputDocument
|
||||
public function getCasesInputDocuments($applicationUid, $userUid)
|
||||
{
|
||||
try {
|
||||
$oApplication = \ApplicationPeer::retrieveByPk($applicationUid);
|
||||
if (!is_object($oApplication)) {
|
||||
throw (new \Exception("The Application with app_uid: '$applicationUid' doesn't exist!"));
|
||||
}
|
||||
$sApplicationUID = $applicationUid;
|
||||
$sUserUID = $userUid;
|
||||
\G::LoadClass('case');
|
||||
@@ -60,7 +64,7 @@ class InputDocument
|
||||
try {
|
||||
$oAppDocument = \AppDocumentPeer::retrieveByPK( $inputDocumentUid, 1 );
|
||||
if (is_null( $oAppDocument ) || $oAppDocument->getAppDocStatus() == 'DELETED') {
|
||||
throw (new \Exception('This input document with id: '.$inputDocumentUid.' doesn\'t exist!'));
|
||||
throw (new \Exception('This input document with inp_doc_uid: '.$inputDocumentUid.' doesn\'t exist!'));
|
||||
}
|
||||
$sApplicationUID = $applicationUid;
|
||||
$sUserUID = $userUid;
|
||||
@@ -109,7 +113,7 @@ class InputDocument
|
||||
try {
|
||||
$oAppDocument = \AppDocumentPeer::retrieveByPK( $inputDocumentUid, 1 );
|
||||
if (is_null( $oAppDocument ) || $oAppDocument->getAppDocStatus() == 'DELETED') {
|
||||
throw (new \Exception('This input document with id: '.$inputDocumentUid.' doesn\'t exist!'));
|
||||
throw (new \Exception('This input document with inp_doc_uid: '.$inputDocumentUid.' doesn\'t exist!'));
|
||||
}
|
||||
\G::LoadClass('wsBase');
|
||||
$ws = new \wsBase();
|
||||
|
||||
Reference in New Issue
Block a user