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?
@arunpatidar, @Vijayalakshmi_S
Solved! Go to Solution.
Views
Replies
Total Likes
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.
Hi,
Try using WorkflowSession to get the current work item.
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi, I just tried this and I am able to get the workflow title and description in the step.
List<WorkflowTransition> list = workItem.getNode().getTransitions();
for (WorkflowTransition item : list) {
log.info("Workflow Step Title {}",item.getTo().getTitle());
}
logs
08.03.2021 21:17:50.828 *INFO* [0:0:0:0:0:0:0:1 [1615234670817] POST /bin/workflow/inbox HTTP/1.1] com.aemlab.aem65.core.services.DynamicReviewer Workflow Step Title Dynamic Participant Title
Views
Replies
Total Likes
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.
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies