diff --git a/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod b/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod index e866576eb1b9cf8de9b934b9a31e18d97714c04e..943147dd9fc19d6b56a0e9605966972506a0f6fd 100644 --- a/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod +++ b/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod @@ -251,6 +251,11 @@ <kind v="10077" /> <title></title> </entityNode> + <entityNode> + <name>WorkflowDefinition</name> + <kind v="10077" /> + <title></title> + </entityNode> </childNodes> </entityNode> </childNodes> diff --git a/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod b/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod index 30447fcdaaed381f42f4fb23397cb01fd934c0ca..48b6f9ad0dd7ec8820511c29d86376929c41c90b 100644 --- a/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod +++ b/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod @@ -45,6 +45,16 @@ <entityName>WorkflowInstance_entity</entityName> <fieldName>InstancesOfWorkflow</fieldName> </dependency> + <children> + <entityParameter> + <name>WorkflowDefinitionId_param</name> + <valueProcess>%aditoprj%/entity/WorkflowDefinition_entity/entityfields/instances/children/workflowdefinitionid_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>WorkflowDefinitionKey_param</name> + <valueProcess>%aditoprj%/entity/WorkflowDefinition_entity/entityfields/instances/children/workflowdefinitionkey_param/valueProcess.js</valueProcess> + </entityParameter> + </children> </entityConsumer> <entityField> <name>KEY</name> @@ -61,6 +71,7 @@ <entityActionField> <name>startNewInstance</name> <title>Start workflow</title> + <onActionProcess>%aditoprj%/entity/WorkflowDefinition_entity/entityfields/startnewinstance/onActionProcess.js</onActionProcess> <iconId>VAADIN:PLAY</iconId> </entityActionField> <entityField> @@ -68,11 +79,23 @@ <contentType>IMAGE</contentType> <valueProcess>%aditoprj%/entity/WorkflowDefinition_entity/entityfields/diagram/valueProcess.js</valueProcess> </entityField> + <entityActionField> + <name>openAdminView</name> + <title>Open admin view</title> + <onActionProcess>%aditoprj%/entity/WorkflowDefinition_entity/entityfields/openadminview/onActionProcess.js</onActionProcess> + <iconId>VAADIN:CURLY_BRACKETS</iconId> + <stateProcess>%aditoprj%/entity/WorkflowDefinition_entity/entityfields/openadminview/stateProcess.js</stateProcess> + </entityActionField> + <entityParameter> + <name>ProcessDefinitionKey_param</name> + <expose v="true" /> + </entityParameter> </entityFields> <recordContainers> <jDitoRecordContainer> <name>jdito</name> <isFilterable v="true" /> + <isSortable v="true" /> <contentProcess>%aditoprj%/entity/WorkflowDefinition_entity/recordcontainers/jdito/contentProcess.js</contentProcess> <onInsert>%aditoprj%/entity/WorkflowDefinition_entity/recordcontainers/jdito/onInsert.js</onInsert> <onUpdate>%aditoprj%/entity/WorkflowDefinition_entity/recordcontainers/jdito/onUpdate.js</onUpdate> diff --git a/entity/WorkflowDefinition_entity/entityfields/instances/children/workflowdefinitionid_param/valueProcess.js b/entity/WorkflowDefinition_entity/entityfields/instances/children/workflowdefinitionid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..533f8ec837ea2f9b588ddf05545ac47cdda23d18 --- /dev/null +++ b/entity/WorkflowDefinition_entity/entityfields/instances/children/workflowdefinitionid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$sys.uid")); \ No newline at end of file diff --git a/entity/WorkflowDefinition_entity/entityfields/instances/children/workflowdefinitionkey_param/valueProcess.js b/entity/WorkflowDefinition_entity/entityfields/instances/children/workflowdefinitionkey_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..3c5c973d2b247ecef9c21e39584f539bf986176d --- /dev/null +++ b/entity/WorkflowDefinition_entity/entityfields/instances/children/workflowdefinitionkey_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.KEY")); \ No newline at end of file diff --git a/entity/WorkflowDefinition_entity/entityfields/openadminview/onActionProcess.js b/entity/WorkflowDefinition_entity/entityfields/openadminview/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..bcfb929d820ce3ea8da91210ca802bd4c61dde43 --- /dev/null +++ b/entity/WorkflowDefinition_entity/entityfields/openadminview/onActionProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("Context_lib"); + +AdminViewUtils.open(); \ No newline at end of file diff --git a/entity/WorkflowDefinition_entity/entityfields/openadminview/stateProcess.js b/entity/WorkflowDefinition_entity/entityfields/openadminview/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..38f2298db7304b4d44a15fbad7f720558c02da99 --- /dev/null +++ b/entity/WorkflowDefinition_entity/entityfields/openadminview/stateProcess.js @@ -0,0 +1,4 @@ +import("Context_lib"); +import("system.result"); + +result.string(AdminViewUtils.getActionState()); \ No newline at end of file diff --git a/entity/WorkflowDefinition_entity/entityfields/startnewinstance/onActionProcess.js b/entity/WorkflowDefinition_entity/entityfields/startnewinstance/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..7de57f37c249aa77685aa376304e030d390f5a1b --- /dev/null +++ b/entity/WorkflowDefinition_entity/entityfields/startnewinstance/onActionProcess.js @@ -0,0 +1,12 @@ +import("system.logging"); +import("system.vars"); +import("system.workflow"); + +//workflow.startProcessByKey("smol", {}); + +var conf = workflow.createConfigForLoadingTasks(); +var tasks = workflow.getTasks(conf); +logging.log(JSON.stringify(JSON.parse(tasks), null, "\t")) + +//workflow.completeTask("2521", {}) +logging.log(JSON.stringify(JSON.parse(workflow.getFinishedActivities("2522")), null, "\t")) \ No newline at end of file diff --git a/entity/WorkflowDefinition_entity/recordcontainers/jdito/contentProcess.js b/entity/WorkflowDefinition_entity/recordcontainers/jdito/contentProcess.js index 48ccb38fca84f71db04118f7f8bf7ead7800897c..cb93e463b92dade5c5c183d76b196a8a88355728 100644 --- a/entity/WorkflowDefinition_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/WorkflowDefinition_entity/recordcontainers/jdito/contentProcess.js @@ -1,24 +1,29 @@ +import("system.logging"); import("system.vars"); import("system.result"); import("Workflow_lib"); import("system.workflow"); import("JditoFilter_lib"); -var workflowDefObj = WorkflowDefinitionUtils.getDeployedDefinitions(); -var workflowDefs = []; -for (let i = 0, l = workflowDefObj.length; i < l; i++) +var workflowKey = vars.exists("$param.ProcessDefinitionKey_param") ? vars.get("$param.ProcessDefinitionKey_param") : null; +var workflowDefs; +if (vars.exists("$local.idvalues") && vars.get("$local.idvalues")) + workflowDefs = [WorkflowDefinitionUtils.getProcessDefinitionById(vars.get("$local.idvalues")[0])]; +else + workflowDefs = WorkflowDefinitionUtils.getDeployedDefinitions(workflowKey); + +workflowDefs = workflowDefs.map(function (currentDef) { - let currentDef = workflowDefObj[i]; - workflowDefs.push([ + return [ currentDef.id, currentDef.name, currentDef.category, currentDef.key, currentDef.version, currentDef.active - ]); -} - -workflowDefs = JditoFilterUtils.filterRecords(["UID", "NAME", "CATEGORY", "KEY", "VERSION", "ACTIVE"], workflowDefs, vars.get("$local.filter").filter); + ]; +}); +workflowDefs = JditoFilterUtils.filterRecords(["UID", "NAME", "CATEGORY", "KEY", "VERSION", "ISACTIVE"], workflowDefs, vars.get("$local.filter").filter); +logging.log(JSON.stringify(workflowDefs, null, "\t")) result.object(workflowDefs); \ No newline at end of file diff --git a/entity/WorkflowInstance_entity/WorkflowInstance_entity.aod b/entity/WorkflowInstance_entity/WorkflowInstance_entity.aod index 3015fe118607630cddd274a4011c7a0b9824f5e3..5ed7c133f4feb6eb2d81ef4f6b53165bd5184ebf 100644 --- a/entity/WorkflowInstance_entity/WorkflowInstance_entity.aod +++ b/entity/WorkflowInstance_entity/WorkflowInstance_entity.aod @@ -27,15 +27,71 @@ <name>WorkflowDefinitionId_param</name> <expose v="true" /> </entityParameter> + <entityField> + <name>KEY</name> + <title>Key</title> + </entityField> + <entityField> + <name>ISACTIVE</name> + <title>Active</title> + <contentType>BOOLEAN</contentType> + <dropDownProcess>%aditoprj%/entity/WorkflowInstance_entity/entityfields/isactive/dropDownProcess.js</dropDownProcess> + </entityField> + <entityField> + <name>PROCESSDEFINITION_ID</name> + </entityField> + <entityField> + <name>PROCESSDEFINITIONNAME</name> + </entityField> + <entityField> + <name>START_TIME</name> + <title>Start date</title> + <contentType>DATE</contentType> + </entityField> + <entityParameter> + <name>WorkflowDefinitionKey_param</name> + <expose v="true" /> + <mandatory v="true" /> + </entityParameter> + <entityParameter> + <name>Category_param</name> + <expose v="true" /> + </entityParameter> + <entityParameter> + <name>Active_param</name> + <expose v="true" /> + </entityParameter> </entityFields> <recordContainers> <jDitoRecordContainer> <name>jdito</name> + <isFilterable v="true" /> + <isSortable v="true" /> <contentProcess>%aditoprj%/entity/WorkflowInstance_entity/recordcontainers/jdito/contentProcess.js</contentProcess> + <onInsert>%aditoprj%/entity/WorkflowInstance_entity/recordcontainers/jdito/onInsert.js</onInsert> + <onDelete>%aditoprj%/entity/WorkflowInstance_entity/recordcontainers/jdito/onDelete.js</onDelete> <recordFieldMappings> <jDitoRecordFieldMapping> <name>UID.value</name> </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>KEY.value</name> + </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>ISACTIVE.value</name> + <isFilterable v="true" /> + </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>PROCESSDEFINITIONNAME.value</name> + <isFilterable v="true" /> + </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>PROCESSDEFINITION_ID.value</name> + </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>START_TIME.value</name> + <isFilterable v="true" /> + </jDitoRecordFieldMapping> </recordFieldMappings> </jDitoRecordContainer> </recordContainers> diff --git a/entity/WorkflowInstance_entity/entityfields/isactive/dropDownProcess.js b/entity/WorkflowInstance_entity/entityfields/isactive/dropDownProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..a5eec56c41ae0c48e898c88e9a5f81ab17c043af --- /dev/null +++ b/entity/WorkflowInstance_entity/entityfields/isactive/dropDownProcess.js @@ -0,0 +1,7 @@ +import("system.translate"); +import("system.result"); + +result.object([ + ["true", translate.text("Yes")], + ["false", translate.text("No")] +]); \ No newline at end of file diff --git a/entity/WorkflowInstance_entity/recordcontainers/jdito/contentProcess.js b/entity/WorkflowInstance_entity/recordcontainers/jdito/contentProcess.js index 221a1a8737b426e17a726256f27c5ac1cfa79af5..269cc7862244940ec727fc45c1b4e90c6c89c332 100644 --- a/entity/WorkflowInstance_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/WorkflowInstance_entity/recordcontainers/jdito/contentProcess.js @@ -1,7 +1,29 @@ +import("Util_lib"); +import("JditoFilter_lib"); +import("system.datetime"); +import("system.result"); +import("system.logging"); +import("Workflow_lib"); import("system.vars"); import("system.workflow"); var workflowDefId = vars.get("$param.WorkflowDefinitionId_param"); -var loadConfig = workflow.createConfigForLoadingProcessInstances() - .processDefinitionId(workflowDefId); -var wfInstances = workflow.getProcessInstances(loadConfig); \ No newline at end of file +logging.log(workflowDefId) +var wfInstances = WorkflowInstanceUtils.getInstances(workflowDefId, vars.get("$param.WorkflowDefinitionKey_param")); +logging.log(JSON.stringify(wfInstances, null, "\t")) + +wfInstances = wfInstances.map(function (currentInstance) +{ + return [ + currentInstance.id, + currentInstance.key, + currentInstance.active, + currentInstance.processDefinitionName, + currentInstance.processDefinitionId, + Date.parse(currentInstance.startTime).toString() + ]; +}); + +wfInstances = JditoFilterUtils.filterRecords(["UID", "KEY", "ISACTIVE", "PROCESSDEFINITIONNAME", "PROCESSDEFINITION_ID", "START_TIME"], wfInstances, vars.get("$local.filter").filter); + +result.object(wfInstances); \ No newline at end of file diff --git a/entity/WorkflowInstance_entity/recordcontainers/jdito/onDelete.js b/entity/WorkflowInstance_entity/recordcontainers/jdito/onDelete.js new file mode 100644 index 0000000000000000000000000000000000000000..fb81c76728235ca5c992e0bdf204fdb9472a6da0 --- /dev/null +++ b/entity/WorkflowInstance_entity/recordcontainers/jdito/onDelete.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.workflow"); + +workflow.deleteProcessInstance(vars.get("$local.uid"), ""); \ No newline at end of file diff --git a/entity/WorkflowInstance_entity/recordcontainers/jdito/onInsert.js b/entity/WorkflowInstance_entity/recordcontainers/jdito/onInsert.js new file mode 100644 index 0000000000000000000000000000000000000000..a063c50e19ddd57c2df8f5d797b49ef08a396303 --- /dev/null +++ b/entity/WorkflowInstance_entity/recordcontainers/jdito/onInsert.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.workflow"); + +workflow.startProcessByKey(vars.get("$param.WorkflowDefinitionKey_param"), {}); \ No newline at end of file diff --git a/entity/WorkflowTask_entity/WorkflowTask_entity.aod b/entity/WorkflowTask_entity/WorkflowTask_entity.aod index 1ac9b2b119e68a8126e592ebbd2beb389e4e0218..540c768a3975a8f1e8b987dc469d64d888e08b2d 100644 --- a/entity/WorkflowTask_entity/WorkflowTask_entity.aod +++ b/entity/WorkflowTask_entity/WorkflowTask_entity.aod @@ -20,10 +20,14 @@ <recordContainers> <jDitoRecordContainer> <name>jdito</name> + <contentProcess>%aditoprj%/entity/WorkflowTask_entity/recordcontainers/jdito/contentProcess.js</contentProcess> <recordFieldMappings> <jDitoRecordFieldMapping> <name>UID.value</name> </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>FORMDEFINITION.value</name> + </jDitoRecordFieldMapping> </recordFieldMappings> </jDitoRecordContainer> </recordContainers> diff --git a/entity/WorkflowTask_entity/recordcontainers/jdito/contentProcess.js b/entity/WorkflowTask_entity/recordcontainers/jdito/contentProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/entity/WorkflowTask_entity/recordcontainers/jdito/contentProcess.js @@ -0,0 +1 @@ + diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index 53262ff3a3c28cdc28dbf9533ba8584cc31ff065..3109be56c867e8bad838df776f09c9f58a8a7e0a 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -5220,6 +5220,18 @@ <entry> <key>Responsible AD supervisor</key> </entry> + <entry> + <key>Show my contacts</key> + </entry> + <entry> + <key>My contacts</key> + </entry> + <entry> + <key>Show my organisations</key> + </entry> + <entry> + <key>My organisations</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> <sqlModels> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index 9d4d1442fe6737f13ca5d45634029032e05414be..4b1cdd040a177e5be5b0a81773e12a262abb5351 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -5270,6 +5270,18 @@ <entry> <key>Responsible AD supervisor</key> </entry> + <entry> + <key>Show my contacts</key> + </entry> + <entry> + <key>My contacts</key> + </entry> + <entry> + <key>Show my organisations</key> + </entry> + <entry> + <key>My organisations</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/neonContext/WorkflowDefinition/WorkflowDefinition.aod b/neonContext/WorkflowDefinition/WorkflowDefinition.aod index 7270f1a656fa02dbaed6c55ae8c7c7932768a367..253fede0cd5bd7258bec088c6cf6fb3067eec177 100644 --- a/neonContext/WorkflowDefinition/WorkflowDefinition.aod +++ b/neonContext/WorkflowDefinition/WorkflowDefinition.aod @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0"> +<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.1"> <name>WorkflowDefinition</name> <title>Workflow definition</title> <majorModelMode>DISTRIBUTED</majorModelMode> - <mainview>WorkflowDefinitionMain_view</mainview> - <filterview>WorkflowDefinitionFilter_view</filterview> - <editview>WorkflowDefinitionEdit_view</editview> - <preview>WorkflowDefinitionPreview_view</preview> + <mainView>WorkflowDefinitionMain_view</mainView> + <filterView>WorkflowDefinitionFilter_view</filterView> + <editView>WorkflowDefinitionEdit_view</editView> + <previewView>WorkflowDefinitionPreview_view</previewView> <entity>WorkflowDefinition_entity</entity> <references> <neonViewReference> diff --git a/neonContext/WorkflowInstance/WorkflowInstance.aod b/neonContext/WorkflowInstance/WorkflowInstance.aod index 166a101fd709d93aa0d18751d5fbad28ee405ab2..a28a5ceb41aefce0bc5e5c794833e458668c0356 100644 --- a/neonContext/WorkflowInstance/WorkflowInstance.aod +++ b/neonContext/WorkflowInstance/WorkflowInstance.aod @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0"> +<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.1"> <name>WorkflowInstance</name> <majorModelMode>DISTRIBUTED</majorModelMode> - <filterview>WorkflowInstanceFilter_view</filterview> + <filterView>WorkflowInstanceFilter_view</filterView> + <editView>WorkflowInstanceEdit_view</editView> <entity>WorkflowInstance_entity</entity> <references> <neonViewReference> @@ -13,5 +14,9 @@ <name>f80251a2-25e3-41f3-a933-6663e733ed7a</name> <view>WorkflowInstancePreview_view</view> </neonViewReference> + <neonViewReference> + <name>9ea113a4-98ec-4634-a8f2-a0dafce3fc22</name> + <view>WorkflowInstanceEdit_view</view> + </neonViewReference> </references> </neonContext> diff --git a/neonContext/WorkflowTask/WorkflowTask.aod b/neonContext/WorkflowTask/WorkflowTask.aod index 7209d8da198b6ed1ad09cfead96dfdac3ebc8224..0c25baea3b97f9bb8e373e172f7d016be2dfce09 100644 --- a/neonContext/WorkflowTask/WorkflowTask.aod +++ b/neonContext/WorkflowTask/WorkflowTask.aod @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0"> +<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.1"> <name>WorkflowTask</name> <majorModelMode>DISTRIBUTED</majorModelMode> <entity>WorkflowTask_entity</entity> diff --git a/neonView/WorkflowInstanceEdit_view/WorkflowInstanceEdit_view.aod b/neonView/WorkflowInstanceEdit_view/WorkflowInstanceEdit_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..ed0ddef3293325d5972e22c7370f37e6bcaaf699 --- /dev/null +++ b/neonView/WorkflowInstanceEdit_view/WorkflowInstanceEdit_view.aod @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.2" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.2"> + <name>WorkflowInstanceEdit_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <isSmall v="true" /> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <genericViewTemplate> + <name>Generic</name> + <editMode v="true" /> + <entityField>#ENTITY</entityField> + </genericViewTemplate> + </children> +</neonView> diff --git a/neonView/WorkflowInstanceFilter_view/WorkflowInstanceFilter_view.aod b/neonView/WorkflowInstanceFilter_view/WorkflowInstanceFilter_view.aod index c3724e16f2121c7bf78d3de5a60bde85de01120e..f799d6fccce58c0a220412949a0cded696f92176 100644 --- a/neonView/WorkflowInstanceFilter_view/WorkflowInstanceFilter_view.aod +++ b/neonView/WorkflowInstanceFilter_view/WorkflowInstanceFilter_view.aod @@ -2,6 +2,7 @@ <neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.2" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.2"> <name>WorkflowInstanceFilter_view</name> <majorModelMode>DISTRIBUTED</majorModelMode> + <filterable v="true" /> <layout> <boxLayout> <name>layout</name> @@ -14,7 +15,15 @@ <columns> <neonTableColumn> <name>c5d2c47a-5b20-49c9-b49c-5aee951ce2db</name> - <entityField>UID</entityField> + <entityField>PROCESSDEFINITIONNAME</entityField> + </neonTableColumn> + <neonTableColumn> + <name>d8f5093e-d547-4276-ae46-536182bffbc0</name> + <entityField>START_TIME</entityField> + </neonTableColumn> + <neonTableColumn> + <name>52c7a94a-0d01-457e-94c4-79353b571217</name> + <entityField>ISACTIVE</entityField> </neonTableColumn> </columns> </tableViewTemplate> diff --git a/process/JditoFilter_lib/process.js b/process/JditoFilter_lib/process.js index 6e5a19ab4ae6120be01852d8a2bf5e7206552f78..a9b76af653e7f3aabe20db946b72339d721575cc 100644 --- a/process/JditoFilter_lib/process.js +++ b/process/JditoFilter_lib/process.js @@ -291,4 +291,4 @@ JditoFilterUtils.getSqlCondition = function (pFilter, pTable, pTableAlias, pColu } return JditoFilterUtils; //return only functions that should be public -})(); \ No newline at end of file +})(); diff --git a/process/Workflow_lib/process.js b/process/Workflow_lib/process.js index 4fa7dc51ec69400b76a66e3514e3b4c740ea13a0..aa9d72d48cf5f86eb6ef14a4aeb0f6a5be06fb04 100644 --- a/process/Workflow_lib/process.js +++ b/process/Workflow_lib/process.js @@ -1,34 +1,87 @@ -import("system.logging"); import("system.workflow"); - +/** + * + */ function WorkflowDefinitionUtils () {} -WorkflowDefinitionUtils.getDeployedDefinitions = function (pCategory, pActive) +/** + * + */ +WorkflowDefinitionUtils.getDeployedDefinitions = function (pProcessDefinitionKey, pCategory, pActive) { - if (pActive === undefined) - pActive = true; - var loadConfig = workflow.createConfigForLoadingProcessDefinitions() - .active(pActive); + var loadConfig = workflow.createConfigForLoadingProcessDefinitions(); + if (pProcessDefinitionKey) + loadConfig.processDefinitionKey(pProcessDefinitionKey); + if (pActive) + loadConfig.active(pActive); if (pCategory) loadConfig.category(pCategory); var workflowDefs = workflow.getProcessDefinitions(loadConfig); workflowDefs = JSON.parse(workflowDefs); -// logging.log(JSON.stringify(workflowDefs, null, "\t")) -// workflow.startProcessByKey("offerVerification", []) - return workflowDefs; } +/** + * + */ +WorkflowDefinitionUtils.getProcessDefinitionById = function (pId) +{ + var loadConfig = workflow.createConfigForLoadingProcessDefinition() + .processDefinitionId(pId); + var workflowDef = workflow.getProcessDefinition(loadConfig); + + return JSON.parse(workflowDef); +} + +/** + * + */ function WorkflowInstanceUtils () {} -WorkflowInstanceUtils.getInstancesForDefinition = function (pDefinitionId) + +WorkflowInstanceUtils.getInstances = function (pProcessDefinitionId, pProcessDefinitionKey, pCategory, pActive) { - var loadConfig = workflow.createConfigForLoadingProcessInstances() - .processDefinitionId(pDefinitionId); - var instances = workflow.getProcessInstances(loadConfig); - instances = JSON.parse(instances); + if (!(pProcessDefinitionId || pProcessDefinitionKey || pCategory || pActive)) + return []; + + var loadConfig = workflow.createConfigForLoadingProcessInstances(); - return instances; + if (pProcessDefinitionId) + loadConfig.processDefinitionId(pProcessDefinitionId); + if (pProcessDefinitionKey) + loadConfig.processDefinitionKey(pProcessDefinitionKey); + if (pCategory) + loadConfig.category(pCategory); + if (pActive) + loadConfig.active(pActive); + + return JSON.parse(workflow.getProcessInstances(loadConfig)); +} + +/** + * + */ +function WorkflowTaskUtils () {} + +/** + * + */ +WorkflowTaskUtils.getTasks = function () +{ + var loadConfig = workflow.createConfigForLoadingTasks() + + var workflowTasks = workflow.getTasks(loadConfig); + + return JSON.parse(workflowTasks); +} + +/** + * generates a JSON for the dynamic form component depending + * on a tasks form properties + */ +WorkflowTaskUtils.getFormJSON = function (pTaskId) +{ + var formProperties = workflow.getFormProperties(pTaskId); } \ No newline at end of file