Persist Data between process step and participant step | Community
Skip to main content
Level 9
October 16, 2015
Solved

Persist Data between process step and participant step

  • October 16, 2015
  • 9 replies
  • 1509 views

Hello ,

I have a sequential workflow

1. Process Step (Custom Process step)

2. Participant Step (Custom participant step returning group name)

3.Process step(Approval step)

  • A) I am not able to send data between steps 2 and 3, but am able to send data between steps 1 and 2 

I have made use of workflowData.getMetaDataMap().get("groupPath") and         workflowData.getMetaDataMap().put("groupPath","test");

  • B) Is there a way to identify which user , and users profile , who has approved the payload?

Please let me know.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by WillMc1

Hi Nicole,

I am not exactly sure what you're trying to do - are you saying that in Step2 you use a Dynamic Participant step to assign to a group of users, and on Step3 you would like to know which user from that group completed the workitem?

If that is the case, you can dig into the workflow history to determine which user completed the previous workitem.  Something like:

List<HistoryItem> historyItems = workflowSession.getHistory(workItem.getWorkflow()); String userWhoCompletedLastStep = historyItems.get(historyItems.size() -1).getUserId();

Hopefully this helps - let us know!

Will

9 replies

WillMc1Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

Hi Nicole,

I am not exactly sure what you're trying to do - are you saying that in Step2 you use a Dynamic Participant step to assign to a group of users, and on Step3 you would like to know which user from that group completed the workitem?

If that is the case, you can dig into the workflow history to determine which user completed the previous workitem.  Something like:

List<HistoryItem> historyItems = workflowSession.getHistory(workItem.getWorkflow()); String userWhoCompletedLastStep = historyItems.get(historyItems.size() -1).getUserId();

Hopefully this helps - let us know!

Will

Level 9
October 16, 2015

Anyone?

Level 9
October 16, 2015

Will McGauley wrote...

Hi Nicole,

I am not exactly sure what you're trying to do - are you saying that in Step2 you use a Dynamic Participant step to assign to a group of users, and on Step3 you would like to know which user from that group completed the workitem?

If that is the case, you can dig into the workflow history to determine which user completed the previous workitem.  Something like:

 
  1. List<HistoryItem> historyItems = workflowSession.getHistory(workItem.getWorkflow());
  2. String userWhoCompletedLastStep = historyItems.get(historyItems.size() -1).getUserId();

Hopefully this helps - let us know!

Will

 

 

 

Thank you Will, that helped a lot.:)

smacdonald2008
Level 10
October 16, 2015

I asked Eng to take a look at this. 

Level 9
October 16, 2015

Hey Will,

I am trying to access the metadata property/ node in the workflow process step, which is after the custom participant step.

  • Participant Step
  • Process step -(Here is where i am trying to access the metadata)

I have added the following lines which works fine if it was series of process steps, but now that i pass data from participant step I see it not possible to extract.

workflowData.getMetaDataMap().get(langCode) - in process step that follows the participant step -Returns null in workflow

I also see that when i run the code with workflowData.getMetaDataMap().put("test",test) at participant step it doesn't get stored , 

 

Please let me know.

Adobe Employee
October 16, 2015

One thing that I'd like to point out is that there are two different workflowData objects in play all the time:

1) workItem.getWorkflowData() returns metadata for just the workitem

2) workItem.getWorkflow().getWorkflowData() returns metadata for the entire workflow


From your code snippets I cannot tell which WorkflowData you are referring to, perhaps this was part of the problem?

Will

Level 9
October 16, 2015

Figured it out. Thanks :), extracted using the node.getProperty, wondered if there was a simple way to do it, using API's

Level 9
October 16, 2015

Thank you scott, really appreciate the help.

Regards,

Nicole

smacdonald2008
Level 10
October 16, 2015

I am glad that you got that solved.