logger.debug("Signaling task " + tokenId + " from process instance " +
token.getProcessInstance().getId()) ;
}
final ProcessInstance processInstance = token.getProcessInstance() ;
final ContextInstance contextInstance = processInstance.getContextInstance() ;
final JbpmContext jbpmContext = executionContext.getJbpmContext() ;
final String transitionName = (String)removeVariableLocally(jbpmContext, contextInstance, ESB_ASYNC_SIGNAL_TRANSITION_VARIABLE_NAME, token) ;
final String actor = (String)removeVariableLocally(jbpmContext, contextInstance, ESB_ASYNC_SIGNAL_ACTOR_VARIABLE_NAME, token) ;
final String origActor = jbpmContext.getActorId() ;
final int variableCount = Integer.parseInt((String)removeVariableLocally(jbpmContext, contextInstance, ESB_ASYNC_SIGNAL_VARIABLE_COUNT, token)) ;
for(int count = 0 ; count < variableCount ; count++)
{
final String name = (String)removeVariableLocally(jbpmContext, contextInstance, ESB_ASYNC_SIGNAL_VARIABLE_NAMES + count, token) ;
final Object value = removeVariableLocally(jbpmContext, contextInstance, name, token) ;
contextInstance.setVariable(name, value) ;
}
try
{
if (actor != null)
{
jbpmContext.setActorId(actor) ;
}
final SignalCommand signalCommand = new SignalCommand(tokenId, transitionName) ;
signalCommand.execute(jbpmContext) ;
}
finally
{
jbpmContext.setActorId(origActor) ;
}
if (isDebugEnabled)
{
logger.debug("Signalled task " + tokenId + " from process instance " +
token.getProcessInstance().getId()) ;