pefernan commented on code in PR #7092:
URL: https://github.com/apache/incubator-kie/pull/7092#discussion_r3967735979
##########
kogito-jbpm/jbpm-flow/src/main/java/org/kie/kogito/process/impl/ProcessServiceImpl.java:
##########
@@ -162,9 +162,16 @@ public <T extends MappableToModel<R>, R> Optional<R>
updatePartial(Process<T> pr
public <T extends MappableToModel<R>, R> Optional<R>
signalProcessInstance(Process<T> process, String id, Object data, String
signalName) {
return UnitOfWorkExecutor.executeInUnitOfWork(
application.unitOfWorkManager(),
- () -> process
- .instances().acceptingEventType(signalName, id)
- .findFirst()
+ () -> process.instances()
+ .findById(id)
+ .filter(pi -> {
+ if (pi.events().stream().anyMatch(e ->
signalName.equals(e.getEvent()) || ("Message-" +
signalName).equals(e.getEvent()))) {
+ return true;
+ }
+ return pi.adHocFragments()
+ .stream()
+ .anyMatch(f ->
f.getName().equals(signalName));
+ })
.map(pi -> {
pi.send(SignalFactory.of(signalName, data));
Review Comment:
Message- check is not required in this scenario thank you for catching this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]