Merged in paulis/processmaker/MT-103 (pull request #4053)

MT-103
This commit is contained in:
Julio Cesar Laura Avendaño
2016-04-06 15:34:33 -04:00
2 changed files with 17 additions and 5 deletions

View File

@@ -36,6 +36,19 @@ class ProcessDefinitionMigrator implements Importable, Exportable
try {
//Bpmn elements
$pjrUid =$this->bpmn->createFromStruct($data['bpmn'], false);
//Import workflow elements
$this->afterImport($data);
} catch (\Exception $e) {
$exception = new ImportException($e->getMessage());
$exception->setNameException($this->className);
throw($exception);
}
}
public function afterImport($data)
{
try {
//Workflow elements
$this->processes->createTaskRows($data['workflow']['tasks']);
$this->processes->createTaskUserRows($data['workflow']['taskusers']);
@@ -70,11 +83,6 @@ class ProcessDefinitionMigrator implements Importable, Exportable
}
}
public function afterImport($data)
{
// TODO: Implement afterImport() method.
}
public function beforeExport()
{
// TODO: Implement beforeExport() method.

View File

@@ -253,6 +253,10 @@ abstract class Importer
$granularObj->import($objectList);
}
}
if($option === self::IMPORT_OPTION_CREATE_NEW || $option === self::IMPORT_OPTION_KEEP_WITHOUT_CHANGING_AND_CREATE_NEW){
$oProcessDef = new \ProcessMaker\BusinessModel\Migrator\ProcessDefinitionMigrator();
$oProcessDef->afterImport($this->importData['tables']);
}
return $projectUid;
}