@@ -15,9 +15,9 @@ class DynaformsMigrator implements Importable
|
|||||||
/**
|
/**
|
||||||
* DynaformsMigrator constructor.
|
* DynaformsMigrator constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(Processes $processes)
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->processes = $processes;
|
$this->processes = new \Processes();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function beforeImport($data)
|
public function beforeImport($data)
|
||||||
|
|||||||
@@ -19,6 +19,24 @@ class GranularImporter
|
|||||||
$this->factory = new MigratorFactory();
|
$this->factory = new MigratorFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function structureBpmnData(array $tables){
|
||||||
|
$project = $tables["project"][0];
|
||||||
|
$diagram = $tables["diagram"][0];
|
||||||
|
$diagram["activities"] = $tables["activity"];
|
||||||
|
$diagram["artifacts"] = (isset($tables["artifact"]))? $tables["artifact"] : array();
|
||||||
|
$diagram["events"] = $tables["event"];
|
||||||
|
$diagram["flows"] = $tables["flow"];
|
||||||
|
$diagram["gateways"] = $tables["gateway"];
|
||||||
|
$diagram["data"] = (isset($tables["data"]))? $tables["data"] : array();
|
||||||
|
$diagram["participants"] = (isset($tables["participant"]))? $tables["participant"] : array();
|
||||||
|
$diagram["laneset"] = (isset($tables["laneset"]))? $tables["laneset"] : array();
|
||||||
|
$diagram["lanes"] = (isset($tables["lane"]))? $tables["lane"] : array();
|
||||||
|
$project["diagrams"] = array($diagram);
|
||||||
|
$project["prj_author"] = isset($this->data["usr_uid"])? $this->data["usr_uid"]: "00000000000000000000000000000001";
|
||||||
|
$project["process"] = $tables["process"][0];
|
||||||
|
return $project;
|
||||||
|
}
|
||||||
|
|
||||||
public function import($objectList)
|
public function import($objectList)
|
||||||
{
|
{
|
||||||
foreach ($objectList as $key => $data) {
|
foreach ($objectList as $key => $data) {
|
||||||
|
|||||||
@@ -8,9 +8,20 @@
|
|||||||
|
|
||||||
namespace ProcessMaker\BusinessModel\Migrator;
|
namespace ProcessMaker\BusinessModel\Migrator;
|
||||||
|
|
||||||
|
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||||
|
|
||||||
class InputDocumentsMigrator implements Importable
|
class InputDocumentsMigrator implements Importable
|
||||||
{
|
{
|
||||||
|
protected $processes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DynaformsMigrator constructor.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->processes = new \Processes();
|
||||||
|
}
|
||||||
|
|
||||||
public function beforeImport($data)
|
public function beforeImport($data)
|
||||||
{
|
{
|
||||||
// TODO: Implement beforeImport() method.
|
// TODO: Implement beforeImport() method.
|
||||||
@@ -18,7 +29,11 @@ class InputDocumentsMigrator implements Importable
|
|||||||
|
|
||||||
public function import($data)
|
public function import($data)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
|
$this->processes->createInputRows($data);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Logger::log($e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function afterImport($data)
|
public function afterImport($data)
|
||||||
|
|||||||
@@ -8,9 +8,20 @@
|
|||||||
|
|
||||||
namespace ProcessMaker\BusinessModel\Migrator;
|
namespace ProcessMaker\BusinessModel\Migrator;
|
||||||
|
|
||||||
|
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||||
|
|
||||||
class OutputDocumentsMigrator implements Importable
|
class OutputDocumentsMigrator implements Importable
|
||||||
{
|
{
|
||||||
|
protected $processes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DynaformsMigrator constructor.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->processes = new \Processes();
|
||||||
|
}
|
||||||
|
|
||||||
public function beforeImport($data)
|
public function beforeImport($data)
|
||||||
{
|
{
|
||||||
// TODO: Implement beforeImport() method.
|
// TODO: Implement beforeImport() method.
|
||||||
@@ -18,7 +29,11 @@ class OutputDocumentsMigrator implements Importable
|
|||||||
|
|
||||||
public function import($data)
|
public function import($data)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
|
$this->processes->createOutputRows($data);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Logger::log($e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function afterImport($data)
|
public function afterImport($data)
|
||||||
|
|||||||
@@ -8,9 +8,21 @@
|
|||||||
|
|
||||||
namespace ProcessMaker\BusinessModel\Migrator;
|
namespace ProcessMaker\BusinessModel\Migrator;
|
||||||
|
|
||||||
|
use ProcessMaker\Project\Adapter;
|
||||||
|
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||||
|
|
||||||
class ProcessDefinitionMigrator implements Importable, Exportable
|
class ProcessDefinitionMigrator implements Importable, Exportable
|
||||||
{
|
{
|
||||||
|
protected $bpmn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DynaformsMigrator constructor.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->bpmn = new Adapter\BpmnWorkflow();
|
||||||
|
}
|
||||||
|
|
||||||
public function beforeImport($data)
|
public function beforeImport($data)
|
||||||
{
|
{
|
||||||
// TODO: Implement beforeImport() method.
|
// TODO: Implement beforeImport() method.
|
||||||
@@ -18,7 +30,11 @@ class ProcessDefinitionMigrator implements Importable, Exportable
|
|||||||
|
|
||||||
public function import($data)
|
public function import($data)
|
||||||
{
|
{
|
||||||
// TODO: Implement import() method.
|
try {
|
||||||
|
$this->bpmn->createFromStruct($data);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Logger::log($e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function afterImport($data)
|
public function afterImport($data)
|
||||||
|
|||||||
Reference in New Issue
Block a user