cancel
Showing results for 
Search instead for 
Did you mean: 

ActivityName is null when calling signal method

jbinder
Champ in-the-making
Champ in-the-making
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?
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
I think you have discovered an issue with the consistency of "getCurrentActivityName" and the actual activity that is active when signaling. As a workaround, you can use the ActivityExecution->getActivity().getProperty(name) to get the name…

Can you create a JIRA-issue for this, "fix version" set to 5.13? Thanks!

jbinder
Champ in-the-making
Champ in-the-making
Hi frederikheremans,

sorry for my late respone but I was off last week.
I do not have a JIRA account to create a bug issue for that point.

Thanks for your workaround, but the problem is that ActivityExecution->getActivity() delivers NULL in that case.

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
I do not have a JIRA account to create a bug issue for that point.

It is easy to create…