Issue in fetching the title of the current workflow step

Avatar

Avatar

red_devil

Avatar

red_devil

red_devil

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

Vijayalakshmi_S

MVP

Avatar

Vijayalakshmi_S

MVP

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

Arun_Patidar

MVP

Total Posts

3.1K

Likes

1.2K

Correct Reply

882

Avatar

Arun_Patidar

MVP

Total Posts

3.1K

Likes

1.2K

Correct Reply

882
Arun_Patidar
MVP

07-03-2021

Hi,

Try using WorkflowSession to get the current work item.