From 19083aae3edb7829de7d28418d1302a10380d346 Mon Sep 17 00:00:00 2001 From: "nam.mai" Date: Wed, 15 Nov 2023 11:59:38 +0700 Subject: [PATCH 1/3] IVYPORTAL-14577: Make express an independent marketplace item - Fixed bug: Data provider not loaded - Fixed bug: Date pattern in UserTaskWithMailForm.xhtml not correct - Fixed bug: Adapt callable processes to new approach --- axonivy-express/config/overrides.any | 10 +- ... => CustomDeleteDocumentItemData.ivyClass} | 11 +- ...ss => CustomGetDocumentItemsData.ivyClass} | 11 +- ... => CustomUploadDocumentItemData.ivyClass} | 5 +- .../CustomDeleteDocumentItem.p.json | 83 ++++++++ ...e.p.json => CustomGetDocumentItems.p.json} | 177 +++++++++--------- ...p.json => CustomUploadDocumentItem.p.json} | 111 ++++++++--- .../DeleteDocumentItemOverride.p.json | 79 -------- .../executePredefinedWorkflow.p.json | 6 +- .../util/ExecutingExpressProcessUtils.java | 5 + .../src/ch/ivy/gawfs/ExpressProcessUtils.java | 3 +- .../FormDefinitionProcess.p.json | 4 +- .../UserTaskWithMailForm.xhtml | 2 +- 13 files changed, 287 insertions(+), 220 deletions(-) rename axonivy-express/dataclasses/gawfs/{DeleteDocumentItemOverrideData.ivyClass => CustomDeleteDocumentItemData.ivyClass} (58%) rename axonivy-express/dataclasses/gawfs/{GetDocumentItemsOverrideData.ivyClass => CustomGetDocumentItemsData.ivyClass} (61%) rename axonivy-express/dataclasses/gawfs/{UploadDocumentItemOverrideData.ivyClass => CustomUploadDocumentItemData.ivyClass} (75%) create mode 100644 axonivy-express/processes/Functional Processes/CustomDeleteDocumentItem.p.json rename axonivy-express/processes/Functional Processes/{GetDocumentItemsOverride.p.json => CustomGetDocumentItems.p.json} (61%) rename axonivy-express/processes/Functional Processes/{UploadDocumentItemOverride.p.json => CustomUploadDocumentItem.p.json} (71%) delete mode 100644 axonivy-express/processes/Functional Processes/DeleteDocumentItemOverride.p.json diff --git a/axonivy-express/config/overrides.any b/axonivy-express/config/overrides.any index 77be359..5200e8f 100644 --- a/axonivy-express/config/overrides.any +++ b/axonivy-express/config/overrides.any @@ -1,8 +1,4 @@ -{ - /PROCESS { - /Functional-Processes.DeleteDocumentItem "Functional Processes/DeleteDocumentItemOverride" - /Functional-Processes.UploadDocumentItem "Functional Processes/UploadDocumentItemOverride" - /Functional-Processes.GetDocumentItems "Functional Processes/GetDocumentItemsOverride" - } - /HTML_DIALOG * +{ + /PROCESS * + /HTML_DIALOG * } \ No newline at end of file diff --git a/axonivy-express/dataclasses/gawfs/DeleteDocumentItemOverrideData.ivyClass b/axonivy-express/dataclasses/gawfs/CustomDeleteDocumentItemData.ivyClass similarity index 58% rename from axonivy-express/dataclasses/gawfs/DeleteDocumentItemOverrideData.ivyClass rename to axonivy-express/dataclasses/gawfs/CustomDeleteDocumentItemData.ivyClass index bdf5ada..f3e4dc9 100644 --- a/axonivy-express/dataclasses/gawfs/DeleteDocumentItemOverrideData.ivyClass +++ b/axonivy-express/dataclasses/gawfs/CustomDeleteDocumentItemData.ivyClass @@ -1,5 +1,6 @@ -DeleteDocumentItemOverrideData #class -gawfs #namespace -document com.axonivy.portal.components.ivydata.bo.IvyDocument #field -businessCase ch.ivyteam.ivy.workflow.ICase #field -message String #field +CustomDeleteDocumentItemData #class +gawfs #namespace +document com.axonivy.portal.components.ivydata.bo.IvyDocument #field +businessCase ch.ivyteam.ivy.workflow.ICase #field +message String #field +status com.axonivy.portal.components.enums.CustomProcessStatus #field diff --git a/axonivy-express/dataclasses/gawfs/GetDocumentItemsOverrideData.ivyClass b/axonivy-express/dataclasses/gawfs/CustomGetDocumentItemsData.ivyClass similarity index 61% rename from axonivy-express/dataclasses/gawfs/GetDocumentItemsOverrideData.ivyClass rename to axonivy-express/dataclasses/gawfs/CustomGetDocumentItemsData.ivyClass index debb233..fed02be 100644 --- a/axonivy-express/dataclasses/gawfs/GetDocumentItemsOverrideData.ivyClass +++ b/axonivy-express/dataclasses/gawfs/CustomGetDocumentItemsData.ivyClass @@ -1,5 +1,6 @@ -GetDocumentItemsOverrideData #class -gawfs #namespace -businessCase ch.ivyteam.ivy.workflow.ICase #field -message String #field -documents java.util.List #field +CustomGetDocumentItemsData #class +gawfs #namespace +businessCase ch.ivyteam.ivy.workflow.ICase #field +message String #field +documents java.util.List #field +status com.axonivy.portal.components.enums.CustomProcessStatus #field diff --git a/axonivy-express/dataclasses/gawfs/UploadDocumentItemOverrideData.ivyClass b/axonivy-express/dataclasses/gawfs/CustomUploadDocumentItemData.ivyClass similarity index 75% rename from axonivy-express/dataclasses/gawfs/UploadDocumentItemOverrideData.ivyClass rename to axonivy-express/dataclasses/gawfs/CustomUploadDocumentItemData.ivyClass index aa5664f..8593013 100644 --- a/axonivy-express/dataclasses/gawfs/UploadDocumentItemOverrideData.ivyClass +++ b/axonivy-express/dataclasses/gawfs/CustomUploadDocumentItemData.ivyClass @@ -1,10 +1,11 @@ -UploadDocumentItemOverrideData #class +CustomUploadDocumentItemData #class gawfs #namespace businessCase ch.ivyteam.ivy.workflow.ICase #field message String #field -status com.axonivy.portal.components.enums.UploadDocumentCheckStatus #field +status String #field uploadedDocument ch.ivyteam.ivy.workflow.document.IDocument #field uploadedFile org.primefaces.model.file.UploadedFile #field enableVirusScannerForUploadedDocument Boolean #field enableScriptCheckingForUploadedDocument Boolean #field allowedUploadFileTypes String #field +skip Boolean #field diff --git a/axonivy-express/processes/Functional Processes/CustomDeleteDocumentItem.p.json b/axonivy-express/processes/Functional Processes/CustomDeleteDocumentItem.p.json new file mode 100644 index 0000000..852083d --- /dev/null +++ b/axonivy-express/processes/Functional Processes/CustomDeleteDocumentItem.p.json @@ -0,0 +1,83 @@ +{ + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", + "id" : "18BD123C409BCF3D", + "kind" : "CALLABLE_SUB", + "config" : { + "data" : "gawfs.CustomDeleteDocumentItemData" + }, + "elements" : [ { + "id" : "f1", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 504, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "Script", + "name" : "Delete document item", + "config" : { + "output" : { + "code" : [ + "import ch.ivy.addon.portalkit.util.ExecutingExpressProcessUtils;", + "import com.axonivy.portal.components.enums.CustomProcessStatus;", + "", + "in.status = CustomProcessStatus.SKIP;", + "", + "if (ExecutingExpressProcessUtils.isExpressCase(in.businessCase)) {", + " in.status = CustomProcessStatus.OK;", + " in.businessCase.documents().delete(Long.valueOf(in.document.id));", + " in.message = ivy.cms.co(\"/Dialogs/components/CaseDocument/deleteSucceed\");", + "}" + ] + } + }, + "visual" : { + "at" : { "x" : 376, "y" : 64 } + }, + "connect" : [ + { "id" : "f4", "to" : "f1" } + ] + }, { + "id" : "f5", + "type" : "ProcessAnnotation", + "name" : "Override this sub process to delete file in DMS", + "visual" : { + "at" : { "x" : 184, "y" : 144 }, + "size" : { "width" : 284, "height" : 44 } + } + }, { + "id" : "f0", + "type" : "CallSubStart", + "name" : "portalDeleteDocumentItem(ICase,IvyDocument)", + "config" : { + "signature" : "portalDeleteDocumentItem", + "input" : { + "params" : [ + { "name" : "businessCase", "type" : "ch.ivyteam.ivy.workflow.ICase", "desc" : "" }, + { "name" : "document", "type" : "com.axonivy.portal.components.ivydata.bo.IvyDocument", "desc" : "" } + ], + "map" : { + "out.businessCase" : "param.businessCase", + "out.document" : "param.document" + } + }, + "result" : { + "params" : [ + { "name" : "message", "type" : "String", "desc" : "" }, + { "name" : "status", "type" : "String", "desc" : "" } + ], + "map" : { + "result.message" : "in.message", + "result.status" : "in.status.name()" + } + } + }, + "visual" : { + "at" : { "x" : 120, "y" : 64 }, + "labelOffset" : { "x" : 1, "y" : 41 } + }, + "connect" : [ + { "id" : "f2", "to" : "f3" } + ] + } ] +} \ No newline at end of file diff --git a/axonivy-express/processes/Functional Processes/GetDocumentItemsOverride.p.json b/axonivy-express/processes/Functional Processes/CustomGetDocumentItems.p.json similarity index 61% rename from axonivy-express/processes/Functional Processes/GetDocumentItemsOverride.p.json rename to axonivy-express/processes/Functional Processes/CustomGetDocumentItems.p.json index 5c8208e..7ec186a 100644 --- a/axonivy-express/processes/Functional Processes/GetDocumentItemsOverride.p.json +++ b/axonivy-express/processes/Functional Processes/CustomGetDocumentItems.p.json @@ -1,85 +1,94 @@ -{ - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", - "id" : "16B25F2844868AE2", - "kind" : "CALLABLE_SUB", - "config" : { - "data" : "gawfs.GetDocumentItemsOverrideData" - }, - "elements" : [ { - "id" : "f0", - "type" : "CallSubStart", - "name" : "call(ICase)", - "config" : { - "signature" : "call", - "input" : { - "params" : [ - { "name" : "businessCase", "type" : "ch.ivyteam.ivy.workflow.ICase", "desc" : "" } - ], - "map" : { - "out.businessCase" : "param.businessCase" - } - }, - "result" : { - "params" : [ - { "name" : "documents", "type" : "java.util.List", "desc" : "" }, - { "name" : "message", "type" : "String", "desc" : "" } - ], - "map" : { - "result.documents" : "in.documents", - "result.message" : "in.message" - } - } - }, - "visual" : { - "at" : { "x" : 96, "y" : 64 }, - "labelOffset" : { "x" : 6, "y" : 44 } - }, - "connect" : [ - { "id" : "f4", "to" : "f3" } - ] - }, { - "id" : "f1", - "type" : "CallSubEnd", - "visual" : { - "at" : { "x" : 352, "y" : 64 } - } - }, { - "id" : "f3", - "type" : "Script", - "name" : "get document items", - "config" : { - "output" : { - "code" : [ - "import ch.ivy.addon.portalkit.util.DocumentFileUtils;", - "", - "in.documents = DocumentFileUtils.expressDocuments(in.businessCase);" - ] - }, - "sudo" : true - }, - "visual" : { - "at" : { "x" : 224, "y" : 64 }, - "size" : { "width" : 128, "height" : 60 } - }, - "connect" : [ - { "id" : "f2", "to" : "f1" } - ] - }, { - "id" : "f5", - "type" : "ProcessAnnotation", - "name" : [ - "After get document list from DMS, convert them into List", - "Some mandatory fields when mapping:", - "- id", - "- name", - "- contentType" - ], - "visual" : { - "at" : { "x" : 344, "y" : 240 }, - "size" : { "width" : 624, "height" : 108 } - }, - "connect" : [ - { "id" : "f6", "to" : "f0" } - ] - } ] +{ + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", + "id" : "18BD12E37B7541E4", + "kind" : "CALLABLE_SUB", + "config" : { + "data" : "gawfs.CustomGetDocumentItemsData" + }, + "elements" : [ { + "id" : "f1", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 352, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "Script", + "name" : "get document items", + "config" : { + "output" : { + "code" : [ + "import com.axonivy.portal.components.enums.CustomProcessStatus;", + "import ch.ivy.addon.portalkit.util.ExecutingExpressProcessUtils;", + "import ch.ivy.addon.portalkit.util.DocumentFileUtils;", + "", + "in.status = CustomProcessStatus.SKIP;", + "", + "if (ExecutingExpressProcessUtils.isExpressCase(in.businessCase)) {", + " in.status = CustomProcessStatus.OK;", + " in.documents = DocumentFileUtils.expressDocuments(in.businessCase);", + "}" + ] + }, + "sudo" : true + }, + "visual" : { + "at" : { "x" : 224, "y" : 64 }, + "size" : { "width" : 128, "height" : 60 } + }, + "connect" : [ + { "id" : "f4", "to" : "f1" } + ] + }, { + "id" : "f0", + "type" : "CallSubStart", + "name" : "portalGetDocumentItems(ICase)", + "config" : { + "signature" : "portalGetDocumentItems", + "input" : { + "params" : [ + { "name" : "businessCase", "type" : "ch.ivyteam.ivy.workflow.ICase", "desc" : "" } + ], + "map" : { + "out.businessCase" : "param.businessCase" + } + }, + "result" : { + "params" : [ + { "name" : "documents", "type" : "java.util.List", "desc" : "" }, + { "name" : "message", "type" : "String", "desc" : "" }, + { "name" : "status", "type" : "String", "desc" : "" } + ], + "map" : { + "result.documents" : "in.documents", + "result.message" : "in.message", + "result.status" : "in.status.name()" + } + } + }, + "visual" : { + "at" : { "x" : 72, "y" : 64 }, + "labelOffset" : { "x" : 9, "y" : -23 } + }, + "connect" : [ + { "id" : "f2", "to" : "f3" } + ] + }, { + "id" : "f5", + "type" : "ProcessAnnotation", + "name" : [ + "After get document list from DMS, convert them into List", + "Some mandatory fields when mapping:", + "- id", + "- name", + "- contentType" + ], + "visual" : { + "at" : { "x" : 408, "y" : 216 }, + "size" : { "width" : 624, "height" : 108 } + }, + "connect" : [ + { "id" : "f6", "to" : "f0" } + ] + } ] } \ No newline at end of file diff --git a/axonivy-express/processes/Functional Processes/UploadDocumentItemOverride.p.json b/axonivy-express/processes/Functional Processes/CustomUploadDocumentItem.p.json similarity index 71% rename from axonivy-express/processes/Functional Processes/UploadDocumentItemOverride.p.json rename to axonivy-express/processes/Functional Processes/CustomUploadDocumentItem.p.json index eba49ac..5b120e3 100644 --- a/axonivy-express/processes/Functional Processes/UploadDocumentItemOverride.p.json +++ b/axonivy-express/processes/Functional Processes/CustomUploadDocumentItem.p.json @@ -1,19 +1,37 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "16B267B1A01CFA7E", "kind" : "CALLABLE_SUB", "config" : { - "data" : "gawfs.UploadDocumentItemOverrideData" + "data" : "gawfs.CustomUploadDocumentItemData" }, "elements" : [ { + "id" : "f4", + "type" : "Script", + "name" : "Update status", + "config" : { + "output" : { + "code" : [ + "import com.axonivy.portal.components.enums.CustomProcessStatus;", + "in.status = CustomProcessStatus.SKIP.name();" + ] + } + }, + "visual" : { + "at" : { "x" : 432, "y" : 32 } + }, + "connect" : [ + { "id" : "f15", "to" : "f6", "via" : [ { "x" : 1392, "y" : 32 } ] } + ] + }, { "id" : "f0", "type" : "CallSubStart", "name" : [ - "call(ICase,UploadedFile,", + "portalUploadDocumentItem(ICase,UploadedFile,", "Boolean,Boolean,String)" ], "config" : { - "signature" : "call", + "signature" : "portalUploadDocumentItem", "input" : { "params" : [ { "name" : "businessCase", "type" : "ch.ivyteam.ivy.workflow.ICase", "desc" : "" }, @@ -27,6 +45,7 @@ "out.businessCase" : "param.businessCase", "out.enableScriptCheckingForUploadedDocument" : "param.enableScriptCheckingForUploadedDocument", "out.enableVirusScannerForUploadedDocument" : "param.enableVirusScannerForUploadedDocument", + "out.skip" : "!ch.ivy.addon.portalkit.util.ExecutingExpressProcessUtils.isExpressCase(param.businessCase)", "out.uploadedFile" : "param.uploadedFile" } }, @@ -34,7 +53,7 @@ "params" : [ { "name" : "uploadedDocument", "type" : "ch.ivyteam.ivy.workflow.document.IDocument", "desc" : "" }, { "name" : "message", "type" : "String", "desc" : "" }, - { "name" : "status", "type" : "com.axonivy.portal.components.enums.UploadDocumentCheckStatus", "desc" : "" } + { "name" : "status", "type" : "String", "desc" : "" } ], "map" : { "result.uploadedDocument" : "in.uploadedDocument", @@ -44,20 +63,20 @@ } }, "visual" : { - "at" : { "x" : 96, "y" : 128 }, + "at" : { "x" : 208, "y" : 160 }, "labelOffset" : { "x" : -52, "y" : -26 } }, "connect" : [ - { "id" : "f1", "to" : "f17" } + { "id" : "f1", "to" : "f2" } ] }, { "id" : "f8", "type" : "Alternative", "visual" : { - "at" : { "x" : 944, "y" : 224 } + "at" : { "x" : 1096, "y" : 256 } }, "connect" : [ - { "id" : "f24", "to" : "f16", "via" : [ { "x" : 1296, "y" : 224 } ] } + { "id" : "f24", "to" : "f16", "via" : [ { "x" : 1488, "y" : 256 } ] } ] }, { "id" : "f9", @@ -69,7 +88,7 @@ } }, "visual" : { - "at" : { "x" : 400, "y" : 128 }, + "at" : { "x" : 552, "y" : 160 }, "labelOffset" : { "x" : 3, "y" : -14 } }, "connect" : [ @@ -78,7 +97,7 @@ "segment" : 0.26, "offset" : { "x" : 0, "y" : -11 } } }, - { "id" : "f29", "to" : "f12", "via" : [ { "x" : 400, "y" : 224 } ], "label" : { + { "id" : "f29", "to" : "f12", "via" : [ { "x" : 552, "y" : 256 } ], "label" : { "name" : "NO", "segment" : 1.12, "offset" : { "x" : -1, "y" : -9 } @@ -99,21 +118,21 @@ "boolean isUploaded = DocumentFileUtils.uploadExpressDocument(ivy.case, in.uploadedFile.getInputStream(), fileName);", "", "if (isUploaded) {", - " out.status = UploadDocumentCheckStatus.OK;", + " out.status = UploadDocumentCheckStatus.OK.name();", " out.message = ivy.cms.co(\"/ch.ivy.addon.portalkit.ui.jsf/documentFiles/uploadSucceed\");", "} else {", " out.message = ivy.cms.co(\"/ch.ivy.addon.portalkit.ui.jsf/documentFiles/uploadFailed\");", - " out.status = UploadDocumentCheckStatus.FAIL;", + " out.status = UploadDocumentCheckStatus.FAIL.name();", "}" ] }, "sudo" : true }, "visual" : { - "at" : { "x" : 1088, "y" : 128 } + "at" : { "x" : 1240, "y" : 160 } }, "connect" : [ - { "id" : "f22", "to" : "f16" } + { "id" : "f22", "to" : "f6" } ] }, { "id" : "f11", @@ -121,11 +140,11 @@ "name" : "Not exist?", "config" : { "conditions" : { - "f93" : "in.status == com.axonivy.portal.components.enums.UploadDocumentCheckStatus.OK" + "f93" : "in.status == com.axonivy.portal.components.enums.UploadDocumentCheckStatus.OK.name()" } }, "visual" : { - "at" : { "x" : 944, "y" : 128 }, + "at" : { "x" : 1096, "y" : 160 }, "labelOffset" : { "x" : 8, "y" : -14 } }, "connect" : [ @@ -140,7 +159,7 @@ "id" : "f12", "type" : "Alternative", "visual" : { - "at" : { "x" : 688, "y" : 224 } + "at" : { "x" : 840, "y" : 256 } }, "connect" : [ { "id" : "f19", "to" : "f8" } @@ -162,14 +181,14 @@ "", "if (doesDocumentExist) {", " in.message = ivy.cms.co(\"/ch.ivy.addon.portalkit.ui.jsf/documentFiles/uploadFileExists\", [fileName]);", - " in.status = UploadDocumentCheckStatus.FAIL;", + " in.status = UploadDocumentCheckStatus.FAIL.name();", "}" ] }, "sudo" : true }, "visual" : { - "at" : { "x" : 816, "y" : 128 } + "at" : { "x" : 968, "y" : 160 } }, "connect" : [ { "id" : "f20", "to" : "f11" } @@ -180,11 +199,11 @@ "name" : "Document check", "config" : { "conditions" : { - "f27" : "in.status == com.axonivy.portal.components.enums.UploadDocumentCheckStatus.OK" + "f27" : "in.status == com.axonivy.portal.components.enums.UploadDocumentCheckStatus.OK.name()" } }, "visual" : { - "at" : { "x" : 688, "y" : 128 }, + "at" : { "x" : 840, "y" : 160 }, "labelOffset" : { "x" : 0, "y" : -17 } }, "connect" : [ @@ -199,7 +218,7 @@ "id" : "f16", "type" : "CallSubEnd", "visual" : { - "at" : { "x" : 1296, "y" : 128 } + "at" : { "x" : 1488, "y" : 160 } } }, { "id" : "f17", @@ -214,26 +233,26 @@ "import ch.ivy.addon.portalkit.masterdata.MasterData;", "", "in.message = \"\";", - "in.status = UploadDocumentCheckStatus.OK;", + "in.status = UploadDocumentCheckStatus.OK.name();", "", "if (in.uploadedFile == null) {", " in.message = ivy.cms.co(\"/Dialogs/components/CaseDocument/invalidFileMessage\");", - " in.status = UploadDocumentCheckStatus.FAIL;", + " in.status = UploadDocumentCheckStatus.FAIL.name();", "} else if (in.uploadedFile.getSize() == 0) {", " in.message = ivy.cms.co(\"/Dialogs/components/CaseDocument/emptyFileMessage\");", - " in.status = UploadDocumentCheckStatus.FAIL;", + " in.status = UploadDocumentCheckStatus.FAIL.name();", "} else {", " Long maxFileUploadSize = MasterData.getFileUploadSizeLimit();", " if (in.uploadedFile.getSize() > maxFileUploadSize) {", " in.message = ivy.cms.co(\"/ch.ivy.addon.portalkit.ui.jsf/common/errorFileUploadSize\", Arrays.asList(FileUtils.byteCountToDisplaySize(maxFileUploadSize)));", " }", - " in.status = UploadDocumentCheckStatus.FAIL;", + " in.status = UploadDocumentCheckStatus.FAIL.name();", "}" ] } }, "visual" : { - "at" : { "x" : 280, "y" : 128 } + "at" : { "x" : 432, "y" : 160 } }, "connect" : [ { "id" : "f28", "to" : "f9" } @@ -253,16 +272,48 @@ "map" : { "out" : "in", "out.message" : "result.message", - "out.status" : "result.uploadDocumentCheckStatus" + "out.status" : "result.uploadDocumentCheckStatus.toString()" } } }, "visual" : { - "at" : { "x" : 544, "y" : 128 }, + "at" : { "x" : 696, "y" : 160 }, "size" : { "width" : 160, "height" : 60 } }, "connect" : [ { "id" : "f23", "to" : "f14" } ] + }, { + "id" : "f2", + "type" : "Alternative", + "name" : "Skip upload?", + "config" : { + "conditions" : { + "f5" : "in.skip", + "f3" : "" + } + }, + "visual" : { + "at" : { "x" : 304, "y" : 160 } + }, + "connect" : [ + { "id" : "f3", "to" : "f17", "label" : { + "name" : "NO" + } }, + { "id" : "f5", "to" : "f4", "via" : [ { "x" : 304, "y" : 32 } ], "label" : { + "name" : "YES", + "segment" : 1.04, + "offset" : { "x" : -4, "y" : 61 } + } } + ] + }, { + "id" : "f6", + "type" : "Alternative", + "visual" : { + "at" : { "x" : 1392, "y" : 160 } + }, + "connect" : [ + { "id" : "f7", "to" : "f16" } + ] } ] } \ No newline at end of file diff --git a/axonivy-express/processes/Functional Processes/DeleteDocumentItemOverride.p.json b/axonivy-express/processes/Functional Processes/DeleteDocumentItemOverride.p.json deleted file mode 100644 index 5648e4a..0000000 --- a/axonivy-express/processes/Functional Processes/DeleteDocumentItemOverride.p.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", - "id" : "16B266ED2EA90665", - "kind" : "CALLABLE_SUB", - "config" : { - "data" : "gawfs.DeleteDocumentItemOverrideData" - }, - "elements" : [ { - "id" : "f0", - "type" : "CallSubStart", - "name" : "call(ICase,IvyDocument)", - "config" : { - "signature" : "call", - "input" : { - "params" : [ - { "name" : "businessCase", "type" : "ch.ivyteam.ivy.workflow.ICase", "desc" : "" }, - { "name" : "document", "type" : "com.axonivy.portal.components.ivydata.bo.IvyDocument", "desc" : "" } - ], - "map" : { - "out.businessCase" : "param.businessCase", - "out.document" : "param.document" - } - }, - "result" : { - "params" : [ - { "name" : "message", "type" : "String", "desc" : "" } - ], - "map" : { - "result.message" : "in.message" - } - } - }, - "visual" : { - "at" : { "x" : 96, "y" : 64 }, - "labelOffset" : { "x" : 1, "y" : 37 } - }, - "connect" : [ - { "id" : "f4", "to" : "f3" } - ] - }, { - "id" : "f1", - "type" : "CallSubEnd", - "visual" : { - "at" : { "x" : 416, "y" : 64 } - } - }, { - "id" : "f3", - "type" : "Script", - "name" : "Delete document item", - "config" : { - "output" : { - "code" : [ - "import java.util.Arrays;", - "", - "in.businessCase.documents().delete(Long.valueOf(in.document.id));", - "in.message = ivy.cms.co(\"/Dialogs/components/CaseDocument/deleteSucceed\");" - ] - } - }, - "visual" : { - "at" : { "x" : 256, "y" : 64 }, - "size" : { "width" : 128, "height" : 60 } - }, - "connect" : [ - { "id" : "f2", "to" : "f1" } - ] - }, { - "id" : "f5", - "type" : "ProcessAnnotation", - "name" : "Override this sub process to delete file in DMS", - "visual" : { - "at" : { "x" : 288, "y" : 184 }, - "size" : { "width" : 256, "height" : 40 } - }, - "connect" : [ - { "id" : "f6", "to" : "f0" } - ] - } ] -} \ No newline at end of file diff --git a/axonivy-express/processes/Functional Processes/executePredefinedWorkflow.p.json b/axonivy-express/processes/Functional Processes/executePredefinedWorkflow.p.json index a2a1c77..efeeefc 100644 --- a/axonivy-express/processes/Functional Processes/executePredefinedWorkflow.p.json +++ b/axonivy-express/processes/Functional Processes/executePredefinedWorkflow.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "163729F2CBAE7BE4", "kind" : "CALLABLE_SUB", "config" : { @@ -934,8 +934,8 @@ "import java.util.Arrays;", "import com.axonivy.portal.components.service.IvyAdapterService;", "", - "Map x = IvyAdapterService.startSubProcessInApplication(\"handleEndPage()\", null);", - "String callbackUrl = x.get(\"callbackUrl\") as String;", + "Map result = IvyAdapterService.startSubProcessInApplication(\"handleEndPage()\", null);", + "String callbackUrl = result.get(\"callbackUrl\") as String;", "ivy.task.customFields().stringField(CustomFields.EXPRESS_END_PAGE_URL.toString()).set(callbackUrl);" ] }, diff --git a/axonivy-express/src/ch/ivy/addon/portalkit/util/ExecutingExpressProcessUtils.java b/axonivy-express/src/ch/ivy/addon/portalkit/util/ExecutingExpressProcessUtils.java index 02169e4..3b2a7fd 100644 --- a/axonivy-express/src/ch/ivy/addon/portalkit/util/ExecutingExpressProcessUtils.java +++ b/axonivy-express/src/ch/ivy/addon/portalkit/util/ExecutingExpressProcessUtils.java @@ -74,4 +74,9 @@ public static ICase getExpressCase(long caseId) { return CollectionUtils.isEmpty(result) ? null : result.get(0); }); } + + public static boolean isExpressCase(ICase caze) { + String isExpress = caze.customFields().stringField(CustomFields.IS_EXPRESS_PROCESS).getOrDefault("false"); + return Boolean.parseBoolean(isExpress); + } } diff --git a/axonivy-express/src/ch/ivy/gawfs/ExpressProcessUtils.java b/axonivy-express/src/ch/ivy/gawfs/ExpressProcessUtils.java index 3b0accf..645eb69 100644 --- a/axonivy-express/src/ch/ivy/gawfs/ExpressProcessUtils.java +++ b/axonivy-express/src/ch/ivy/gawfs/ExpressProcessUtils.java @@ -444,8 +444,7 @@ public boolean isProcessNameDuplicated(String processName) { public List findDataProviders() { Builder subprocessFilter = SubProcessSearchFilter.create(); SubProcessSearchFilter filter = subprocessFilter.setSignature("portalExpressDataProvider()") - .setSearchInAllProjects(true) - .setSearchInDependentProjects(false).toFilter(); + .setSearchInAllProjects(true).toFilter(); return SubProcessRunner.findSubProcessStarts(filter).stream().map(this::toDataProvider).collect(Collectors.toList()); } diff --git a/axonivy-express/src_hd/ch/ivy/gawfs/workflowCreation/FormDefinition/FormDefinitionProcess.p.json b/axonivy-express/src_hd/ch/ivy/gawfs/workflowCreation/FormDefinition/FormDefinitionProcess.p.json index 1348576..d6dfb03 100644 --- a/axonivy-express/src_hd/ch/ivy/gawfs/workflowCreation/FormDefinition/FormDefinitionProcess.p.json +++ b/axonivy-express/src_hd/ch/ivy/gawfs/workflowCreation/FormDefinition/FormDefinitionProcess.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "1574EBDBE9576CED", "kind" : "HTML_DIALOG", "config" : { @@ -275,7 +275,7 @@ } }, "visual" : { - "at" : { "x" : 265, "y" : 288 }, + "at" : { "x" : 264, "y" : 288 }, "size" : { "width" : 144, "height" : 60 } }, "connect" : [ diff --git a/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/UserTaskWithMailForm/UserTaskWithMailForm.xhtml b/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/UserTaskWithMailForm/UserTaskWithMailForm.xhtml index 446220c..922bf5d 100644 --- a/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/UserTaskWithMailForm/UserTaskWithMailForm.xhtml +++ b/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/UserTaskWithMailForm/UserTaskWithMailForm.xhtml @@ -42,7 +42,7 @@ - From 59ad147e37f83cbf873f329b18d24c9616b3f154 Mon Sep 17 00:00:00 2001 From: "nam.mai" Date: Wed, 15 Nov 2023 12:00:23 +0700 Subject: [PATCH 2/3] IVYPORTAL-14577: Make express an independent marketplace item - Convert to latest ivy version --- .../processes/Functional Processes/HandleEndPage.p.json | 2 +- .../processes/Functional Processes/ParallelTasksUtil.p.json | 2 +- axonivy-express/processes/Start Processes/CreateWorkflow.p.json | 2 +- axonivy-express/processes/Start Processes/EndPage.p.json | 2 +- axonivy-express/processes/Start Processes/ExpressStart.p.json | 2 +- .../Start Processes/GenericPredefinedWorkflowStart.p.json | 2 +- .../ch/ivy/addon/express/generic/EndPage/EndPageProcess.p.json | 2 +- .../ExpressBusinessView/ExpressBusinessViewProcess.p.json | 2 +- .../gawfs/component/ApprovalResult/ApprovalResultProcess.p.json | 2 +- .../src_hd/ch/ivy/gawfs/component/Email/EmailProcess.p.json | 2 +- .../FinishedUserTasksForm/FinishedUserTasksFormProcess.p.json | 2 +- .../WorkflowDefinition/WorkflowDefinitionProcess.p.json | 2 +- .../workflowExecution/ApprovalForm/ApprovalFormProcess.p.json | 2 +- .../FinalReviewForm/FinalReviewFormProcess.p.json | 2 +- .../workflowExecution/UserTaskForm/UserTaskFormProcess.p.json | 2 +- .../UserTaskWithMailForm/UserTaskWithMailFormProcess.p.json | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/axonivy-express/processes/Functional Processes/HandleEndPage.p.json b/axonivy-express/processes/Functional Processes/HandleEndPage.p.json index 2b97273..21787fe 100644 --- a/axonivy-express/processes/Functional Processes/HandleEndPage.p.json +++ b/axonivy-express/processes/Functional Processes/HandleEndPage.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "160070C3BA6D3702", "kind" : "CALLABLE_SUB", "config" : { diff --git a/axonivy-express/processes/Functional Processes/ParallelTasksUtil.p.json b/axonivy-express/processes/Functional Processes/ParallelTasksUtil.p.json index c812d44..9e08a31 100644 --- a/axonivy-express/processes/Functional Processes/ParallelTasksUtil.p.json +++ b/axonivy-express/processes/Functional Processes/ParallelTasksUtil.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "1549EAD7E9C3125A", "kind" : "CALLABLE_SUB", "config" : { diff --git a/axonivy-express/processes/Start Processes/CreateWorkflow.p.json b/axonivy-express/processes/Start Processes/CreateWorkflow.p.json index 42ffc1c..e8f9ad1 100644 --- a/axonivy-express/processes/Start Processes/CreateWorkflow.p.json +++ b/axonivy-express/processes/Start Processes/CreateWorkflow.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "15798655494F25E1", "config" : { "data" : "gawfs.createWorkflowData" diff --git a/axonivy-express/processes/Start Processes/EndPage.p.json b/axonivy-express/processes/Start Processes/EndPage.p.json index 0d61efb..4e82512 100644 --- a/axonivy-express/processes/Start Processes/EndPage.p.json +++ b/axonivy-express/processes/Start Processes/EndPage.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "1600BDF7CC0AE52F", "config" : { "data" : "ch.ivy.addon.express.generic.HandleEndPageData" diff --git a/axonivy-express/processes/Start Processes/ExpressStart.p.json b/axonivy-express/processes/Start Processes/ExpressStart.p.json index db9132d..c679e13 100644 --- a/axonivy-express/processes/Start Processes/ExpressStart.p.json +++ b/axonivy-express/processes/Start Processes/ExpressStart.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "17326FC2F133FBEA", "config" : { "data" : "gawfs.ExpressStartData" diff --git a/axonivy-express/processes/Start Processes/GenericPredefinedWorkflowStart.p.json b/axonivy-express/processes/Start Processes/GenericPredefinedWorkflowStart.p.json index 519f6b4..f77455b 100644 --- a/axonivy-express/processes/Start Processes/GenericPredefinedWorkflowStart.p.json +++ b/axonivy-express/processes/Start Processes/GenericPredefinedWorkflowStart.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "15797DC22608DA55", "config" : { "data" : "gawfs.GenericPredefinedWorkflowStartData" diff --git a/axonivy-express/src_hd/ch/ivy/addon/express/generic/EndPage/EndPageProcess.p.json b/axonivy-express/src_hd/ch/ivy/addon/express/generic/EndPage/EndPageProcess.p.json index 4a83a96..92bd663 100644 --- a/axonivy-express/src_hd/ch/ivy/addon/express/generic/EndPage/EndPageProcess.p.json +++ b/axonivy-express/src_hd/ch/ivy/addon/express/generic/EndPage/EndPageProcess.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "1600BE1A78894BD6", "kind" : "HTML_DIALOG", "config" : { diff --git a/axonivy-express/src_hd/ch/ivy/addon/express/generic/ExpressBusinessView/ExpressBusinessViewProcess.p.json b/axonivy-express/src_hd/ch/ivy/addon/express/generic/ExpressBusinessView/ExpressBusinessViewProcess.p.json index 9690365..b6fb2ea 100644 --- a/axonivy-express/src_hd/ch/ivy/addon/express/generic/ExpressBusinessView/ExpressBusinessViewProcess.p.json +++ b/axonivy-express/src_hd/ch/ivy/addon/express/generic/ExpressBusinessView/ExpressBusinessViewProcess.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "17326ECC60698A9A", "kind" : "HTML_DIALOG", "config" : { diff --git a/axonivy-express/src_hd/ch/ivy/gawfs/component/ApprovalResult/ApprovalResultProcess.p.json b/axonivy-express/src_hd/ch/ivy/gawfs/component/ApprovalResult/ApprovalResultProcess.p.json index 97f31ef..a9b75e7 100644 --- a/axonivy-express/src_hd/ch/ivy/gawfs/component/ApprovalResult/ApprovalResultProcess.p.json +++ b/axonivy-express/src_hd/ch/ivy/gawfs/component/ApprovalResult/ApprovalResultProcess.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "163F1E482806861D", "kind" : "HTML_DIALOG", "config" : { diff --git a/axonivy-express/src_hd/ch/ivy/gawfs/component/Email/EmailProcess.p.json b/axonivy-express/src_hd/ch/ivy/gawfs/component/Email/EmailProcess.p.json index b4504d8..734d0f9 100644 --- a/axonivy-express/src_hd/ch/ivy/gawfs/component/Email/EmailProcess.p.json +++ b/axonivy-express/src_hd/ch/ivy/gawfs/component/Email/EmailProcess.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "162CC7D866220C4A", "kind" : "HTML_DIALOG", "config" : { diff --git a/axonivy-express/src_hd/ch/ivy/gawfs/component/FinishedUserTasksForm/FinishedUserTasksFormProcess.p.json b/axonivy-express/src_hd/ch/ivy/gawfs/component/FinishedUserTasksForm/FinishedUserTasksFormProcess.p.json index 3e2e105..8b531a2 100644 --- a/axonivy-express/src_hd/ch/ivy/gawfs/component/FinishedUserTasksForm/FinishedUserTasksFormProcess.p.json +++ b/axonivy-express/src_hd/ch/ivy/gawfs/component/FinishedUserTasksForm/FinishedUserTasksFormProcess.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "163716C0F2A365F7", "kind" : "HTML_DIALOG", "config" : { diff --git a/axonivy-express/src_hd/ch/ivy/gawfs/workflowCreation/WorkflowDefinition/WorkflowDefinitionProcess.p.json b/axonivy-express/src_hd/ch/ivy/gawfs/workflowCreation/WorkflowDefinition/WorkflowDefinitionProcess.p.json index 04870f0..9a65c22 100644 --- a/axonivy-express/src_hd/ch/ivy/gawfs/workflowCreation/WorkflowDefinition/WorkflowDefinitionProcess.p.json +++ b/axonivy-express/src_hd/ch/ivy/gawfs/workflowCreation/WorkflowDefinition/WorkflowDefinitionProcess.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "1576FA61C4EDC8B1", "kind" : "HTML_DIALOG", "config" : { diff --git a/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/ApprovalForm/ApprovalFormProcess.p.json b/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/ApprovalForm/ApprovalFormProcess.p.json index dd548d4..d303cb9 100644 --- a/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/ApprovalForm/ApprovalFormProcess.p.json +++ b/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/ApprovalForm/ApprovalFormProcess.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "162F55163FD8DF16", "kind" : "HTML_DIALOG", "config" : { diff --git a/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/FinalReviewForm/FinalReviewFormProcess.p.json b/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/FinalReviewForm/FinalReviewFormProcess.p.json index 86c063e..4289a7a 100644 --- a/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/FinalReviewForm/FinalReviewFormProcess.p.json +++ b/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/FinalReviewForm/FinalReviewFormProcess.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "163051859F226598", "kind" : "HTML_DIALOG", "config" : { diff --git a/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/UserTaskForm/UserTaskFormProcess.p.json b/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/UserTaskForm/UserTaskFormProcess.p.json index 89922f4..24a78ee 100644 --- a/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/UserTaskForm/UserTaskFormProcess.p.json +++ b/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/UserTaskForm/UserTaskFormProcess.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "162F0A4F9FF3C1EC", "kind" : "HTML_DIALOG", "config" : { diff --git a/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/UserTaskWithMailForm/UserTaskWithMailFormProcess.p.json b/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/UserTaskWithMailForm/UserTaskWithMailFormProcess.p.json index 850542e..1f26c37 100644 --- a/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/UserTaskWithMailForm/UserTaskWithMailFormProcess.p.json +++ b/axonivy-express/src_hd/ch/ivy/gawfs/workflowExecution/UserTaskWithMailForm/UserTaskWithMailFormProcess.p.json @@ -1,5 +1,5 @@ { - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", "id" : "16343BD885A12720", "kind" : "HTML_DIALOG", "config" : { From b3c33f5aec5f63df44a5be04d88ed1fea754a93a Mon Sep 17 00:00:00 2001 From: "nam.mai" Date: Thu, 16 Nov 2023 10:55:31 +0700 Subject: [PATCH 3/3] IVYPORTAL-14577: Make express an independent marketplace item - Adapt changes from old express --- .../CustomDeleteDocumentItem.p.json | 168 +-- .../CustomGetDocumentItems.p.json | 186 +-- .../CustomUploadDocumentItem.p.json | 68 +- .../Functional Processes/HandleEndPage.p.json | 136 +- .../Functional Processes/editWorkflow.p.json | 1180 ++++++++--------- .../src/ch/ivy/gawfs/ExpressProcessUtils.java | 3 +- 6 files changed, 872 insertions(+), 869 deletions(-) diff --git a/axonivy-express/processes/Functional Processes/CustomDeleteDocumentItem.p.json b/axonivy-express/processes/Functional Processes/CustomDeleteDocumentItem.p.json index 852083d..d3bad05 100644 --- a/axonivy-express/processes/Functional Processes/CustomDeleteDocumentItem.p.json +++ b/axonivy-express/processes/Functional Processes/CustomDeleteDocumentItem.p.json @@ -1,83 +1,87 @@ -{ - "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", - "id" : "18BD123C409BCF3D", - "kind" : "CALLABLE_SUB", - "config" : { - "data" : "gawfs.CustomDeleteDocumentItemData" - }, - "elements" : [ { - "id" : "f1", - "type" : "CallSubEnd", - "visual" : { - "at" : { "x" : 504, "y" : 64 } - } - }, { - "id" : "f3", - "type" : "Script", - "name" : "Delete document item", - "config" : { - "output" : { - "code" : [ - "import ch.ivy.addon.portalkit.util.ExecutingExpressProcessUtils;", - "import com.axonivy.portal.components.enums.CustomProcessStatus;", - "", - "in.status = CustomProcessStatus.SKIP;", - "", - "if (ExecutingExpressProcessUtils.isExpressCase(in.businessCase)) {", - " in.status = CustomProcessStatus.OK;", - " in.businessCase.documents().delete(Long.valueOf(in.document.id));", - " in.message = ivy.cms.co(\"/Dialogs/components/CaseDocument/deleteSucceed\");", - "}" - ] - } - }, - "visual" : { - "at" : { "x" : 376, "y" : 64 } - }, - "connect" : [ - { "id" : "f4", "to" : "f1" } - ] - }, { - "id" : "f5", - "type" : "ProcessAnnotation", - "name" : "Override this sub process to delete file in DMS", - "visual" : { - "at" : { "x" : 184, "y" : 144 }, - "size" : { "width" : 284, "height" : 44 } - } - }, { - "id" : "f0", - "type" : "CallSubStart", - "name" : "portalDeleteDocumentItem(ICase,IvyDocument)", - "config" : { - "signature" : "portalDeleteDocumentItem", - "input" : { - "params" : [ - { "name" : "businessCase", "type" : "ch.ivyteam.ivy.workflow.ICase", "desc" : "" }, - { "name" : "document", "type" : "com.axonivy.portal.components.ivydata.bo.IvyDocument", "desc" : "" } - ], - "map" : { - "out.businessCase" : "param.businessCase", - "out.document" : "param.document" - } - }, - "result" : { - "params" : [ - { "name" : "message", "type" : "String", "desc" : "" }, - { "name" : "status", "type" : "String", "desc" : "" } - ], - "map" : { - "result.message" : "in.message", - "result.status" : "in.status.name()" - } - } - }, - "visual" : { - "at" : { "x" : 120, "y" : 64 }, - "labelOffset" : { "x" : 1, "y" : 41 } - }, - "connect" : [ - { "id" : "f2", "to" : "f3" } - ] - } ] +{ + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", + "id" : "16B266ED2EA90665", + "kind" : "CALLABLE_SUB", + "config" : { + "data" : "gawfs.CustomDeleteDocumentItemData" + }, + "elements" : [ { + "id" : "f0", + "type" : "CallSubStart", + "name" : "portalDeleteDocumentItem(ICase,IvyDocument)", + "config" : { + "signature" : "portalDeleteDocumentItem", + "input" : { + "params" : [ + { "name" : "businessCase", "type" : "ch.ivyteam.ivy.workflow.ICase", "desc" : "" }, + { "name" : "document", "type" : "com.axonivy.portal.components.ivydata.bo.IvyDocument", "desc" : "" } + ], + "map" : { + "out.businessCase" : "param.businessCase", + "out.document" : "param.document" + } + }, + "result" : { + "params" : [ + { "name" : "message", "type" : "String", "desc" : "" }, + { "name" : "status", "type" : "String", "desc" : "" } + ], + "map" : { + "result.message" : "in.message", + "result.status" : "in.status.name()" + } + } + }, + "visual" : { + "at" : { "x" : 96, "y" : 64 }, + "labelOffset" : { "x" : 1, "y" : 41 } + }, + "connect" : [ + { "id" : "f4", "to" : "f3" } + ] + }, { + "id" : "f1", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 416, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "Script", + "name" : "Delete document item", + "config" : { + "output" : { + "code" : [ + "import ch.ivy.addon.portalkit.util.ExecutingExpressProcessUtils;", + "import com.axonivy.portal.components.enums.CustomProcessStatus;", + "", + "in.status = CustomProcessStatus.SKIP;", + "", + "if (ExecutingExpressProcessUtils.isExpressCase(in.businessCase)) {", + " in.status = CustomProcessStatus.OK;", + " in.businessCase.documents().delete(Long.valueOf(in.document.id));", + " in.message = ivy.cms.co(\"/Dialogs/components/CaseDocument/deleteSucceed\");", + "}" + ] + } + }, + "visual" : { + "at" : { "x" : 256, "y" : 64 }, + "size" : { "width" : 128, "height" : 60 } + }, + "connect" : [ + { "id" : "f2", "to" : "f1" } + ] + }, { + "id" : "f5", + "type" : "ProcessAnnotation", + "name" : "Override this sub process to delete file in DMS", + "visual" : { + "at" : { "x" : 288, "y" : 184 }, + "size" : { "width" : 256, "height" : 40 } + }, + "connect" : [ + { "id" : "f6", "to" : "f0" } + ] + } ] } \ No newline at end of file diff --git a/axonivy-express/processes/Functional Processes/CustomGetDocumentItems.p.json b/axonivy-express/processes/Functional Processes/CustomGetDocumentItems.p.json index 7ec186a..0786ef9 100644 --- a/axonivy-express/processes/Functional Processes/CustomGetDocumentItems.p.json +++ b/axonivy-express/processes/Functional Processes/CustomGetDocumentItems.p.json @@ -1,94 +1,94 @@ -{ - "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", - "id" : "18BD12E37B7541E4", - "kind" : "CALLABLE_SUB", - "config" : { - "data" : "gawfs.CustomGetDocumentItemsData" - }, - "elements" : [ { - "id" : "f1", - "type" : "CallSubEnd", - "visual" : { - "at" : { "x" : 352, "y" : 64 } - } - }, { - "id" : "f3", - "type" : "Script", - "name" : "get document items", - "config" : { - "output" : { - "code" : [ - "import com.axonivy.portal.components.enums.CustomProcessStatus;", - "import ch.ivy.addon.portalkit.util.ExecutingExpressProcessUtils;", - "import ch.ivy.addon.portalkit.util.DocumentFileUtils;", - "", - "in.status = CustomProcessStatus.SKIP;", - "", - "if (ExecutingExpressProcessUtils.isExpressCase(in.businessCase)) {", - " in.status = CustomProcessStatus.OK;", - " in.documents = DocumentFileUtils.expressDocuments(in.businessCase);", - "}" - ] - }, - "sudo" : true - }, - "visual" : { - "at" : { "x" : 224, "y" : 64 }, - "size" : { "width" : 128, "height" : 60 } - }, - "connect" : [ - { "id" : "f4", "to" : "f1" } - ] - }, { - "id" : "f0", - "type" : "CallSubStart", - "name" : "portalGetDocumentItems(ICase)", - "config" : { - "signature" : "portalGetDocumentItems", - "input" : { - "params" : [ - { "name" : "businessCase", "type" : "ch.ivyteam.ivy.workflow.ICase", "desc" : "" } - ], - "map" : { - "out.businessCase" : "param.businessCase" - } - }, - "result" : { - "params" : [ - { "name" : "documents", "type" : "java.util.List", "desc" : "" }, - { "name" : "message", "type" : "String", "desc" : "" }, - { "name" : "status", "type" : "String", "desc" : "" } - ], - "map" : { - "result.documents" : "in.documents", - "result.message" : "in.message", - "result.status" : "in.status.name()" - } - } - }, - "visual" : { - "at" : { "x" : 72, "y" : 64 }, - "labelOffset" : { "x" : 9, "y" : -23 } - }, - "connect" : [ - { "id" : "f2", "to" : "f3" } - ] - }, { - "id" : "f5", - "type" : "ProcessAnnotation", - "name" : [ - "After get document list from DMS, convert them into List", - "Some mandatory fields when mapping:", - "- id", - "- name", - "- contentType" - ], - "visual" : { - "at" : { "x" : 408, "y" : 216 }, - "size" : { "width" : 624, "height" : 108 } - }, - "connect" : [ - { "id" : "f6", "to" : "f0" } - ] - } ] +{ + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", + "id" : "16B25F2844868AE2", + "kind" : "CALLABLE_SUB", + "config" : { + "data" : "gawfs.CustomGetDocumentItemsData" + }, + "elements" : [ { + "id" : "f0", + "type" : "CallSubStart", + "name" : "portalGetDocumentItems(ICase)", + "config" : { + "signature" : "portalGetDocumentItems", + "input" : { + "params" : [ + { "name" : "businessCase", "type" : "ch.ivyteam.ivy.workflow.ICase", "desc" : "" } + ], + "map" : { + "out.businessCase" : "param.businessCase" + } + }, + "result" : { + "params" : [ + { "name" : "documents", "type" : "java.util.List", "desc" : "" }, + { "name" : "message", "type" : "String", "desc" : "" }, + { "name" : "status", "type" : "String", "desc" : "" } + ], + "map" : { + "result.documents" : "in.documents", + "result.message" : "in.message", + "result.status" : "in.status.name()" + } + } + }, + "visual" : { + "at" : { "x" : 96, "y" : 64 }, + "labelOffset" : { "x" : 6, "y" : 44 } + }, + "connect" : [ + { "id" : "f4", "to" : "f3" } + ] + }, { + "id" : "f1", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 352, "y" : 64 } + } + }, { + "id" : "f3", + "type" : "Script", + "name" : "get document items", + "config" : { + "output" : { + "code" : [ + "import com.axonivy.portal.components.enums.CustomProcessStatus;", + "import ch.ivy.addon.portalkit.util.ExecutingExpressProcessUtils;", + "import ch.ivy.addon.portalkit.util.DocumentFileUtils;", + "", + "in.status = CustomProcessStatus.SKIP;", + "", + "if (ExecutingExpressProcessUtils.isExpressCase(in.businessCase)) {", + " in.status = CustomProcessStatus.OK;", + " in.documents = DocumentFileUtils.expressDocuments(in.businessCase);", + "}" + ] + }, + "sudo" : true + }, + "visual" : { + "at" : { "x" : 224, "y" : 64 }, + "size" : { "width" : 128, "height" : 60 } + }, + "connect" : [ + { "id" : "f2", "to" : "f1" } + ] + }, { + "id" : "f5", + "type" : "ProcessAnnotation", + "name" : [ + "After get document list from DMS, convert them into List", + "Some mandatory fields when mapping:", + "- id", + "- name", + "- contentType" + ], + "visual" : { + "at" : { "x" : 344, "y" : 240 }, + "size" : { "width" : 624, "height" : 108 } + }, + "connect" : [ + { "id" : "f6", "to" : "f0" } + ] + } ] } \ No newline at end of file diff --git a/axonivy-express/processes/Functional Processes/CustomUploadDocumentItem.p.json b/axonivy-express/processes/Functional Processes/CustomUploadDocumentItem.p.json index 5b120e3..cfb56d3 100644 --- a/axonivy-express/processes/Functional Processes/CustomUploadDocumentItem.p.json +++ b/axonivy-express/processes/Functional Processes/CustomUploadDocumentItem.p.json @@ -6,24 +6,6 @@ "data" : "gawfs.CustomUploadDocumentItemData" }, "elements" : [ { - "id" : "f4", - "type" : "Script", - "name" : "Update status", - "config" : { - "output" : { - "code" : [ - "import com.axonivy.portal.components.enums.CustomProcessStatus;", - "in.status = CustomProcessStatus.SKIP.name();" - ] - } - }, - "visual" : { - "at" : { "x" : 432, "y" : 32 } - }, - "connect" : [ - { "id" : "f15", "to" : "f6", "via" : [ { "x" : 1392, "y" : 32 } ] } - ] - }, { "id" : "f0", "type" : "CallSubStart", "name" : [ @@ -63,7 +45,7 @@ } }, "visual" : { - "at" : { "x" : 208, "y" : 160 }, + "at" : { "x" : 96, "y" : 192 }, "labelOffset" : { "x" : -52, "y" : -26 } }, "connect" : [ @@ -73,10 +55,10 @@ "id" : "f8", "type" : "Alternative", "visual" : { - "at" : { "x" : 1096, "y" : 256 } + "at" : { "x" : 984, "y" : 288 } }, "connect" : [ - { "id" : "f24", "to" : "f16", "via" : [ { "x" : 1488, "y" : 256 } ] } + { "id" : "f24", "to" : "f16", "via" : [ { "x" : 1376, "y" : 288 } ] } ] }, { "id" : "f9", @@ -88,7 +70,7 @@ } }, "visual" : { - "at" : { "x" : 552, "y" : 160 }, + "at" : { "x" : 440, "y" : 192 }, "labelOffset" : { "x" : 3, "y" : -14 } }, "connect" : [ @@ -97,7 +79,7 @@ "segment" : 0.26, "offset" : { "x" : 0, "y" : -11 } } }, - { "id" : "f29", "to" : "f12", "via" : [ { "x" : 552, "y" : 256 } ], "label" : { + { "id" : "f29", "to" : "f12", "via" : [ { "x" : 440, "y" : 288 } ], "label" : { "name" : "NO", "segment" : 1.12, "offset" : { "x" : -1, "y" : -9 } @@ -129,7 +111,7 @@ "sudo" : true }, "visual" : { - "at" : { "x" : 1240, "y" : 160 } + "at" : { "x" : 1128, "y" : 192 } }, "connect" : [ { "id" : "f22", "to" : "f6" } @@ -144,7 +126,7 @@ } }, "visual" : { - "at" : { "x" : 1096, "y" : 160 }, + "at" : { "x" : 984, "y" : 192 }, "labelOffset" : { "x" : 8, "y" : -14 } }, "connect" : [ @@ -159,7 +141,7 @@ "id" : "f12", "type" : "Alternative", "visual" : { - "at" : { "x" : 840, "y" : 256 } + "at" : { "x" : 728, "y" : 288 } }, "connect" : [ { "id" : "f19", "to" : "f8" } @@ -188,7 +170,7 @@ "sudo" : true }, "visual" : { - "at" : { "x" : 968, "y" : 160 } + "at" : { "x" : 856, "y" : 192 } }, "connect" : [ { "id" : "f20", "to" : "f11" } @@ -203,7 +185,7 @@ } }, "visual" : { - "at" : { "x" : 840, "y" : 160 }, + "at" : { "x" : 728, "y" : 192 }, "labelOffset" : { "x" : 0, "y" : -17 } }, "connect" : [ @@ -218,7 +200,7 @@ "id" : "f16", "type" : "CallSubEnd", "visual" : { - "at" : { "x" : 1488, "y" : 160 } + "at" : { "x" : 1376, "y" : 192 } } }, { "id" : "f17", @@ -252,7 +234,7 @@ } }, "visual" : { - "at" : { "x" : 432, "y" : 160 } + "at" : { "x" : 320, "y" : 192 } }, "connect" : [ { "id" : "f28", "to" : "f9" } @@ -277,7 +259,7 @@ } }, "visual" : { - "at" : { "x" : 696, "y" : 160 }, + "at" : { "x" : 584, "y" : 192 }, "size" : { "width" : 160, "height" : 60 } }, "connect" : [ @@ -294,23 +276,41 @@ } }, "visual" : { - "at" : { "x" : 304, "y" : 160 } + "at" : { "x" : 192, "y" : 192 } }, "connect" : [ { "id" : "f3", "to" : "f17", "label" : { "name" : "NO" } }, - { "id" : "f5", "to" : "f4", "via" : [ { "x" : 304, "y" : 32 } ], "label" : { + { "id" : "f5", "to" : "f4", "via" : [ { "x" : 192, "y" : 64 } ], "label" : { "name" : "YES", "segment" : 1.04, "offset" : { "x" : -4, "y" : 61 } } } ] + }, { + "id" : "f4", + "type" : "Script", + "name" : "Update status", + "config" : { + "output" : { + "code" : [ + "import com.axonivy.portal.components.enums.CustomProcessStatus;", + "in.status = CustomProcessStatus.SKIP.name();" + ] + } + }, + "visual" : { + "at" : { "x" : 320, "y" : 64 } + }, + "connect" : [ + { "id" : "f15", "to" : "f6", "via" : [ { "x" : 1280, "y" : 64 } ] } + ] }, { "id" : "f6", "type" : "Alternative", "visual" : { - "at" : { "x" : 1392, "y" : 160 } + "at" : { "x" : 1280, "y" : 192 } }, "connect" : [ { "id" : "f7", "to" : "f16" } diff --git a/axonivy-express/processes/Functional Processes/HandleEndPage.p.json b/axonivy-express/processes/Functional Processes/HandleEndPage.p.json index 21787fe..f8088c3 100644 --- a/axonivy-express/processes/Functional Processes/HandleEndPage.p.json +++ b/axonivy-express/processes/Functional Processes/HandleEndPage.p.json @@ -1,69 +1,69 @@ -{ - "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", - "id" : "160070C3BA6D3702", - "kind" : "CALLABLE_SUB", - "config" : { - "data" : "ch.ivy.addon.express.generic.HandleEndPageData" - }, - "elements" : [ { - "id" : "f3", - "type" : "CallSubEnd", - "visual" : { - "at" : { "x" : 393, "y" : 200 } - } - }, { - "id" : "f4", - "type" : "Script", - "name" : "get end page url", - "config" : { - "output" : { - "code" : "in.callbackUrl = ivy.html.startRef(\"1600BDF7CC0AE52F/start.ivp\");" - }, - "sudo" : true - }, - "visual" : { - "at" : { "x" : 265, "y" : 200 } - }, - "connect" : [ - { "id" : "f7", "to" : "f3" } - ] - }, { - "id" : "f5", - "type" : "CallSubStart", - "name" : "handleEndPage()", - "config" : { - "signature" : "handleEndPage", - "result" : { - "params" : [ - { "name" : "callbackUrl", "type" : "String", "desc" : "" } - ], - "map" : { - "result.callbackUrl" : "in.callbackUrl" - } - } - }, - "visual" : { - "at" : { "x" : 89, "y" : 200 } - }, - "connect" : [ - { "id" : "f6", "to" : "f4" } - ] - }, { - "id" : "f0", - "type" : "ProcessAnnotation", - "name" : [ - "HOW TO CREATE CUSTOM END PAGE FOR EXPRESS PROCESS", - "", - "import com.axonivy.portal.components.publicapi.ProcessStartAPI;", - "", - "String ourNewEndPageFriendlyRequestPath = \"Start Processes/NewEndPageOfExpress/startCustomEndPage.ivp\";", - "in.callbackUrl = ProcessStartAPI.findRelativeUrlByProcessStartFriendlyRequestPath(ourNewEndPageFriendlyRequestPath);", - "", - "OUT: callbackUrl : String" - ], - "visual" : { - "at" : { "x" : 384, "y" : 88 }, - "size" : { "width" : 688, "height" : 140 } - } - } ] +{ + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", + "id" : "160070C3BA6D3702", + "kind" : "CALLABLE_SUB", + "config" : { + "data" : "ch.ivy.addon.express.generic.HandleEndPageData" + }, + "elements" : [ { + "id" : "f3", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 393, "y" : 200 } + } + }, { + "id" : "f4", + "type" : "Script", + "name" : "get end page url", + "config" : { + "output" : { + "code" : "in.callbackUrl = ivy.html.startRef(\"1600BDF7CC0AE52F/start.ivp\");" + }, + "sudo" : true + }, + "visual" : { + "at" : { "x" : 265, "y" : 200 } + }, + "connect" : [ + { "id" : "f7", "to" : "f3" } + ] + }, { + "id" : "f5", + "type" : "CallSubStart", + "name" : "handleEndPage()", + "config" : { + "signature" : "handleEndPage", + "result" : { + "params" : [ + { "name" : "callbackUrl", "type" : "String", "desc" : "" } + ], + "map" : { + "result.callbackUrl" : "in.callbackUrl" + } + } + }, + "visual" : { + "at" : { "x" : 89, "y" : 200 } + }, + "connect" : [ + { "id" : "f6", "to" : "f4" } + ] + }, { + "id" : "f0", + "type" : "ProcessAnnotation", + "name" : [ + "HOW TO CREATE CUSTOM END PAGE FOR EXPRESS PROCESS", + "", + "import com.axonivy.portal.components.publicapi.ProcessStartAPI;", + "", + "String ourNewEndPageFriendlyRequestPath = \"Start Processes/NewEndPageOfExpress/startCustomEndPage.ivp\";", + "in.callbackUrl = ProcessStartAPI.findRelativeUrlByProcessStartFriendlyRequestPath(ourNewEndPageFriendlyRequestPath);", + "", + "OUT: callbackUrl : String" + ], + "visual" : { + "at" : { "x" : 384, "y" : 88 }, + "size" : { "width" : 688, "height" : 140 } + } + } ] } \ No newline at end of file diff --git a/axonivy-express/processes/Functional Processes/editWorkflow.p.json b/axonivy-express/processes/Functional Processes/editWorkflow.p.json index 4f7af86..49e1cc0 100644 --- a/axonivy-express/processes/Functional Processes/editWorkflow.p.json +++ b/axonivy-express/processes/Functional Processes/editWorkflow.p.json @@ -1,592 +1,590 @@ -{ - "$schema" : "https://json-schema.axonivy.com/process/11.2.1/process.json", - "id" : "15791C23B125821B", - "kind" : "CALLABLE_SUB", - "config" : { - "data" : "gawfs.Data" - }, - "elements" : [ { - "id" : "S10", - "type" : "EmbeddedProcess", - "name" : "loadWorkflow", - "elements" : [ { - "id" : "S10-f26", - "type" : "Script", - "name" : "get Workflow Credentials", - "config" : { - "output" : { - "code" : [ - "import ch.ivy.addon.portalkit.service.ExpressProcessService;", - "import java.util.ArrayList;", - "import org.apache.commons.collections.CollectionUtils;", - "import ch.ivy.gawfs.enums.ProcessType;", - "import ch.ivy.addon.portalkit.bo.ExpressProcess;", - "import ch.ivy.gawfs.ExpressProcessUtils;", - "", - "ExpressProcess workflow = ExpressProcessService.getInstance().findExpressProcessById(in.processID) as ExpressProcess;", - "", - "in.processDescription = workflow.processDescription;", - "in.processName = workflow.processName;", - "in.processFolder = workflow.processFolder;", - "in.processCoOwners = workflow.processCoOwners;", - "in.processIcon = workflow.icon;", - "//Old processes won't have process co owners, so we add process owner as default", - "if(CollectionUtils.isEmpty(in.processCoOwners)) {", - " in.processCoOwners = new ArrayList();", - " in.processCoOwners.add(workflow.processOwner);", - "}", - "", - "in.processCoOwnersDisplayName = ExpressProcessUtils.generateResponsibleDisplayName(in.processCoOwners);", - "in.isUseDefaultUI = workflow.useDefaultUI;", - "", - "for(ProcessType type : ProcessType.values()) {", - " if (type.getValue() == workflow.processType) {", - " in.processType = type;", - " }", - "}", - "", - "in.definedTasks = ExpressProcessUtils.convertExpressTaskDefinitionToTaskDef(workflow.taskDefinitions);" - ] - }, - "sudo" : true - }, - "visual" : { - "at" : { "x" : 208, "y" : 256 }, - "size" : { "width" : 144, "height" : 60 } - }, - "connect" : [ - { "id" : "S10-f1", "to" : "S10-g1" } - ] - }, { - "id" : "S10-g0", - "type" : "EmbeddedStart", - "name" : "in 1", - "visual" : { - "at" : { "x" : 208, "y" : 104 }, - "size" : { "width" : 26, "height" : 26 }, - "labelOffset" : { "x" : 18, "y" : 25 } - }, - "parentConnector" : "f33", - "connect" : [ - { "id" : "S10-f0", "to" : "S10-f26" } - ] - }, { - "id" : "S10-g1", - "type" : "EmbeddedEnd", - "name" : "out 1", - "visual" : { - "at" : { "x" : 208, "y" : 416 }, - "size" : { "width" : 26, "height" : 26 }, - "labelOffset" : { "x" : 21, "y" : 25 } - }, - "parentConnector" : "f34" - } ], - "visual" : { - "at" : { "x" : 368, "y" : 352 } - }, - "connect" : [ - { "id" : "f34", "to" : "f5" } - ] - }, { - "id" : "f0", - "type" : "CallSubStart", - "name" : "new Workflow", - "config" : { - "signature" : "newWorkflow" - }, - "visual" : { - "at" : { "x" : 80, "y" : 264 } - }, - "connect" : [ - { "id" : "f31", "to" : "f28" } - ] - }, { - "id" : "f5", - "type" : "Script", - "name" : "init steps", - "config" : { - "output" : { - "code" : [ - "if(!in.isAdhocProcess) {", - " in.steps.add(ivy.cms.co(\"/ch.ivy.addon.portalkit.ui.jsf/common/start\"));", - " in.steps.add(ivy.cms.co(\"/Dialogs/workflowCreation/WorkflowDefinition/WorkflowPropertiesStep\"));", - " in.steps.add(ivy.cms.co(\"/Dialogs/workflowCreation/WorkflowDefinition/FormDefinitionStep\"));", - " in.steps.add(ivy.cms.co(\"/Dialogs/workflowCreation/WorkflowDefinition/EndStep\"));", - "}", - "in.discard = false;" - ] - }, - "sudo" : true - }, - "visual" : { - "at" : { "x" : 368, "y" : 264 } - }, - "connect" : [ - { "id" : "f14", "to" : "f13" } - ] - }, { - "id" : "f7", - "type" : "DialogCall", - "name" : "Workflow Settings Dialog", - "config" : { - "dialog" : "ch.ivy.gawfs.workflowCreation.WorkflowDefinition:start(gawfs.Data)", - "call" : { - "map" : { - "param.data" : "in" - } - } - }, - "visual" : { - "at" : { "x" : 640, "y" : 264 }, - "size" : { "width" : 144, "height" : 60 } - }, - "connect" : [ - { "id" : "f26", "to" : "f41" } - ] - }, { - "id" : "f9", - "type" : "Script", - "name" : "Save workflow to Database", - "config" : { - "output" : { - "code" : [ - "import ch.ivy.gawfs.ExpressProcessUtils;", - "", - "//save workflowdescription", - "ExpressProcessUtils.saveProcess(in);" - ] - }, - "sudo" : true - }, - "visual" : { - "at" : { "x" : 1720, "y" : 264 }, - "size" : { "width" : 160, "height" : 60 } - }, - "connect" : [ - { "id" : "f36", "to" : "f35" } - ] - }, { - "id" : "f3", - "type" : "DialogCall", - "name" : "Workflow Formdefinition Dialog", - "config" : { - "dialog" : "ch.ivy.gawfs.workflowCreation.FormDefinition:start(gawfs.Data)", - "call" : { - "map" : { - "param.data" : "in" - } - }, - "output" : { - "map" : { - "out" : "result.data" - } - } - }, - "visual" : { - "at" : { "x" : 1048, "y" : 264 }, - "size" : { "width" : 176, "height" : 60 } - }, - "connect" : [ - { "id" : "f48", "to" : "f45" } - ] - }, { - "id" : "f11", - "type" : "Alternative", - "config" : { - "conditions" : { - "f17" : "in.backFlag==true" - } - }, - "visual" : { - "at" : { "x" : 1272, "y" : 264 } - }, - "connect" : [ - { "id" : "f17", "to" : "f16", "via" : [ { "x" : 1272, "y" : 168 } ] }, - { "id" : "f25", "to" : "f22" } - ] - }, { - "id" : "f13", - "type" : "Alternative", - "visual" : { - "at" : { "x" : 504, "y" : 264 } - }, - "connect" : [ - { "id" : "f8", "to" : "f7" } - ] - }, { - "id" : "f16", - "type" : "Script", - "name" : "Set go back flag", - "config" : { - "output" : { - "map" : { - "out" : "in", - "out.backFlag" : "false", - "out.savedFlag" : "true" - } - } - }, - "visual" : { - "at" : { "x" : 896, "y" : 168 } - }, - "connect" : [ - { "id" : "f15", "to" : "f13", "via" : [ { "x" : 504, "y" : 168 } ] } - ] - }, { - "id" : "f18", - "type" : "Alternative", - "name" : [ - "direct Execution", - "for AHWF" - ], - "config" : { - "conditions" : { - "f55" : "in.processType == ch.ivy.gawfs.enums.ProcessType.AD_HOC" - } - }, - "visual" : { - "at" : { "x" : 1568, "y" : 264 }, - "labelOffset" : { "x" : -25, "y" : -29 } - }, - "connect" : [ - { "id" : "f55", "to" : "f54", "via" : [ { "x" : 1568, "y" : 360 } ], "label" : { - "name" : "yes", - "segment" : 0.31, - "offset" : { "x" : 13, "y" : 0 } - } }, - { "id" : "f24", "to" : "f9" } - ] - }, { - "id" : "f20", - "type" : "SubProcessCall", - "name" : "direct execution of WF if AHWF", - "config" : { - "processCall" : "Functional Processes/executePredefinedWorkflow:call(List,String,String,ch.ivy.gawfs.enums.ProcessType,String,Boolean,Long)", - "call" : { - "map" : { - "param.definedTasks" : "in.definedTasks", - "param.processName" : "in.processName", - "param.processDescription" : "in.processDescription", - "param.processType" : "in.processType", - "param.processID" : "in.processID", - "param.isAdhocProcess" : "in.isAdhocProcess", - "param.originalTaskId" : "in.originalTaskId" - } - } - }, - "visual" : { - "at" : { "x" : 2056, "y" : 360 }, - "size" : { "width" : 176, "height" : 60 } - }, - "connect" : [ - { "id" : "f19", "to" : "f32", "via" : [ { "x" : 2208, "y" : 360 } ] } - ] - }, { - "id" : "f21", - "type" : "CallSubStart", - "name" : "editWorkflow", - "config" : { - "signature" : "editWorkflow", - "input" : { - "params" : [ - { "name" : "workflowID", "type" : "String", "desc" : "" } - ], - "map" : { - "out.processID" : "param.workflowID" - } - } - }, - "visual" : { - "at" : { "x" : 80, "y" : 352 } - }, - "connect" : [ - { "id" : "f39", "to" : "f1" } - ] - }, { - "id" : "f32", - "type" : "CallSubEnd", - "visual" : { - "at" : { "x" : 2208, "y" : 264 } - } - }, { - "id" : "f41", - "type" : "Alternative", - "name" : "Discarded?", - "config" : { - "conditions" : { - "f29" : "!in.discard" - } - }, - "visual" : { - "at" : { "x" : 792, "y" : 264 }, - "labelOffset" : { "x" : 9, "y" : -13 } - }, - "connect" : [ - { "id" : "f29", "to" : "f27" }, - { "id" : "f44", "to" : "f43" } - ] - }, { - "id" : "f43", - "type" : "TaskEnd", - "visual" : { - "at" : { "x" : 792, "y" : 360 } - } - }, { - "id" : "f45", - "type" : "Alternative", - "name" : "exit?", - "config" : { - "conditions" : { - "f47" : "in.discard" - } - }, - "visual" : { - "at" : { "x" : 1208, "y" : 264 } - }, - "connect" : [ - { "id" : "f47", "to" : "f46" }, - { "id" : "f12", "to" : "f11" } - ] - }, { - "id" : "f46", - "type" : "TaskEnd", - "visual" : { - "at" : { "x" : 1208, "y" : 328 } - } - }, { - "id" : "f22", - "type" : "Script", - "name" : "Handle Email attachments", - "config" : { - "output" : { - "code" : [ - "import ch.ivy.gawfs.ExpressProcessUtils;", - "import ch.ivy.gawfs.enums.TaskType;", - "import gawfs.TaskDef;", - "ExpressProcessUtils expressProcesUtils = new ch.ivy.gawfs.ExpressProcessUtils();", - "if(!in.#processFolder is initialized) {", - " in.processFolder = expressProcesUtils.generateProcessFolder();", - "}", - "expressProcesUtils.saveAttachments(in.processFolder, in.definedTasks);" - ] - } - }, - "visual" : { - "at" : { "x" : 1408, "y" : 264 }, - "size" : { "width" : 160, "height" : 60 } - }, - "connect" : [ - { "id" : "f23", "to" : "f18" } - ] - }, { - "id" : "f27", - "type" : "Alternative", - "name" : "Use default template?", - "config" : { - "conditions" : { - "f30" : "in.isUseDefaultUI" - } - }, - "visual" : { - "at" : { "x" : 888, "y" : 264 }, - "labelOffset" : { "x" : 10, "y" : -12 } - }, - "connect" : [ - { "id" : "f30", "to" : "f18", "via" : [ { "x" : 888, "y" : 360 }, { "x" : 1496, "y" : 360 } ], "label" : { - "name" : "yes", - "segment" : 0.35, - "offset" : { "x" : 13, "y" : 0 } - } }, - { "id" : "f4", "to" : "f3", "label" : { - "name" : "no", - "segment" : 0.48, - "offset" : { "x" : 0, "y" : -8 } - } } - ] - }, { - "id" : "f28", - "type" : "Script", - "name" : "Set flags", - "config" : { - "output" : { - "code" : [ - "in.readyToExecute = false;", - "in.editFlag = false;" - ] - } - }, - "visual" : { - "at" : { "x" : 208, "y" : 264 } - }, - "connect" : [ - { "id" : "f6", "to" : "f5" } - ] - }, { - "id" : "f35", - "type" : "Alternative", - "name" : "Is ready to execute?", - "config" : { - "conditions" : { - "f38" : "!in.readyToExecute" - } - }, - "visual" : { - "at" : { "x" : 1888, "y" : 264 }, - "labelOffset" : { "x" : 13, "y" : 38 } - }, - "connect" : [ - { "id" : "f38", "to" : "f37", "label" : { - "name" : "no", - "segment" : 0.45, - "offset" : { "x" : -10, "y" : 0 } - }, "var" : "in1" }, - { "id" : "f40", "to" : "f32", "label" : { - "name" : "yes", - "segment" : 0.41, - "offset" : { "x" : 0, "y" : -10 } - } } - ] - }, { - "id" : "f37", - "type" : "TaskSwitchEvent", - "name" : [ - "Create task to store", - "progress of workflow" - ], - "config" : { - "task" : { - "name" : "<%=ivy.cms.co(\"/Dialogs/Tasks/SaveWorkflow/TaskName\")%>: <%=in1.processName%>", - "description" : "<%=ivy.cms.co(\"/Dialogs/Tasks/SaveWorkflow/TaskName\")%>: <%=in1.processName%>", - "responsible" : { - "activator" : "CREATOR" - }, - "customFields" : [ - { "name" : "isExpressCreationTask", "type" : "STRING", "value" : "\"true\"" } - ] - } - }, - "visual" : { - "at" : { "x" : 1888, "y" : 168 }, - "labelOffset" : { "x" : 32, "y" : 2 } - }, - "connect" : [ - { "id" : "f49", "to" : "f42", "via" : [ { "x" : 1888, "y" : 72 } ], "condition" : "ivp==\"TaskA.ivp\"" } - ] - }, { - "id" : "f1", - "type" : "Script", - "name" : "Set edit flag", - "config" : { - "output" : { - "code" : "in.editFlag = true;" - } - }, - "visual" : { - "at" : { "x" : 208, "y" : 352 } - }, - "connect" : [ - { "id" : "f33", "to" : "S10" } - ] - }, { - "id" : "f42", - "type" : "Script", - "name" : "Set saved flag", - "config" : { - "output" : { - "code" : "in.savedFlag = true;" - } - }, - "visual" : { - "at" : { "x" : 1536, "y" : 72 } - }, - "connect" : [ - { "id" : "f10", "to" : "f13", "via" : [ { "x" : 504, "y" : 72 } ] } - ] - }, { - "id" : "f50", - "type" : "CallSubStart", - "name" : "newAdhocWorkflow(Long)", - "config" : { - "signature" : "newAdhocWorkflow", - "input" : { - "params" : [ - { "name" : "originalTaskId", "type" : "Long", "desc" : "" } - ], - "map" : { - "out.isAdhocProcess" : "true", - "out.isUseDefaultUI" : "true", - "out.originalTaskId" : "param.originalTaskId", - "out.processType" : "ch.ivy.gawfs.enums.ProcessType.AD_HOC" - } - } - }, - "visual" : { - "at" : { "x" : 80, "y" : 72 }, - "labelOffset" : { "x" : 5, "y" : 46 } - }, - "connect" : [ - { "id" : "f53", "to" : "f52" } - ] - }, { - "id" : "f52", - "type" : "Script", - "name" : "Init Process Name", - "config" : { - "output" : { - "code" : [ - "import java.util.Arrays;", - "import ch.ivyteam.ivy.workflow.ITask;", - "ITask originalTask = ivy.wf.findTask(in.originalTaskId);", - "if(originalTask != null) {", - " in.processName = ivy.cms.co(\"/Dialogs/workflowCreation/AdhocProcessName\", Arrays.asList(String.valueOf(originalTask.getId()), originalTask.names().current()));", - "}" - ] - }, - "sudo" : true - }, - "visual" : { - "at" : { "x" : 208, "y" : 72 } - }, - "connect" : [ - { "id" : "f51", "to" : "f28" } - ] - }, { - "id" : "f54", - "type" : "Script", - "name" : [ - "Hide original task and", - "attach to business case" - ], - "config" : { - "output" : { - "code" : [ - "import ch.ivy.addon.portalkit.util.AdhocUtils;", - "import ch.ivy.addon.portalkit.enums.AdditionalProperty;", - "import ch.ivyteam.ivy.workflow.ICase;", - "import com.axonivy.portal.components.publicapi.TaskAPI;", - "import ch.ivyteam.ivy.workflow.ITask;", - "", - "if(in.isAdhocProcess){", - " ITask originalTask = ivy.wf.findTask(in.originalTaskId);", - " if(originalTask != null){", - " TaskAPI.setHidePropertyToHideInPortal(originalTask);", - " //Mark task as adhoc express", - " originalTask.customFields().stringField(AdditionalProperty.ORIGINAL_ADHOC_EXPRESS_TASK.toString()).set(AdditionalProperty.ORIGINAL_ADHOC_EXPRESS_TASK.toString());", - " originalTask.customFields().stringField(AdditionalProperty.FIRST_TIME_OPEN_ORIGINAL_ADHOC_TASK.toString()).set(AdditionalProperty.FIRST_TIME_OPEN_ORIGINAL_ADHOC_TASK.toString());", - " }", - " ICase businessCase = originalTask.getCase().getBusinessCase();", - " AdhocUtils.attachToBusinessCase(ivy.case, businessCase.getId());", - "}" - ] - }, - "sudo" : true - }, - "visual" : { - "at" : { "x" : 1768, "y" : 360 }, - "size" : { "width" : 160, "height" : 60 } - }, - "connect" : [ - { "id" : "f58", "to" : "f20" } - ] - } ] +{ + "$schema" : "https://json-schema.axonivy.com/process/11.2.2/process.json", + "id" : "15791C23B125821B", + "kind" : "CALLABLE_SUB", + "config" : { + "data" : "gawfs.Data" + }, + "elements" : [ { + "id" : "S10", + "type" : "EmbeddedProcess", + "name" : "loadWorkflow", + "elements" : [ { + "id" : "S10-f26", + "type" : "Script", + "name" : "get Workflow Credentials", + "config" : { + "output" : { + "code" : [ + "import ch.ivy.addon.portalkit.service.ExpressProcessService;", + "import java.util.ArrayList;", + "import org.apache.commons.collections.CollectionUtils;", + "import ch.ivy.gawfs.enums.ProcessType;", + "import ch.ivy.addon.portalkit.bo.ExpressProcess;", + "import ch.ivy.gawfs.ExpressProcessUtils;", + "", + "ExpressProcess workflow = ExpressProcessService.getInstance().findExpressProcessById(in.processID) as ExpressProcess;", + "", + "in.processDescription = workflow.processDescription;", + "in.processName = workflow.processName;", + "in.processFolder = workflow.processFolder;", + "in.processCoOwners = workflow.processCoOwners;", + "in.processIcon = workflow.icon;", + "//Old processes won't have process co owners, so we add process owner as default", + "if(CollectionUtils.isEmpty(in.processCoOwners)) {", + " in.processCoOwners = new ArrayList();", + " in.processCoOwners.add(workflow.processOwner);", + "}", + "", + "in.processCoOwnersDisplayName = ExpressProcessUtils.generateResponsibleDisplayName(in.processCoOwners);", + "in.isUseDefaultUI = workflow.useDefaultUI;", + "", + "for(ProcessType type : ProcessType.values()) {", + " if (type.getValue() == workflow.processType) {", + " in.processType = type;", + " }", + "}", + "", + "in.definedTasks = ExpressProcessUtils.convertExpressTaskDefinitionToTaskDef(workflow.taskDefinitions);" + ] + }, + "sudo" : true + }, + "visual" : { + "at" : { "x" : 208, "y" : 256 }, + "size" : { "width" : 144, "height" : 60 } + }, + "connect" : [ + { "id" : "S10-f1", "to" : "S10-g1" } + ] + }, { + "id" : "S10-g0", + "type" : "EmbeddedStart", + "name" : "in 1", + "visual" : { + "at" : { "x" : 208, "y" : 104 }, + "labelOffset" : { "x" : 18, "y" : 25 } + }, + "parentConnector" : "f33", + "connect" : [ + { "id" : "S10-f0", "to" : "S10-f26" } + ] + }, { + "id" : "S10-g1", + "type" : "EmbeddedEnd", + "name" : "out 1", + "visual" : { + "at" : { "x" : 208, "y" : 416 }, + "labelOffset" : { "x" : 21, "y" : 25 } + }, + "parentConnector" : "f34" + } ], + "visual" : { + "at" : { "x" : 368, "y" : 352 } + }, + "connect" : [ + { "id" : "f34", "to" : "f5" } + ] + }, { + "id" : "f0", + "type" : "CallSubStart", + "name" : "new Workflow", + "config" : { + "signature" : "newWorkflow" + }, + "visual" : { + "at" : { "x" : 80, "y" : 264 } + }, + "connect" : [ + { "id" : "f31", "to" : "f28" } + ] + }, { + "id" : "f5", + "type" : "Script", + "name" : "init steps", + "config" : { + "output" : { + "code" : [ + "if(!in.isAdhocProcess) {", + " in.steps.add(ivy.cms.co(\"/ch.ivy.addon.portalkit.ui.jsf/common/start\"));", + " in.steps.add(ivy.cms.co(\"/Dialogs/workflowCreation/WorkflowDefinition/WorkflowPropertiesStep\"));", + " in.steps.add(ivy.cms.co(\"/Dialogs/workflowCreation/WorkflowDefinition/FormDefinitionStep\"));", + " in.steps.add(ivy.cms.co(\"/Dialogs/workflowCreation/WorkflowDefinition/EndStep\"));", + "}", + "in.discard = false;" + ] + }, + "sudo" : true + }, + "visual" : { + "at" : { "x" : 368, "y" : 264 } + }, + "connect" : [ + { "id" : "f14", "to" : "f13" } + ] + }, { + "id" : "f7", + "type" : "DialogCall", + "name" : "Workflow Settings Dialog", + "config" : { + "dialog" : "ch.ivy.gawfs.workflowCreation.WorkflowDefinition:start(gawfs.Data)", + "call" : { + "map" : { + "param.data" : "in" + } + } + }, + "visual" : { + "at" : { "x" : 640, "y" : 264 }, + "size" : { "width" : 144, "height" : 60 } + }, + "connect" : [ + { "id" : "f26", "to" : "f41" } + ] + }, { + "id" : "f9", + "type" : "Script", + "name" : "Save workflow to Database", + "config" : { + "output" : { + "code" : [ + "import ch.ivy.gawfs.ExpressProcessUtils;", + "", + "//save workflowdescription", + "ExpressProcessUtils.saveProcess(in);" + ] + }, + "sudo" : true + }, + "visual" : { + "at" : { "x" : 1720, "y" : 264 }, + "size" : { "width" : 160, "height" : 60 } + }, + "connect" : [ + { "id" : "f36", "to" : "f35" } + ] + }, { + "id" : "f3", + "type" : "DialogCall", + "name" : "Workflow Formdefinition Dialog", + "config" : { + "dialog" : "ch.ivy.gawfs.workflowCreation.FormDefinition:start(gawfs.Data)", + "call" : { + "map" : { + "param.data" : "in" + } + }, + "output" : { + "map" : { + "out" : "result.data" + } + } + }, + "visual" : { + "at" : { "x" : 1048, "y" : 264 }, + "size" : { "width" : 176, "height" : 60 } + }, + "connect" : [ + { "id" : "f48", "to" : "f45" } + ] + }, { + "id" : "f11", + "type" : "Alternative", + "config" : { + "conditions" : { + "f17" : "in.backFlag==true" + } + }, + "visual" : { + "at" : { "x" : 1272, "y" : 264 } + }, + "connect" : [ + { "id" : "f17", "to" : "f16", "via" : [ { "x" : 1272, "y" : 168 } ] }, + { "id" : "f25", "to" : "f22" } + ] + }, { + "id" : "f13", + "type" : "Alternative", + "visual" : { + "at" : { "x" : 504, "y" : 264 } + }, + "connect" : [ + { "id" : "f8", "to" : "f7" } + ] + }, { + "id" : "f16", + "type" : "Script", + "name" : "Set go back flag", + "config" : { + "output" : { + "map" : { + "out" : "in", + "out.backFlag" : "false", + "out.savedFlag" : "true" + } + } + }, + "visual" : { + "at" : { "x" : 896, "y" : 168 } + }, + "connect" : [ + { "id" : "f15", "to" : "f13", "via" : [ { "x" : 504, "y" : 168 } ] } + ] + }, { + "id" : "f18", + "type" : "Alternative", + "name" : [ + "direct Execution", + "for AHWF" + ], + "config" : { + "conditions" : { + "f55" : "in.processType == ch.ivy.gawfs.enums.ProcessType.AD_HOC" + } + }, + "visual" : { + "at" : { "x" : 1568, "y" : 264 }, + "labelOffset" : { "x" : -25, "y" : -29 } + }, + "connect" : [ + { "id" : "f55", "to" : "f54", "via" : [ { "x" : 1568, "y" : 360 } ], "label" : { + "name" : "yes", + "segment" : 0.31, + "offset" : { "x" : 13, "y" : 0 } + } }, + { "id" : "f24", "to" : "f9" } + ] + }, { + "id" : "f20", + "type" : "SubProcessCall", + "name" : "direct execution of WF if AHWF", + "config" : { + "processCall" : "Functional Processes/executePredefinedWorkflow:call(List,String,String,ch.ivy.gawfs.enums.ProcessType,String,Boolean,Long)", + "call" : { + "map" : { + "param.definedTasks" : "in.definedTasks", + "param.processName" : "in.processName", + "param.processDescription" : "in.processDescription", + "param.processType" : "in.processType", + "param.processID" : "in.processID", + "param.isAdhocProcess" : "in.isAdhocProcess", + "param.originalTaskId" : "in.originalTaskId" + } + } + }, + "visual" : { + "at" : { "x" : 2056, "y" : 360 }, + "size" : { "width" : 176, "height" : 60 } + }, + "connect" : [ + { "id" : "f19", "to" : "f32", "via" : [ { "x" : 2208, "y" : 360 } ] } + ] + }, { + "id" : "f21", + "type" : "CallSubStart", + "name" : "editWorkflow", + "config" : { + "signature" : "editWorkflow", + "input" : { + "params" : [ + { "name" : "workflowID", "type" : "String", "desc" : "" } + ], + "map" : { + "out.processID" : "param.workflowID" + } + } + }, + "visual" : { + "at" : { "x" : 80, "y" : 352 } + }, + "connect" : [ + { "id" : "f39", "to" : "f1" } + ] + }, { + "id" : "f32", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 2208, "y" : 264 } + } + }, { + "id" : "f41", + "type" : "Alternative", + "name" : "Discarded?", + "config" : { + "conditions" : { + "f29" : "!in.discard" + } + }, + "visual" : { + "at" : { "x" : 792, "y" : 264 }, + "labelOffset" : { "x" : 9, "y" : -13 } + }, + "connect" : [ + { "id" : "f29", "to" : "f27" }, + { "id" : "f44", "to" : "f43" } + ] + }, { + "id" : "f43", + "type" : "TaskEnd", + "visual" : { + "at" : { "x" : 792, "y" : 360 } + } + }, { + "id" : "f45", + "type" : "Alternative", + "name" : "exit?", + "config" : { + "conditions" : { + "f47" : "in.discard" + } + }, + "visual" : { + "at" : { "x" : 1208, "y" : 264 } + }, + "connect" : [ + { "id" : "f47", "to" : "f46" }, + { "id" : "f12", "to" : "f11" } + ] + }, { + "id" : "f46", + "type" : "TaskEnd", + "visual" : { + "at" : { "x" : 1208, "y" : 328 } + } + }, { + "id" : "f22", + "type" : "Script", + "name" : "Handle Email attachments", + "config" : { + "output" : { + "code" : [ + "import ch.ivy.gawfs.ExpressProcessUtils;", + "import ch.ivy.gawfs.enums.TaskType;", + "import gawfs.TaskDef;", + "ExpressProcessUtils expressProcesUtils = new ch.ivy.gawfs.ExpressProcessUtils();", + "if(!in.#processFolder is initialized) {", + " in.processFolder = expressProcesUtils.generateProcessFolder();", + "}", + "expressProcesUtils.saveAttachments(in.processFolder, in.definedTasks);" + ] + } + }, + "visual" : { + "at" : { "x" : 1408, "y" : 264 }, + "size" : { "width" : 160, "height" : 60 } + }, + "connect" : [ + { "id" : "f23", "to" : "f18" } + ] + }, { + "id" : "f27", + "type" : "Alternative", + "name" : "Use default template?", + "config" : { + "conditions" : { + "f30" : "in.isUseDefaultUI" + } + }, + "visual" : { + "at" : { "x" : 888, "y" : 264 }, + "labelOffset" : { "x" : 10, "y" : -12 } + }, + "connect" : [ + { "id" : "f30", "to" : "f18", "via" : [ { "x" : 888, "y" : 360 }, { "x" : 1496, "y" : 360 } ], "label" : { + "name" : "yes", + "segment" : 0.35, + "offset" : { "x" : 13, "y" : 0 } + } }, + { "id" : "f4", "to" : "f3", "label" : { + "name" : "no", + "segment" : 0.48, + "offset" : { "x" : 0, "y" : -8 } + } } + ] + }, { + "id" : "f28", + "type" : "Script", + "name" : "Set flags", + "config" : { + "output" : { + "code" : [ + "in.readyToExecute = false;", + "in.editFlag = false;" + ] + } + }, + "visual" : { + "at" : { "x" : 208, "y" : 264 } + }, + "connect" : [ + { "id" : "f6", "to" : "f5" } + ] + }, { + "id" : "f35", + "type" : "Alternative", + "name" : "Is ready to execute?", + "config" : { + "conditions" : { + "f38" : "!in.readyToExecute" + } + }, + "visual" : { + "at" : { "x" : 1888, "y" : 264 }, + "labelOffset" : { "x" : 13, "y" : 38 } + }, + "connect" : [ + { "id" : "f38", "to" : "f37", "label" : { + "name" : "no", + "segment" : 0.45, + "offset" : { "x" : -10, "y" : 0 } + }, "var" : "in1" }, + { "id" : "f40", "to" : "f32", "label" : { + "name" : "yes", + "segment" : 0.41, + "offset" : { "x" : 0, "y" : -10 } + } } + ] + }, { + "id" : "f37", + "type" : "TaskSwitchEvent", + "name" : [ + "Create task to store", + "progress of workflow" + ], + "config" : { + "task" : { + "name" : "<%=ivy.cms.co(\"/Dialogs/Tasks/SaveWorkflow/TaskName\")%>: <%=in1.processName%>", + "description" : "<%=ivy.cms.co(\"/Dialogs/Tasks/SaveWorkflow/TaskName\")%>: <%=in1.processName%>", + "responsible" : { + "activator" : "CREATOR" + }, + "customFields" : [ + { "name" : "isExpressCreationTask", "type" : "STRING", "value" : "\"true\"" } + ] + } + }, + "visual" : { + "at" : { "x" : 1888, "y" : 168 }, + "labelOffset" : { "x" : 32, "y" : 2 } + }, + "connect" : [ + { "id" : "f49", "to" : "f42", "via" : [ { "x" : 1888, "y" : 72 } ], "condition" : "ivp==\"TaskA.ivp\"" } + ] + }, { + "id" : "f1", + "type" : "Script", + "name" : "Set edit flag", + "config" : { + "output" : { + "code" : "in.editFlag = true;" + } + }, + "visual" : { + "at" : { "x" : 208, "y" : 352 } + }, + "connect" : [ + { "id" : "f33", "to" : "S10" } + ] + }, { + "id" : "f42", + "type" : "Script", + "name" : "Set saved flag", + "config" : { + "output" : { + "code" : "in.savedFlag = true;" + } + }, + "visual" : { + "at" : { "x" : 1536, "y" : 72 } + }, + "connect" : [ + { "id" : "f10", "to" : "f13", "via" : [ { "x" : 504, "y" : 72 } ] } + ] + }, { + "id" : "f50", + "type" : "CallSubStart", + "name" : "newAdhocWorkflow(Long)", + "config" : { + "signature" : "newAdhocWorkflow", + "input" : { + "params" : [ + { "name" : "originalTaskId", "type" : "Long", "desc" : "" } + ], + "map" : { + "out.isAdhocProcess" : "true", + "out.isUseDefaultUI" : "true", + "out.originalTaskId" : "param.originalTaskId", + "out.processType" : "ch.ivy.gawfs.enums.ProcessType.AD_HOC" + } + } + }, + "visual" : { + "at" : { "x" : 80, "y" : 72 }, + "labelOffset" : { "x" : 5, "y" : 46 } + }, + "connect" : [ + { "id" : "f53", "to" : "f52" } + ] + }, { + "id" : "f52", + "type" : "Script", + "name" : "Init Process Name", + "config" : { + "output" : { + "code" : [ + "import java.util.Arrays;", + "import ch.ivyteam.ivy.workflow.ITask;", + "ITask originalTask = ivy.wf.findTask(in.originalTaskId);", + "if(originalTask != null) {", + " in.processName = ivy.cms.co(\"/Dialogs/workflowCreation/AdhocProcessName\", Arrays.asList(String.valueOf(originalTask.getId()), originalTask.names().current()));", + "}" + ] + }, + "sudo" : true + }, + "visual" : { + "at" : { "x" : 208, "y" : 72 } + }, + "connect" : [ + { "id" : "f51", "to" : "f28" } + ] + }, { + "id" : "f54", + "type" : "Script", + "name" : [ + "Hide original task and", + "attach to business case" + ], + "config" : { + "output" : { + "code" : [ + "import ch.ivy.addon.portalkit.util.AdhocUtils;", + "import ch.ivy.addon.portalkit.enums.AdditionalProperty;", + "import ch.ivyteam.ivy.workflow.ICase;", + "import com.axonivy.portal.components.publicapi.TaskAPI;", + "import ch.ivyteam.ivy.workflow.ITask;", + "", + "if(in.isAdhocProcess){", + " ITask originalTask = ivy.wf.findTask(in.originalTaskId);", + " if(originalTask != null){", + " TaskAPI.setHidePropertyToHideInPortal(originalTask);", + " //Mark task as adhoc express", + " originalTask.customFields().stringField(AdditionalProperty.ORIGINAL_ADHOC_EXPRESS_TASK.toString()).set(AdditionalProperty.ORIGINAL_ADHOC_EXPRESS_TASK.toString());", + " originalTask.customFields().stringField(AdditionalProperty.FIRST_TIME_OPEN_ORIGINAL_ADHOC_TASK.toString()).set(AdditionalProperty.FIRST_TIME_OPEN_ORIGINAL_ADHOC_TASK.toString());", + " }", + " ICase businessCase = originalTask.getCase().getBusinessCase();", + " AdhocUtils.attachToBusinessCase(ivy.case, businessCase.getId());", + "}" + ] + }, + "sudo" : true + }, + "visual" : { + "at" : { "x" : 1768, "y" : 360 }, + "size" : { "width" : 160, "height" : 60 } + }, + "connect" : [ + { "id" : "f58", "to" : "f20" } + ] + } ] } \ No newline at end of file diff --git a/axonivy-express/src/ch/ivy/gawfs/ExpressProcessUtils.java b/axonivy-express/src/ch/ivy/gawfs/ExpressProcessUtils.java index 645eb69..8b75ec8 100644 --- a/axonivy-express/src/ch/ivy/gawfs/ExpressProcessUtils.java +++ b/axonivy-express/src/ch/ivy/gawfs/ExpressProcessUtils.java @@ -29,6 +29,7 @@ import ch.ivyteam.ivy.process.call.SubProcessRunner; import ch.ivyteam.ivy.process.call.SubProcessSearchFilter; import ch.ivyteam.ivy.process.call.SubProcessSearchFilter.Builder; +import ch.ivyteam.ivy.process.call.SubProcessSearchFilter.SearchScope; import ch.ivyteam.ivy.security.IRole; import ch.ivyteam.ivy.security.ISecurityContext; import ch.ivyteam.ivy.security.ISecurityMember; @@ -444,7 +445,7 @@ public boolean isProcessNameDuplicated(String processName) { public List findDataProviders() { Builder subprocessFilter = SubProcessSearchFilter.create(); SubProcessSearchFilter filter = subprocessFilter.setSignature("portalExpressDataProvider()") - .setSearchInAllProjects(true).toFilter(); + .setSearchScope(SearchScope.APPLICATION).toFilter(); return SubProcessRunner.findSubProcessStarts(filter).stream().map(this::toDataProvider).collect(Collectors.toList()); }