AnsweredAssumed Answered

ActivityName is null when calling signal method

Question asked by jbinder on Mar 1, 2013
Latest reply on Mar 12, 2013 by ronald.van.kuijk
Hi,

I implemented a custom JavaServiceTask extending TaskActivityBehavior.
I override the execute and signal method.
Everything works fine in the execute method execution.getCurrentActivityName() returns the ActivitiName.
But if I call runtimeService.signal(executionId) - inside the signal method the execution.getCurrentActivityName() returns null


public class MyServiceTask extends TaskActivityBehavior
{

    @Override
    public void execute(ActivityExecution execution)
    {
            // this will return the actual ActivitiName
            execution.getCurrentActivityName();
     }

  @Override
    public void signal(ActivityExecution execution, String signalName, Object signalData) throws Exception
    {
            // this will return null
            execution.getCurrentActivityName();
    }
}

The same problem exists when I perform an executionQuery:
ExecutionEntity execution = (ExecutionEntity)runtimeService.createExecutionQuery().processInstanceId(processInstanceId).singleResult();
execution.getCurrentActivityName() is null in that case.

My workaround now is to store the ActivityName as value of a process variable with the executionId as key.
Can I get the currentActivitiName otherwise in the signal method?
Is that a bug and should I open a bug ticket?

Outcomes