diff --git a/entity/WorkflowTask_entity/entityfields/target_id/displayValueProcess.js b/entity/WorkflowTask_entity/entityfields/target_id/displayValueProcess.js index 686f1278c37685496b03dd1863e9dd014a24da66..94eee8c9a24f6f5bf5ff617fa7dfc61270777b7e 100644 --- a/entity/WorkflowTask_entity/entityfields/target_id/displayValueProcess.js +++ b/entity/WorkflowTask_entity/entityfields/target_id/displayValueProcess.js @@ -1,8 +1,8 @@ -import("system.result"); -import("Context_lib"); -import("system.vars"); -import("system.project"); +//import("system.result"); +//import("Context_lib"); +//import("system.vars"); +//import("system.project"); -var context = project.getContextStructure(vars.get("$field.TARGET_CONTEXT")); - -result.string(ContextUtils.loadContentTitle(context.entity, vars.get("$field.TARGET_ID"))); +//var context = project.getContextStructure(vars.get("$field.TARGET_CONTEXT")); +// +//result.string(ContextUtils.loadContentTitle(context.entity, vars.get("$field.TARGET_ID"))); diff --git a/entity/WorkflowTask_entity/recordcontainers/jdito/onUpdate.js b/entity/WorkflowTask_entity/recordcontainers/jdito/onUpdate.js index 683bbc2172dc2fe1156c1efc9c58e4096066b3a7..2e2168e27873f2a351a78db73bd56447744e3c1b 100644 --- a/entity/WorkflowTask_entity/recordcontainers/jdito/onUpdate.js +++ b/entity/WorkflowTask_entity/recordcontainers/jdito/onUpdate.js @@ -1,3 +1,4 @@ +import("system.neon"); import("system.workflow"); import("system.vars"); @@ -14,5 +15,33 @@ vars.get("$local.changed").forEach(function (field) break; case "FORMRESULT.value": workflow.completeTaskWithFormData(taskId, JSON.parse(value)); + _openNextTaskIfExists(rowData["PROCESSINSTANCE_ID.value"], rowData["CREATE_TIME.value"]); } -}); \ No newline at end of file +}); + +/* + * checks if a new task has been created for that process instance, + * if that's the case the new task will be opened + */ +function _openNextTaskIfExists (pProcessInstanceId, pCreateTime) +{ + var loadConfig = workflow.createConfigForLoadingTasks() + .processInstanceId(pProcessInstanceId); + + var startVal = { + id : null, + createTime : new Date(+pCreateTime).toString() + }; + var newestTask = JSON.parse(workflow.getTasks(loadConfig)).reduce(function (prev, curr) + { + var prevTime = Date.parse(prev.createTime); + var currTime = Date.parse(curr.createTime); + + return prevTime > currTime ? prev : curr; + }, startVal); + + if (newestTask.id !== null) + { + neon.openContext("WorkflowTask", "WorkflowTaskPreview_view", [newestTask.id], neon.OPERATINGSTATE_VIEW, null); + } +} \ No newline at end of file diff --git a/neonView/OfferPreview_view/OfferPreview_view.aod b/neonView/OfferPreview_view/OfferPreview_view.aod index 59bb4d5c7d3df9b7da6e8b069217ec86d7ff84ff..98ba7a7fb50c05f7ad9f2a40a9f100332eceaa7c 100644 --- a/neonView/OfferPreview_view/OfferPreview_view.aod +++ b/neonView/OfferPreview_view/OfferPreview_view.aod @@ -77,8 +77,8 @@ <entityField>PROBABILITY</entityField> </entityFieldLink> <entityFieldLink> - <name>3317b73e-68e8-41a8-a678-89c7c7c8513e</name> - <entityField>SALESPROJECT_ID</entityField> + <name>c603a596-a305-4408-8918-90e6e2a49ca1</name> + <entityField>OBJECT_ROWID</entityField> </entityFieldLink> <entityFieldLink> <name>59daee43-0e79-49d8-a36a-5ce4c491def9</name> diff --git a/neonView/WorkflowTaskPreview_view/WorkflowTaskPreview_view.aod b/neonView/WorkflowTaskPreview_view/WorkflowTaskPreview_view.aod index cb542e7627577ebb2896f2ff4fc3076f72d9d7ee..7e63a32901b5a7606d1cebd226bb083c32d28339 100644 --- a/neonView/WorkflowTaskPreview_view/WorkflowTaskPreview_view.aod +++ b/neonView/WorkflowTaskPreview_view/WorkflowTaskPreview_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.3" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.3"> <name>WorkflowTaskPreview_view</name> <majorModelMode>DISTRIBUTED</majorModelMode> + <isSmall v="true" /> <layout> <headerFooterLayout> <name>layout</name>