@@ -298,23 +298,23 @@ class GranularImporter
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $objectList
|
* @param $data
|
||||||
* @param array $data
|
* @param bool $generateUid
|
||||||
* @return data
|
* @return array
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function regenerateAllUids($data, $generateUid = true)
|
public function regenerateAllUids($data, $generateUid = true)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$newData = array();
|
$newData = array();
|
||||||
$arrayBpmnTables = $data["tables"]["bpmn"];
|
$arrayBpmnTables = $data["tables"]["bpmn"];
|
||||||
$arrayWorkflowTables = $data["tables"]["workflow"];
|
$arrayWorkflowTables = $data["tables"]["workflow"];
|
||||||
$arrayWorkflowFiles = $data["files"]["workflow"];
|
$arrayWorkflowFiles = $data["files"]["workflow"];
|
||||||
$result = $this->bpmn->createFromStruct($this->structureBpmnData($arrayBpmnTables), $generateUid);
|
$result = $this->bpmn->createFromStruct($this->structureBpmnData($arrayBpmnTables), $generateUid);
|
||||||
$projectUidOld = $arrayBpmnTables["project"][0]["prj_uid"];
|
$projectUidOld = $arrayBpmnTables["project"][0]["prj_uid"];
|
||||||
$projectUid = ($generateUid)? $result[0]["new_uid"] : $result;
|
$projectUid = ($generateUid) ? $result[0]["new_uid"] : $result;
|
||||||
if ($generateUid) {
|
if ($generateUid) {
|
||||||
$result[0]["object"] = "project";
|
$result[0]["object"] = "project";
|
||||||
$result[0]["old_uid"] = $projectUidOld;
|
$result[0]["old_uid"] = $projectUidOld;
|
||||||
$result[0]["new_uid"] = $projectUid;
|
$result[0]["new_uid"] = $projectUid;
|
||||||
|
|
||||||
@@ -323,12 +323,12 @@ class GranularImporter
|
|||||||
list($arrayWorkflowTables, $arrayWorkflowFiles) = $workflow->updateDataUidByArrayUid($arrayWorkflowTables, $arrayWorkflowFiles, $result);
|
list($arrayWorkflowTables, $arrayWorkflowFiles) = $workflow->updateDataUidByArrayUid($arrayWorkflowTables, $arrayWorkflowFiles, $result);
|
||||||
}
|
}
|
||||||
$newData['tables']['workflow'] = $arrayWorkflowTables;
|
$newData['tables']['workflow'] = $arrayWorkflowTables;
|
||||||
$newData['tables']['plugins'] = $data["tables"]["plugins"];
|
$newData['tables']['plugins'] = isset($data["tables"]["plugins"]) ? $data["tables"]["plugins"] : [];
|
||||||
$newData['files']['workflow'] = $arrayWorkflowFiles;
|
$newData['files']['workflow'] = $arrayWorkflowFiles;
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'data' => $newData,
|
'data' => $newData,
|
||||||
'new_uid' => $projectUid);
|
'new_uid' => $projectUid);
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
|
|||||||
Reference in New Issue
Block a user