Skip to content

Conversation

@Vasiliy13
Copy link

@Vasiliy13 Vasiliy13 commented Sep 30, 2021

Hello!
Where is a headache to get parent's executionId by activity in some cases. For example if you will try something like:
const activity = execution.definitions[0].getActivityById('activityId');
console.log(activity.parent.executionId);
The result is undefined;

And activity gotten by subscription has a valid executionId:
listener.on('activity.start', activity => console.log(activity.content.parent.executionId));

I investigated few places where it could be hidden and fixed it. I am not sure if it's a correct but it did a job.
Mainly i just distribute newly created executionId from ProcessExecution to starting activities and update already added children in ProcessExecution instance.
What do think?

@Vasiliy13
Copy link
Author

I think i was wrong because there could be many instances of the activity in case when we have a loop or multiple processes and they all share one id, right? But how does it work if getActivityById called by definition return just one value, which one? I think we need something like getActivityByExecutionId and getElementByExecutionId.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant