Issue in fetching the title of the current workflow step

Avatar

Avatar
Give Back
Level 1
red_devil
Level 1

Likes

0 likes

Total Posts

4 posts

Correct reply

1 solution
Top badges earned
Give Back
Affirm 1
View profile

Avatar
Give Back
Level 1
red_devil
Level 1

Likes

0 likes

Total Posts

4 posts

Correct reply

1 solution
Top badges earned
Give Back
Affirm 1
View profile
red_devil
Level 1

07-03-2021

Hi,

 

I want to fetch the title and description of a dynamic participant step that I'm currently in. I tried using

workItem.getNode().getTitle() but it returns the title of the previous step and not the current one (dynamic participant step). Is there any way to fetch the details of the current step in workflows?

 

@Arun_Patidar@Vijayalakshmi_S 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

573 likes

Total Posts

728 posts

Correct reply

240 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

573 likes

Total Posts

728 posts

Correct reply

240 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile
Vijayalakshmi_S
MVP

08-03-2021

Hi @red_devil,

I am able to reproduce the behavior you have mentioned. 

As part of debugging, could find that the workItem Id being in ParticipantChooser Implementation returns as VolatileWorkItem.

(You can log this line of code workItem.getId() -> VolatileWorkItem_node0_var_workflow_instances_server0_2021-03-08_sampleworkflow_10)

On a very high level, with this information could suspect that the details with respect to the workItem node like title, description is not accessible/not in the vicinity of ParticipantChooser implementation. 

Alternatively, you can consider use of  "Arguments" field  of Dynamic participant step to pass inputs along the lines of title/description.(which shall then be retrieved from MetaDataMap, third argument of getParticipant method)

While the same line of code - workItem.getNode().getTitle() being executed from process step will return its respective details (title as authored in process step)

Note : As the granite workflow implementation is hidden, couldn't arrive at the exact reason for this behavior.

Answers (1)

Answers (1)

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,442 likes

Total Posts

3,322 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,442 likes

Total Posts

3,322 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

07-03-2021

Hi,

Try using WorkflowSession to get the current work item.