Query for execution having activity instance id

Hello,

does the method activityId() in ExecutionQuery search by an activity instance id?

I’m asking after reading this blog post. Seems activity id and activity instance are different things, and looking up for an execution having an activity should be reasonable.

I obtain the activity instance id in an event listener with getActivityInstanceId method of an ActivityExecution.

#activityId filters by activity id, not activity instance id. Querying executions by activity instance id is currently not possible other than by calling RuntimeService#getActivityInstance for a single process instance and going from there.

Cheers,
Thorben

1 Like

Thanks, I have an additional but related question. Is there any event that is fired when a process flow changes its execution id?

For example, I have recorded somewhere an execution id of some “signal event”, and at a later time I’d wish to proceed the flow, but the signal event execution id may have changed since. (If I’ve got it correctly) One way would be to record an activity instance id instead of execution id, and then find the current execution out of it. I want to check if it is more efficient to change the execution id in my record when executions are merged, in some sort of event listener.

There is no such listener concept.

Cheers,
Thorben

1 Like