diff --git a/process-analyzer-demo/src_hd/com/axonivy/utils/process/analyzer/demo/component/AnalyzerSelection/AnalyzerSelectionProcess.p.json b/process-analyzer-demo/src_hd/com/axonivy/utils/process/analyzer/demo/component/AnalyzerSelection/AnalyzerSelectionProcess.p.json index 686f5f5..7eb747f 100644 --- a/process-analyzer-demo/src_hd/com/axonivy/utils/process/analyzer/demo/component/AnalyzerSelection/AnalyzerSelectionProcess.p.json +++ b/process-analyzer-demo/src_hd/com/axonivy/utils/process/analyzer/demo/component/AnalyzerSelection/AnalyzerSelectionProcess.p.json @@ -114,7 +114,8 @@ "in.processAnalyzerBean.selectedAnalyzer.tasks = in.processAnalyzerBean.getDetectedTask();", "in.processAnalyzerBean.selectedAnalyzer.totalDuration = in.processAnalyzerBean.getDetectedTaskCalculate();" ] - } + }, + "sudo" : true }, "visual" : { "at" : { "x" : 288, "y" : 360 } @@ -193,7 +194,7 @@ "output" : { "code" : [ "in.processAnalyzerBean.selectedAnalyzer.alternatives = in.processAnalyzerBean.getALternativeWithMoreThanOneOutgoing();", - "in.processAnalyzerBean.selectedAnalyzer.processPath = in.processAnalyzerBean.getProcessWebLink(in.processAnalyzerBean.selectedAnalyzer.startElement);" + "in.processAnalyzerBean.selectedAnalyzer.processPath = in.processAnalyzerBean.getProcessWebLink();" ] } }, diff --git a/process-analyzer/src/com/axonivy/utils/process/analyzer/internal/PathFinder.java b/process-analyzer/src/com/axonivy/utils/process/analyzer/internal/PathFinder.java index 3aaebc1..344fe5f 100644 --- a/process-analyzer/src/com/axonivy/utils/process/analyzer/internal/PathFinder.java +++ b/process-analyzer/src/com/axonivy/utils/process/analyzer/internal/PathFinder.java @@ -433,7 +433,8 @@ private Map> findAnalysisPathForNextNode(Proces List outs = getSequenceFlows((NodeElement) from.getElement(), flowName, findType); if (from.getElement() instanceof Alternative && outs.isEmpty()) { - throw new Exception("Not found path after element " + processGraph.getAlternativeNameId(from.getElement())); + String mgs = String.format("Not found path after element: \"%s\"", processGraph.getAlternativeNameId(from.getElement())); + throw new Exception(mgs); } Map> pathOptions = new LinkedHashMap<>(); diff --git a/process-analyzer/src/com/axonivy/utils/process/analyzer/internal/ProcessAnalyzer.java b/process-analyzer/src/com/axonivy/utils/process/analyzer/internal/ProcessAnalyzer.java index 3854894..afeaac8 100644 --- a/process-analyzer/src/com/axonivy/utils/process/analyzer/internal/ProcessAnalyzer.java +++ b/process-analyzer/src/com/axonivy/utils/process/analyzer/internal/ProcessAnalyzer.java @@ -4,12 +4,12 @@ import static java.util.Optional.ofNullable; import java.time.Duration; +import java.util.ArrayList; import java.util.Date; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Optional; import java.util.stream.Stream; import org.apache.commons.lang3.ArrayUtils; @@ -207,7 +207,14 @@ private Map getStartElementsWithSpentDuration(ICase ic private List getStartElements(ICase icase) { List tasks = getCaseITasks(icase); - List elements = tasks.stream().map(task -> TaskHelper.getBaseElementOf(task)).toList(); + List elements = new ArrayList<>(); + for (ITask task : tasks) { + BaseElement element = TaskHelper.getBaseElementOf(task); + if (isTaskInCallableSub(element)) { + element = getOriginalCallerElement(task); + } + elements.add(element); + } return elements; }