From d62ac61937c264552e11c8f1a2b2e5d5b20bc2f7 Mon Sep 17 00:00:00 2001 From: Trung Mai Date: Thu, 23 May 2024 11:17:20 +0700 Subject: [PATCH] TE-585: Fix UI for Demo and get parrent name --- .../component/AnalyzerDetail/AnalyzerDetail.xhtml | 11 +++++------ .../utils/process/analyzer/internal/WorkflowPath.java | 9 ++++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/process-analyzer-demo/src_hd/com/axonivy/utils/process/analyzer/demo/component/AnalyzerDetail/AnalyzerDetail.xhtml b/process-analyzer-demo/src_hd/com/axonivy/utils/process/analyzer/demo/component/AnalyzerDetail/AnalyzerDetail.xhtml index d31514f4..f639364c 100644 --- a/process-analyzer-demo/src_hd/com/axonivy/utils/process/analyzer/demo/component/AnalyzerDetail/AnalyzerDetail.xhtml +++ b/process-analyzer-demo/src_hd/com/axonivy/utils/process/analyzer/demo/component/AnalyzerDetail/AnalyzerDetail.xhtml @@ -56,12 +56,12 @@ title="#{task.pid}" /> - - + + - - + + @@ -69,8 +69,7 @@ value="#{data.processAnalyzerBean.getDisplayDuration(task.estimatedDuration)}" /> - + diff --git a/process-analyzer/src/com/axonivy/utils/process/analyzer/internal/WorkflowPath.java b/process-analyzer/src/com/axonivy/utils/process/analyzer/internal/WorkflowPath.java index ba38f29c..a3f9f50c 100644 --- a/process-analyzer/src/com/axonivy/utils/process/analyzer/internal/WorkflowPath.java +++ b/process-analyzer/src/com/axonivy/utils/process/analyzer/internal/WorkflowPath.java @@ -27,6 +27,7 @@ import com.axonivy.utils.process.analyzer.model.DetectedTask; import com.axonivy.utils.process.analyzer.model.ElementTask; +import ch.ivyteam.ivy.process.model.HierarchicElement; import ch.ivyteam.ivy.process.model.connector.SequenceFlow; import ch.ivyteam.ivy.process.model.element.EmbeddedProcessElement; import ch.ivyteam.ivy.process.model.element.SingleTaskCreator; @@ -296,9 +297,10 @@ private DetectedElement createDetectedTaskFromSubProcessCall(SubProcessCall subP String taskName = getTaskNameByCode(script); String customerInfo = getCustomInfoByCode(script); Duration duration = this.workflowDuration().getDuration(ElementTask.createSingle(pid), script, useCase); - + List parentElementNames = getParentElementNames(subProcessCall); + DetectedTask detectedTask = new DetectedTask(pid, taskName, elementName, timeUntilStartAt, duration, - customerInfo); + parentElementNames, customerInfo); return detectedTask; } @@ -357,8 +359,9 @@ private List keepMaxTimeUtilEndDetectedElement(List getParentElementNames(TaskAndCaseModifier task) { + private List getParentElementNames(HierarchicElement task) { List parentElementNames = emptyList(); + if(task instanceof TaskAndCaseModifier || task instanceof SubProcessCall) if (task.getParent() instanceof EmbeddedProcessElement) { parentElementNames = processGraph.getParentElementNamesEmbeddedProcessElement(task.getParent()); }