fjtirado commented on code in PR #4003:
URL: 
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4003#discussion_r2257068874


##########
jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java:
##########
@@ -682,7 +682,7 @@ public void signalEvent(String type, Object event) {
         logger.debug("Signal {} received with data {} in process instance {}", 
type, event, getStringId());
         synchronized (this) {
             if (getState() != KogitoProcessInstance.STATE_ACTIVE) {
-                return;
+                throw new IllegalStateException("Current process instance 
state is not active");

Review Comment:
   @thien There are test failing, we need to throw the exception  (when the 
state is not active so the event will be at the end ignored) here 
https://github.com/apache/incubator-kie-kogito-runtimes/blob/main/jbpm/jbpm-flow/src/main/java/org/kie/kogito/process/impl/ProcessServiceImpl.java#L166
 (and leave this class untouched)
   It is not ideal because ProcessServiceImpl know that 
WorkflowProcessIntanceImpl check the state (there is a clear break of 
encapsulation) but it is ok in the sense that not active process sohuld ignore 
signals anyway and the top layer api is informing of that to the "external" 
caller (while internally we do not break anything, hopefully)



-- 
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]

Reply via email to