@@ -2600,6 +2600,7 @@ class Processes
|
||||
|
||||
/**
|
||||
* @param $aStepSupervisor
|
||||
* @throws Exception
|
||||
*/
|
||||
public function updateStepSupervisorRows ($aStepSupervisor)
|
||||
{
|
||||
@@ -2719,6 +2720,7 @@ class Processes
|
||||
|
||||
/**
|
||||
* @param $aPermission
|
||||
* @throws Exception
|
||||
*/
|
||||
public function createObjectPermissionRows ($aPermission)
|
||||
{
|
||||
@@ -2737,6 +2739,7 @@ class Processes
|
||||
|
||||
/**
|
||||
* @param $aPermission
|
||||
* @throws Exception
|
||||
*/
|
||||
public function updateObjectPermissionRows ($aPermission)
|
||||
{
|
||||
|
||||
@@ -25,13 +25,21 @@ class DBConnectionMigrator implements Importable, Exportable
|
||||
// TODO: Implement beforeImport() method.
|
||||
}
|
||||
|
||||
public function import($data)
|
||||
/**
|
||||
* @param $data
|
||||
* @param $replace
|
||||
*/
|
||||
public function import($data, $replace)
|
||||
{
|
||||
try {
|
||||
$this->processes->createDBConnectionsRows($data);
|
||||
if ($replace) {
|
||||
$this->processes->createDBConnectionsRows($data);
|
||||
} else {
|
||||
$this->processes->updateDBConnectionsRows($data);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
\Logger::log($e->getMessage());
|
||||
throw new ImportException($e->getMessage());
|
||||
throwException(new ImportException($e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,13 +24,21 @@ class DynaformsMigrator implements Importable, Exportable
|
||||
// TODO: Implement beforeImport() method.
|
||||
}
|
||||
|
||||
public function import($data)
|
||||
/**
|
||||
* @param $data
|
||||
* @param $replace
|
||||
*/
|
||||
public function import($data, $replace)
|
||||
{
|
||||
try {
|
||||
$this->processes->createDynaformRows($data);
|
||||
if ($replace) {
|
||||
$this->processes->createDynaformRows($data);
|
||||
} else {
|
||||
$this->processes->updateDynaformRows($data);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
\Logger::log($e->getMessage());
|
||||
throw new ImportException($e->getMessage());
|
||||
throwException(new ImportException($e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,11 @@ class FilesMigrator implements Importable, Exportable
|
||||
// TODO: Implement beforeImport() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $data
|
||||
* @param $replace
|
||||
* @throws ImportException
|
||||
*/
|
||||
public function import($data, $replace)
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -22,36 +22,37 @@ class GranularImporter
|
||||
/**
|
||||
* Load Objects List Selected
|
||||
*/
|
||||
public function loadObjectsListSelected($data, $aGranular) {
|
||||
public function loadObjectsListSelected($data, $aGranular)
|
||||
{
|
||||
$objectList = array();
|
||||
if(in_array('PROCESSDEFINITION', $aGranular)){
|
||||
if (in_array('PROCESSDEFINITION', $aGranular)) {
|
||||
$objectList['PROCESSDEFINITION'] = $this->structureBpmnData($data['tables']['bpmn']);
|
||||
}
|
||||
if(in_array('ASSIGNMENTRULES', $aGranular)){
|
||||
if (in_array('ASSIGNMENTRULES', $aGranular)) {
|
||||
$objectList['ASSIGNMENTRULES'] = $data['tables']['workflow']['tasks'];
|
||||
}
|
||||
if(in_array('VARIABLES', $aGranular)){
|
||||
if (in_array('VARIABLES', $aGranular)) {
|
||||
$objectList['VARIABLES'] = $data['tables']['workflow']['processVariables'];
|
||||
}
|
||||
if(in_array('DYNAFORMS', $aGranular)){
|
||||
if (in_array('DYNAFORMS', $aGranular)) {
|
||||
$objectList['DYNAFORMS'] = $data['tables']['workflow']['dynaforms'];
|
||||
}
|
||||
if(in_array('INPUTDOCUMENTS', $aGranular)){
|
||||
if (in_array('INPUTDOCUMENTS', $aGranular)) {
|
||||
$objectList['INPUTDOCUMENTS'] = $data['tables']['workflow']['inputs'];
|
||||
}
|
||||
if(in_array('OUTPUTDOCUMENTS', $aGranular)){
|
||||
if (in_array('OUTPUTDOCUMENTS', $aGranular)) {
|
||||
$objectList['OUTPUTDOCUMENTS'] = $data['tables']['workflow']['outputs'];
|
||||
}
|
||||
if(in_array('TRIGGERS', $aGranular)){
|
||||
if (in_array('TRIGGERS', $aGranular)) {
|
||||
$objectList['TRIGGERS'] = $data['tables']['workflow']['triggers'];
|
||||
}
|
||||
if(in_array('TEMPLATES', $aGranular)){
|
||||
if (in_array('TEMPLATES', $aGranular)) {
|
||||
$objectList['TEMPLATES']['TABLE'] = $data['tables']['workflow']['filesManager'];
|
||||
$objectList['TEMPLATES']['PATH'] = $data['files']['workflow'];
|
||||
$objectList['TEMPLATES']['PATH'] = $data['files']['workflow'];
|
||||
}
|
||||
if(in_array('FILES', $aGranular)){
|
||||
if (in_array('FILES', $aGranular)) {
|
||||
$objectList['FILES']['TABLE'] = $data['tables']['workflow']['filesManager'];
|
||||
$objectList['FILES']['PATH'] = $data['files']['workflow'];
|
||||
$objectList['FILES']['PATH'] = $data['files']['workflow'];
|
||||
}
|
||||
return $objectList;
|
||||
}
|
||||
@@ -59,21 +60,22 @@ class GranularImporter
|
||||
/**
|
||||
* Update the structure from File
|
||||
*/
|
||||
public function structureBpmnData(array $tables){
|
||||
public function structureBpmnData(array $tables)
|
||||
{
|
||||
$project = $tables["project"][0];
|
||||
$diagram = $tables["diagram"][0];
|
||||
$diagram["activities"] = (isset($tables["activity"])) ? $tables["activity"] : array();
|
||||
$diagram["artifacts"] = (isset($tables["artifact"])) ? $tables["artifact"] : array();
|
||||
$diagram["events"] = (isset($tables["event"])) ? $tables["event"] : array();
|
||||
$diagram["flows"] = (isset($tables["flow"])) ? $tables["flow"] : array();
|
||||
$diagram["gateways"] = (isset($tables["gateway"])) ? $tables["gateway"] : array();
|
||||
$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];
|
||||
$diagram["artifacts"] = (isset($tables["artifact"])) ? $tables["artifact"] : array();
|
||||
$diagram["events"] = (isset($tables["event"])) ? $tables["event"] : array();
|
||||
$diagram["flows"] = (isset($tables["flow"])) ? $tables["flow"] : array();
|
||||
$diagram["gateways"] = (isset($tables["gateway"])) ? $tables["gateway"] : array();
|
||||
$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;
|
||||
}
|
||||
|
||||
@@ -85,7 +87,7 @@ class GranularImporter
|
||||
try {
|
||||
foreach ($objectList as $key => $data) {
|
||||
$objClass = $this->factory->create($key);
|
||||
if(is_object($objClass)) {
|
||||
if (is_object($objClass)) {
|
||||
$migratorData = $objClass->import($data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,13 +25,21 @@ class InputDocumentsMigrator implements Importable, Exportable
|
||||
// TODO: Implement beforeImport() method.
|
||||
}
|
||||
|
||||
public function import($data)
|
||||
/**
|
||||
* @param $data
|
||||
* @param $replace
|
||||
*/
|
||||
public function import($data, $replace)
|
||||
{
|
||||
try {
|
||||
$this->processes->createInputRows($data);
|
||||
if ($replace) {
|
||||
$this->processes->createInputRows($data);
|
||||
} else {
|
||||
$this->processes->updateInputRows($data);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
\Logger::log($e->getMessage());
|
||||
throw new ImportException($e->getMessage());
|
||||
throwException(new ImportException($e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class NullMigrator implements Importable, Exportable
|
||||
// TODO: Implement beforeImport() method.
|
||||
}
|
||||
|
||||
public function import($data)
|
||||
public function import($data, $replace)
|
||||
{
|
||||
// TODO: Implement import() method.
|
||||
}
|
||||
|
||||
@@ -27,13 +27,21 @@ class OutputDocumentsMigrator implements Importable, Exportable
|
||||
// TODO: Implement beforeImport() method.
|
||||
}
|
||||
|
||||
public function import($data)
|
||||
/**
|
||||
* @param $data
|
||||
* @param $replace
|
||||
*/
|
||||
public function import($data, $replace)
|
||||
{
|
||||
try {
|
||||
$this->processes->createOutputRows($data);
|
||||
if ($replace) {
|
||||
$this->processes->createOutputRows($data);
|
||||
} else {
|
||||
$this->processes->updateOutputRows($data);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
\Logger::log($e->getMessage());
|
||||
throw new ImportException($e->getMessage());
|
||||
throwException(new ImportException($e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,9 +26,22 @@ class PermissionsMigrator implements Importable, Exportable
|
||||
// TODO: Implement beforeImport() method.
|
||||
}
|
||||
|
||||
public function import($data)
|
||||
/**
|
||||
* @param $data
|
||||
* @param $replace
|
||||
*/
|
||||
public function import($data, $replace)
|
||||
{
|
||||
|
||||
try {
|
||||
if ($replace) {
|
||||
$this->processes->createObjectPermissionsRows($data);
|
||||
} else {
|
||||
$this->processes->updateObjectPermissionRows($data);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
\Logger::log($e->getMessage());
|
||||
throwException(new ImportException($e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
public function afterImport($data)
|
||||
|
||||
@@ -25,9 +25,23 @@ class ReportTablesMigrator implements Importable, Exportable
|
||||
// TODO: Implement beforeImport() method.
|
||||
}
|
||||
|
||||
public function import($data)
|
||||
/**
|
||||
* @param $data
|
||||
* @param $replace
|
||||
*/
|
||||
public function import($data, $replace)
|
||||
{
|
||||
|
||||
try {
|
||||
$aReportTablesVars = array();
|
||||
if ($replace) {
|
||||
$this->processes->createReportTables($data, $aReportTablesVars);
|
||||
} else {
|
||||
$this->processes->updateReportTables($data, $aReportTablesVars);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
\Logger::log($e->getMessage());
|
||||
throwException(new ImportException($e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
public function afterImport($data)
|
||||
|
||||
@@ -26,9 +26,22 @@ class SupervisorsMigrator implements Importable, Exportable
|
||||
// TODO: Implement beforeImport() method.
|
||||
}
|
||||
|
||||
public function import($data)
|
||||
/**
|
||||
* @param $data
|
||||
* @param $replace
|
||||
*/
|
||||
public function import($data, $replace)
|
||||
{
|
||||
|
||||
try {
|
||||
if ($replace) {
|
||||
$this->processes->createProcessUser($data);
|
||||
} else {
|
||||
$this->processes->updateProcessUser($data);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
\Logger::log($e->getMessage());
|
||||
throwException(new ImportException($e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
public function afterImport($data)
|
||||
|
||||
@@ -25,9 +25,22 @@ class SupervisorsObjectsMigrator implements Importable, Exportable
|
||||
// TODO: Implement beforeImport() method.
|
||||
}
|
||||
|
||||
public function import($data)
|
||||
/**
|
||||
* @param $data
|
||||
* @param $replace
|
||||
*/
|
||||
public function import($data, $replace)
|
||||
{
|
||||
|
||||
try {
|
||||
if ($replace) {
|
||||
$this->processes->createStepSupervisorRows($data);
|
||||
} else {
|
||||
$this->processes->updateStepSupervisorRows($data);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
\Logger::log($e->getMessage());
|
||||
throwException(new ImportException($e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
public function afterImport($data)
|
||||
|
||||
Reference in New Issue
Block a user