04-18-2016 05:48 PM
public class MyAsyncTask implements SignallableActivityBehavior {
// something that takes long time (sending JMS message)
public void execute(ActivityExecution exec) throws Exception {
// sending msg to JMS here, long running task …
}
// after processing JMS, queue the process is notified and this method is invoked:
public void signal(ActivityExecution execution, String signalEvent,
Object signalData) throws Exception {
PvmTransition transition = execution.getActivity().getOutgoingTransitions().get(0);
execution.take(transition);
}
}
runtimeService.signal(pid); // working ok …
runtimeService.signalEventReceived(eventName, pid, vars);
Exception in thread "main" org.activiti.engine.ActivitiException: Execution '15001' has not subscribed to a signal event with name 'Failure Local'.
04-19-2016 02:54 AM
/**
* Sends an external trigger to an activity instance that is waiting inside
* the given execution.
*
* @param executionId
* id of execution to signal, cannot be null.
* @param processVariables
* a map of process variables
* @throws ActivitiObjectNotFoundException
* when no execution is found for the given executionId.
*/
void signal(String executionId, Map<String, Object> processVariables);
example:org.activiti.engine.test.api.runtime.RuntimeServiceTest#testSignalWithProcessVariablesruntimeService.signalEventReceived(eventName, pid, vars);example:org.activiti.engine.test.bpmn.event.signal.SignalEventTest#testSignalStartEventFromAPI04-19-2016 10:51 AM
{
"action":"signal",
"signalName":"waitsig"
}
java.lang.NullPointerException: null
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.signal(ExecutionEntity.java:404)
at org.activiti.engine.impl.cmd.SignalCmd.execute(SignalCmd.java:43)
at org.activiti.engine.impl.cmd.NeedsActiveExecutionCmd.execute(NeedsActiveExecutionCmd.java:55)
at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
at org.activiti.engine.impl.RuntimeServiceImpl.signal(RuntimeServiceImpl.java:231)
at org.activiti.rest.service.api.runtime.process.ExecutionResource.performExecutionAction(ExecutionResource.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
While with the payload of:
{
"action":"signalEventReceived",
"signalName":"waitsig",
}
It responds with : "message": "Execution '17' has not subscribed to a signal event with name 'waitsig'.",04-19-2016 11:22 AM
04-19-2016 11:53 AM
04-20-2016 02:22 AM
04-20-2016 09:38 AM
04-21-2016 07:56 AM
it is not included in the release package, (I've looked into the lib/activiti-engine.jar) right?release does not contain tests. Download project from source repository.
Is that the expected behaviour?
04-21-2016 08:31 AM
void signalEventReceived(String, String, Map<String, Object>); call. void signal(String executionId, Map<String, Object> processVariables); piece soon.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.