Dear Maciej Swiderski
I have changed my code as you had suggested alreay and I tried to signal the execution Id of the wait state activity instead of signaling the process itself and it didn't throw any exception. At first it seams that it works but later I have noticied that the no transtion in wait state is traveresed and the state of the process isn't changed.
you can see part of my process definition here:
<state name="activity.investor.registeration.inquiry.suspend" >
<transition name="investor.inquiry.replied" to="activity.investor.registeration.inquiry.evaluate"/>
<transition name="investor.inquiry.timeout" to="activity.investor.registeration.inquiry.check">
<timer duedate="50 minutes" />
</transition>
</state>
and here is my code for signaling the above mentioned wait state:
processInstance = executionService.findProcessInstanceById(processId);
// it is not null and have a value
if (processInstance != null) {
String executionId = processInstance.findActiveExecutionIn("activity.investor.registeration.inquiry.suspend").getId();
// the executionId is also not null and have the value.
if (executionId != null) {
executionService.signalExecutionById(executionId, getProcessVariables(parameters));
}
}
log.info("signal process state succeed!");
Neither investor.inquiry.replied nor investor.inquiry.timeout is not called and traversed by the workflow engine and the process remains again at "activity.investor.registeration.inquiry.suspend" state.
I should again notified that if there is not a timer in the wait state , on can signal it by the following code without any problem and it works:
executionService.signalExecutionById(processId, getProcessVariables(parameters));
But if there is timer in the wait state activity (like one that mentioned aboved) the calling of this method causes an exception and the message of due to this error that the current status of the process is inactive-scope.
Thanks
Soheil