Merged in dheeyi/processmaker/MT-28 (pull request #3894)

MT-28
This commit is contained in:
Gustavo Cruz
2016-03-22 13:29:19 -04:00
2 changed files with 13 additions and 3 deletions

View File

@@ -26,12 +26,17 @@ class GranularExporter
$this->publisher = new PMXPublisher();
}
/**
* @param $objectList
* @return array|string
* @throws \Exception
*/
public function export($objectList)
{
try {
$this->beforeExport();
$exportObject = new ExportObjects();
$objectList = $exportObject->mapObjectList($objectList);
$this->beforeExport($objectList);
foreach ($objectList as $data) {
$migrator = $this->factory->create($data);
$migratorData = $migrator->export($this->prjuid);
@@ -44,11 +49,11 @@ class GranularExporter
'message' => $e->getMessage()
);
}
}
protected function beforeExport()
{
$objectList = func_get_args()[0];
$bpmnProject = Project\Bpmn::load($this->prjuid);
$projectData = $bpmnProject->getProject();
$getProjectName = $this->publisher->truncateName($projectData['PRJ_NAME'], false);
@@ -78,6 +83,7 @@ class GranularExporter
$data["metadata"]["name"] = $projectData['PRJ_NAME'];
$data["metadata"]["uid"] = $projectData['PRJ_UID'];
$data["metadata"]["export_version"] = $version;
$data["metadata"]["export_objects"] = implode('|', $objectList);
$this->data = $data;
}

View File

@@ -75,11 +75,15 @@ class ProcessDefinitionMigrator implements Importable, Exportable
$oData = new \StdClass();
$oData->process = $this->processes->getProcessRow($prj_uid, false);
$oData->tasks = $this->processes->getTaskRows($prj_uid);
$oDataTask = new \StdClass();
$oDataTask->taskusers = $this->getTaskUserRows( $oData->tasks );
$oData->routes = $this->processes->getRouteRows($prj_uid);
$oData->lanes = $this->processes->getLaneRows($prj_uid);
$oData->gateways = $this->processes->getGatewayRows($prj_uid);
$oData->steps = $this->processes->getStepRows($prj_uid);
$oData->groupwfs = $this->processes->getGroupwfRows($oData->taskusers);
$oData->groupwfs = $this->processes->getGroupwfRows($oDataTask->taskusers);
$oData->steptriggers = $this->processes->getStepTriggerRows($oData->tasks);
$oData->reportTablesVars = $this->processes->getReportTablesVarsRows($prj_uid);
$oData->subProcess = $this->processes->getSubProcessRow($prj_uid);