Skip to content

Commit

Permalink
IVYPORTAL-14577: Make express an independent marketplace item
Browse files Browse the repository at this point in the history
- Fixed bug: Data provider not loaded
- Fixed bug: Date pattern in UserTaskWithMailForm.xhtml not correct
- Fixed bug: Adapt callable processes to new approach
  • Loading branch information
mnhnam-axonivy committed Nov 15, 2023
1 parent f4dd9a2 commit 19083aa
Show file tree
Hide file tree
Showing 13 changed files with 287 additions and 220 deletions.
10 changes: 3 additions & 7 deletions axonivy-express/config/overrides.any
Original file line number Diff line number Diff line change
@@ -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 *
}
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
GetDocumentItemsOverrideData #class
gawfs #namespace
businessCase ch.ivyteam.ivy.workflow.ICase #field
message String #field
documents java.util.List<com.axonivy.portal.components.ivydata.bo.IvyDocument> #field
CustomGetDocumentItemsData #class
gawfs #namespace
businessCase ch.ivyteam.ivy.workflow.ICase #field
message String #field
documents java.util.List<com.axonivy.portal.components.ivydata.bo.IvyDocument> #field
status com.axonivy.portal.components.enums.CustomProcessStatus #field
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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" }
]
} ]
}
Original file line number Diff line number Diff line change
@@ -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<com.axonivy.portal.components.ivydata.bo.IvyDocument>", "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<ch.ivy.addon.portal.components.ivydata.bo.IvyDocument>",
"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<com.axonivy.portal.components.ivydata.bo.IvyDocument>", "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<ch.ivy.addon.portal.components.ivydata.bo.IvyDocument>",
"Some mandatory fields when mapping:",
"- id",
"- name",
"- contentType"
],
"visual" : {
"at" : { "x" : 408, "y" : 216 },
"size" : { "width" : 624, "height" : 108 }
},
"connect" : [
{ "id" : "f6", "to" : "f0" }
]
} ]
}
Loading

0 comments on commit 19083aa

Please sign in to comment.