This commit is contained in:
Paula V. Quispe
2016-04-06 10:51:44 -04:00
parent 5a19f99035
commit 50a84119ba
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;
}