From 19083aae3edb7829de7d28418d1302a10380d346 Mon Sep 17 00:00:00 2001 From: "nam.mai" Date: Wed, 15 Nov 2023 11:59:38 +0700 Subject: [PATCH] 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 @@ -