MT-76: Fixed the case when the update for process defintion was broken. Please Review.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
namespace ProcessMaker\BusinessModel\Migrator;
|
||||
|
||||
use ProcessMaker\Importer\XmlImporter;
|
||||
use ProcessMaker\Project\Adapter;
|
||||
|
||||
class GranularImporter
|
||||
@@ -182,13 +183,15 @@ class GranularImporter
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function validateImportData($objectList)
|
||||
public function validateImportData($objectList, $option)
|
||||
{
|
||||
try {
|
||||
if (count($objectList) !== count($this->exportObjects->getObjectsList())) {
|
||||
$exception = new ImportException();
|
||||
$exception->setNameException(\G::LoadTranslation('ID_PROCESS_DEFINITION_INCOMPLETE'));
|
||||
throw($exception);
|
||||
if (XmlImporter::IMPORT_OPTION_OVERWRITE !== $option) {
|
||||
if (count($objectList) !== count($this->exportObjects->getObjectsList())) {
|
||||
$exception = new ImportException();
|
||||
$exception->setNameException(\G::LoadTranslation('ID_PROCESS_DEFINITION_INCOMPLETE'));
|
||||
throw($exception);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
|
||||
@@ -234,7 +234,7 @@ abstract class Importer
|
||||
$granularObj = new \ProcessMaker\BusinessModel\Migrator\GranularImporter();
|
||||
$newObjectArray = $objectsToImport;
|
||||
$projectUid = $this->importData['tables']['bpmn']["project"][0]["prj_uid"];
|
||||
$processGranulate = $granularObj->validateImportData($objectsToImport);
|
||||
$processGranulate = $granularObj->validateImportData($objectsToImport, $option);
|
||||
if($generateUid){
|
||||
$result = $granularObj->regenerateAllUids($this->importData, $generateUid);
|
||||
$this->importData = $result['data'];
|
||||
|
||||
Reference in New Issue
Block a user