MessageSession messageSession = environment.get(MessageSession.class);
if (messageSession==null) {
throw new JbpmException("no message session for executing command asynchronously");
}
String userId = (propagateUserId ? environment.getAuthenticatedUserId() : null);
messageSession.send(new AsyncCommandMessage(command, userId));
return null;
}
public void setPropagateUserId(boolean propagateUserId) {
this.propagateUserId = propagateUserId;