This commit is contained in:
Paula V. Quispe
2016-03-29 09:21:30 -04:00
parent 0918ec60ec
commit d5c6140775
3 changed files with 33 additions and 7 deletions

View File

@@ -301,7 +301,7 @@ class Tasks
/** /**
* updates row tasks from an Route Array * updates row tasks from an Route Array
* *
* @param string $aTasks * @param string $aRoutes
* @return array * @return array
*/ */
public function updateRouteRows($aRoutes) public function updateRouteRows($aRoutes)

View File

@@ -51,8 +51,10 @@ class GranularImporter
$objectList = array(); $objectList = array();
switch ($nameObject) { switch ($nameObject) {
case 'PROCESSDEFINITION': case 'PROCESSDEFINITION':
$objectList['PROCESSDEFINITION'] = isset($data['tables']['bpmn']) ? $this->structureBpmnData $objectList['PROCESSDEFINITION']['bpmn'] = isset($data['tables']['bpmn']) ? $this->structureBpmnData
($data['tables']['bpmn']) : ''; ($data['tables']['bpmn']) : '';
$objectList['PROCESSDEFINITION']['workflow'] = isset($data['tables']['workflow']) ?
$data['tables']['workflow'] : '';
break; break;
case 'ASSIGNMENTRULES': case 'ASSIGNMENTRULES':
$objectList['ASSIGNMENTRULES']['tasks'] = isset($data['tables']['workflow']['tasks']) ? $objectList['ASSIGNMENTRULES']['tasks'] = isset($data['tables']['workflow']['tasks']) ?

View File

@@ -27,11 +27,35 @@ class ProcessDefinitionMigrator implements Importable, Exportable
public function import($data, $replace) public function import($data, $replace)
{ {
try { try {
if ($replace) { //Bpmn elements
$this->bpmn->createFromStruct($data, false); $pjrUid =$this->bpmn->createFromStruct($data['bpmn'], false);
} else { //Workflow elements
$this->bpmn->updateFromStruct($data['prj_uid'], $data, false); $this->processes->createTaskRows($data['workflow']['tasks']);
} $this->processes->createTaskUserRows($data['workflow']['taskusers']);
$this->processes->createRouteRows($data['workflow']['routes']);
$this->processes->createLaneRows($data['workflow']['lanes']);
$this->processes->createGatewayRows($data['workflow']['gateways']);
$this->processes->createStepRows($data['workflow']['steps']);
$this->processes->createStepTriggerRows($data['workflow']['steptriggers']);
$this->processes->createSubProcessRows($data['workflow']['subProcess']);
$this->processes->createCaseTrackerRows($data['workflow']['caseTracker']);
$this->processes->createCaseTrackerObjectRows($data['workflow']['caseTrackerObject']);
$this->processes->createStageRows($data['workflow']['stage']);
$this->processes->createFieldCondition($data['workflow']['fieldCondition'], $data['workflow']['dynaforms']);
$this->processes->createEventRows($data['workflow']['event']);
$this->processes->createCaseSchedulerRows($data['workflow']['caseScheduler']);
$this->processes->createProcessCategoryRow($data['workflow']['processCategory']);
$this->processes->createTaskExtraPropertiesRows($data['workflow']['taskExtraProperties']);
$this->processes->createWebEntry($data['workflow']['process']['PRO_UID'], $data['workflow']['process']['PRO_CREATE_USER'], $data['workflow']['webEntry']);
$this->processes->createWebEntryEvent($data['workflow']['process']['PRO_UID'], $data['workflow']['process']['PRO_CREATE_USER'], $data['workflow']['webEntryEvent']);
$this->processes->createMessageType($data['workflow']['messageType']);
$this->processes->createMessageTypeVariable($data['workflow']['messageTypeVariable']);
$this->processes->createMessageEventDefinition($data['workflow']['process']['PRO_UID'],$data['workflow']['messageEventDefinition']);
$this->processes->createScriptTask($data['workflow']['process']['PRO_UID'], $data['workflow']['scriptTask']);
$this->processes->createTimerEvent($data['workflow']['process']['PRO_UID'], $data['workflow']['timerEvent']);
$this->processes->createEmailEvent($data['workflow']['process']['PRO_UID'], $data['workflow']['emailEvent']);
$this->processes->createActionsByEmail($data['workflow']['process']['PRO_UID'], $data['workflow']['abeConfiguration']);
} catch (\Exception $e) { } catch (\Exception $e) {
return $e->getMessage(); return $e->getMessage();
} }