PM-1232 "fix. En IE no se visualiza correctamente la importacion de un proceso bpmn" SOLVED

This commit is contained in:
Freddy Daniel Rojas Valda
2015-01-16 14:49:35 -04:00
parent 92874f735f
commit f6be1d3580
2 changed files with 71 additions and 0 deletions

View File

@@ -202,6 +202,18 @@ class Processes
return $oOutput->outputExists( $sUid ); return $oOutput->outputExists( $sUid );
} }
/**
* verify if the object exists
*
* @param string $sUid
* @return boolean
*/
public function processVariableExists ($sUid = '')
{
$oProcessVariable = new ProcessVariables();
return $oProcessVariable->ProcessVariableExists( $sUid );
}
/** /**
* verify if the object exists * verify if the object exists
* *
@@ -638,6 +650,19 @@ class Processes
} }
} }
/**
* get an unused process variables GUID
*
* @return $sProUid
*/
public function getUnusedProcessVariableGUID ()
{
do {
$sNewUid = G::generateUniqueID();
} while ($this->processVariableExists( $sNewUid ));
return $sNewUid;
}
/** /**
* change the GUID for a serialized process * change the GUID for a serialized process
* *
@@ -2111,6 +2136,29 @@ class Processes
} }
} }
/**
* Renew all the unique id for "Process User"
*
* @param $data Object with the data
*
* return void
*/
public function renewAllProcessVariableUid(&$data)
{
try {
$map = array ();
foreach ($data->processVariables as $key => $val) {
if (isset( $val['VAR_UID'] )) {
$newGuid = $this->getUnusedProcessVariableGUID();
$map[$val['VAR_UID']] = $newGuid;
$data->processVariables[$key]['VAR_UID'] = $newGuid;
}
}
} catch (Exception $e) {
throw $e;
}
}
/** /**
* Renew the GUID's for all the Uids for all the elements * Renew the GUID's for all the Uids for all the elements
* *
@@ -2140,6 +2188,7 @@ class Processes
$this->renewAllEvent( $oData ); $this->renewAllEvent( $oData );
$this->renewAllCaseScheduler( $oData ); $this->renewAllCaseScheduler( $oData );
$this->renewAllProcessUserUid($oData); $this->renewAllProcessUserUid($oData);
$this->renewAllProcessVariableUid($oData);
} }
/** /**

22
workflow/engine/classes/model/ProcessVariables.php Normal file → Executable file
View File

@@ -64,4 +64,26 @@ class ProcessVariables extends BaseProcessVariables {
throw($oError); throw($oError);
} }
} }
/**
* verify if process variable row specified in [sUid] exists.
*
* @param string $sUid the uid
*/
public function ProcessVariableExists($sUid)
{
$con = Propel::getConnection(ProcessVariablesPeer::DATABASE_NAME);
try {
$oObj = ProcessVariablesPeer::retrieveByPk($sUid);
if (is_object($oObj) && get_class($oObj) == 'ProcessVariables') {
return true;
} else {
return false;
}
} catch (Exception $oError) {
throw ($oError);
}
}
} // ProcessVariables } // ProcessVariables