Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Retrive fork transitions names in javascript

Avatar

Avatar
Validate 1
Level 1
matteo_petrocchi
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
matteo_petrocchi
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
matteo_petrocchi
Level 1

07-05-2021

Hi all, 

 

is it possible to retrieve fork transitions names from javascript?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
wodnicki
MVP

Likes

958 likes

Total Posts

1,079 posts

Correct Reply

506 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile

Avatar
Establish
MVP
wodnicki
MVP

Likes

958 likes

Total Posts

1,079 posts

Correct Reply

506 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile
wodnicki
MVP

09-05-2021

Hi,

 

You can get them by searching workflow for transitions with your activity as target.

Transition object types can change depending on the activity (e.g. fork is weird), so just copy this and alter as needed:

 

var transitions = [];
for each (var activities in instance.activities) {
  for each (var instanceActivity in activities) {
    for each (var transition in instanceActivity.transitions) {
      if (transition.target === activity.name) transitions.push(transition.name);
      for each (var transition2 in transition) {
        if (transition2.target === activity.name) transitions.push(transition2.name);
      }
    }
  }
}

 

Thanks,

-Jon

Answers (0)