Skip to content

Commit

Permalink
getSerializableNodeInstances_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhitocode committed Oct 22, 2024
1 parent ac28d72 commit c50c898
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ public int getLevelForNode(String uniqueID) {
return 1;
}

@Override
public Collection<org.kie.api.runtime.process.NodeInstance> getSerializableNodeInstances() {
return getNodeInstances().stream().filter(ForEachNodeInstance::isSerializable).collect(Collectors.toUnmodifiableList());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public FieldDescriptor getContextField(GeneratedMessageV3.Builder<?> builder) {
}

protected <T extends NodeInstanceContainer & ContextInstanceContainer & ContextableInstance> WorkflowContext buildWorkflowContext(T nodeInstance) {
List<NodeInstance> nodeInstances = new ArrayList<>(nodeInstance.getSerializableNodeInstances());
List<NodeInstance> nodeInstances = new ArrayList<>(nodeInstance.getNodeInstances());
List<ContextInstance> exclusiveGroupInstances = nodeInstance.getContextInstances(ExclusiveGroup.EXCLUSIVE_GROUP);
VariableScopeInstance variableScopeInstance = (VariableScopeInstance) nodeInstance.getContextInstance(VariableScope.VARIABLE_SCOPE);
List<Map.Entry<String, Object>> variables = (variableScopeInstance != null) ? new ArrayList<>(variableScopeInstance.getVariables().entrySet()) : Collections.emptyList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void buildWorkflowContext() {
ArgumentCaptor<List<Map.Entry<String, Integer>>> iterationlevelsCapture = ArgumentCaptor.forClass(ArrayList.class);
verify(spiedProtobufProcessInstanceWriter).buildWorkflowContext(nodeInstancesCapture.capture(), exclusiveGroupInstancesCapture.capture(), variablesCapture.capture(),
iterationlevelsCapture.capture());
Collection<NodeInstance> expected = nodeInstance.getSerializableNodeInstances();
Collection<NodeInstance> expected = nodeInstance.getNodeInstances();
List<NodeInstance> retrieved = nodeInstancesCapture.getValue();
assertThat(retrieved).isNotNull().hasSize(expected.size()).allMatch(expected::contains);
}
Expand Down

0 comments on commit c50c898

Please sign in to comment.