From 5dae6aec3bc6f3c37eeef07a57cb14bfd879731d Mon Sep 17 00:00:00 2001
From: "S.Listl" <S.Listl@SLISTL.aditosoftware.local>
Date: Mon, 28 Oct 2019 16:45:14 +0100
Subject: [PATCH] Workflow

---
 .../_____SYSTEM_APPLICATION_NEON.aod          |  5 ++
 .../WorkflowDefinition_entity.aod             | 23 +++++
 .../valueProcess.js                           |  4 +
 .../valueProcess.js                           |  4 +
 .../openadminview/onActionProcess.js          |  4 +
 .../openadminview/stateProcess.js             |  4 +
 .../startnewinstance/onActionProcess.js       | 12 +++
 .../recordcontainers/jdito/contentProcess.js  | 23 +++--
 .../WorkflowInstance_entity.aod               | 56 ++++++++++++
 .../entityfields/isactive/dropDownProcess.js  |  7 ++
 .../recordcontainers/jdito/contentProcess.js  | 28 +++++-
 .../recordcontainers/jdito/onDelete.js        |  4 +
 .../recordcontainers/jdito/onInsert.js        |  4 +
 .../WorkflowTask_entity.aod                   |  4 +
 .../recordcontainers/jdito/contentProcess.js  |  1 +
 .../_____LANGUAGE_EXTRA.aod                   | 12 +++
 .../_____LANGUAGE_en/_____LANGUAGE_en.aod     | 12 +++
 .../WorkflowDefinition/WorkflowDefinition.aod | 10 +--
 .../WorkflowInstance/WorkflowInstance.aod     |  9 +-
 neonContext/WorkflowTask/WorkflowTask.aod     |  2 +-
 .../WorkflowInstanceEdit_view.aod             | 18 ++++
 .../WorkflowInstanceFilter_view.aod           | 11 ++-
 process/JditoFilter_lib/process.js            |  2 +-
 process/Workflow_lib/process.js               | 85 +++++++++++++++----
 24 files changed, 306 insertions(+), 38 deletions(-)
 create mode 100644 entity/WorkflowDefinition_entity/entityfields/instances/children/workflowdefinitionid_param/valueProcess.js
 create mode 100644 entity/WorkflowDefinition_entity/entityfields/instances/children/workflowdefinitionkey_param/valueProcess.js
 create mode 100644 entity/WorkflowDefinition_entity/entityfields/openadminview/onActionProcess.js
 create mode 100644 entity/WorkflowDefinition_entity/entityfields/openadminview/stateProcess.js
 create mode 100644 entity/WorkflowDefinition_entity/entityfields/startnewinstance/onActionProcess.js
 create mode 100644 entity/WorkflowInstance_entity/entityfields/isactive/dropDownProcess.js
 create mode 100644 entity/WorkflowInstance_entity/recordcontainers/jdito/onDelete.js
 create mode 100644 entity/WorkflowInstance_entity/recordcontainers/jdito/onInsert.js
 create mode 100644 entity/WorkflowTask_entity/recordcontainers/jdito/contentProcess.js
 create mode 100644 neonView/WorkflowInstanceEdit_view/WorkflowInstanceEdit_view.aod

diff --git a/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod b/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod
index e866576eb1..943147dd9f 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 30447fcdaa..48b6f9ad0d 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 0000000000..533f8ec837
--- /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 0000000000..3c5c973d2b
--- /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 0000000000..bcfb929d82
--- /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 0000000000..38f2298db7
--- /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 0000000000..7de57f37c2
--- /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 48ccb38fca..cb93e463b9 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 3015fe1186..5ed7c133f4 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 0000000000..a5eec56c41
--- /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 221a1a8737..269cc78622 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 0000000000..fb81c76728
--- /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 0000000000..a063c50e19
--- /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 1ac9b2b119..540c768a39 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 0000000000..8b13789179
--- /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 53262ff3a3..3109be56c8 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 9d4d1442fe..4b1cdd040a 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 7270f1a656..253fede0cd 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 166a101fd7..a28a5ceb41 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 7209d8da19..0c25baea3b 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 0000000000..ed0ddef329
--- /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 c3724e16f2..f799d6fccc 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 6e5a19ab4a..a9b76af653 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 4fa7dc51ec..aa9d72d48c 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
-- 
GitLab