Skip to content

Commit

Permalink
JBPM-10162 IntermediateThrowingSignal node from subprocess and the su…
Browse files Browse the repository at this point in the history
…bprocess is not getting marked as executed (#2273)
  • Loading branch information
bxf12315 authored Mar 28, 2023
1 parent 454fe3d commit 3e967fb
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,13 @@ public Collection<NodeInstanceDesc> getProcessInstanceHistoryCompleted(long proc
return getProcessInstanceHistory(processId, true, queryContext);
}

@Override
public Collection<NodeInstanceDesc> getProcessInstanceHistoryFinished(long processId, QueryContext queryContext) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("processId", processId);
applyQueryContext(params, queryContext);
return commandService.execute(new QueryNameCommand<List<NodeInstanceDesc>>("getProcessInstanceFinishedNodes", params));
}

protected Collection<NodeInstanceDesc> getProcessInstanceHistory(long processId, boolean completed, QueryContext queryContext) {
Map<String, Object> params = new HashMap<String, Object>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,37 @@
</query>
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-query>


<named-query name="getProcessInstanceFinishedNodes">
<query>
select
new org.jbpm.kie.services.impl.model.NodeInstanceDesc(
log.nodeInstanceId,
log.nodeId,
log.nodeName,
log.nodeType,
log.externalId,
log.processInstanceId,
log.date,
log.connection,
log.type,
log.workItemId,
log.referenceId,
log.nodeContainerId,
log.slaDueDate,
log.slaCompliance
)
from
NodeInstanceLog log
where
log.type in ( 1, 2, 3 ,4 )
and log.processInstanceId=:processId
ORDER BY
log.id ASC
</query>
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-query>

<named-query name="getNodeInstanceForWorkItem">
<query>
select
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@ public void testReTriggerNodeInstance() {
assertNotNull(completedNodes);
assertEquals(1, completedNodes.size());

// test for finished nodes
Collection<NodeInstanceDesc> finishedNodes = runtimeDataService.getProcessInstanceHistoryFinished(processInstanceId, new QueryFilter());
assertNotNull(finishedNodes);
assertEquals(2, finishedNodes.size());

final List<NodeInstanceDesc> nodeInstances = completedNodes.stream().filter(node -> node.getId().equals(active.getId())).collect(Collectors.toList());
assertEquals(0, nodeInstances.size());

Expand Down
11 changes: 10 additions & 1 deletion jbpm-services/jbpm-services-api/src/build/revapi-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,16 @@
"methodName": "countProcessInstancesByDeploymentId",
"elementKind": "method",
"justification": "[RHPAM-4028] Allow to count process instances by deploymentId and states."
}
},
{
"code": "java.method.addedToInterface",
"new": "method java.util.Collection<org.jbpm.services.api.model.NodeInstanceDesc> org.jbpm.services.api.RuntimeDataService::getProcessInstanceHistoryFinished(long, org.kie.api.runtime.query.QueryContext)",
"package": "org.jbpm.services.api",
"classSimpleName": "RuntimeDataService",
"methodName": "getProcessInstanceHistoryFinished",
"elementKind": "method",
"justification": "[RHPAM-4653] IntermediateThrowingSignal node from subprocess and the subprocess is not getting marked as executed."
}
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,15 @@ public int getValue() {
*/
Collection<NodeInstanceDesc> getProcessInstanceHistoryCompleted(long processInstanceId, QueryContext queryContext);

/**
/**
* Returns trace of all passed (include completed, skipped, aborted, OBSOLETE) for given process instance id
* @param processInstanceId unique identifier of process instance
* @param queryContext control parameters for the result e.g. sorting, paging
* @return
*/
Collection<NodeInstanceDesc> getProcessInstanceHistoryFinished(long processInstanceId, QueryContext queryContext);

/**
* Returns complete trace of all executed (completed) and active nodes for given process instance id
* @param processInstanceId The id of the process used to start the process instance.
* @param queryContext control parameters for the result e.g. sorting, paging
Expand Down

0 comments on commit 3e967fb

Please sign in to comment.