Skip to content

Commit

Permalink
TE-599: Handle task in sub process for calculate duration
Browse files Browse the repository at this point in the history
  • Loading branch information
trungmaihova committed Jun 5, 2024
1 parent 87911ed commit 4c4fa54
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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();"
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ private Map<SequenceFlow, List<AnalysisPath>> findAnalysisPathForNextNode(Proces

List<SequenceFlow> 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<SequenceFlow, List<AnalysisPath>> pathOptions = new LinkedHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -207,7 +207,14 @@ private Map<ProcessElement, Duration> getStartElementsWithSpentDuration(ICase ic

private List<BaseElement> getStartElements(ICase icase) {
List<ITask> tasks = getCaseITasks(icase);
List<BaseElement> elements = tasks.stream().map(task -> TaskHelper.getBaseElementOf(task)).toList();
List<BaseElement> elements = new ArrayList<>();
for (ITask task : tasks) {
BaseElement element = TaskHelper.getBaseElementOf(task);
if (isTaskInCallableSub(element)) {
element = getOriginalCallerElement(task);
}
elements.add(element);
}

return elements;
}
Expand Down

0 comments on commit 4c4fa54

Please sign in to comment.