Values are not getting saved under metaData under var/workflows

Avatar

Avatar

prathik-sm

Avatar

prathik-sm

prathik-sm

05-01-2021

Hi Team,

 

We have custom dialog which will be used in the dialog participant step.

 

Case 1: Saving under data/metaData (helpful in accessing across different steps under same workflow) The fields in this dialog needs to be saved under metaData as we need them in the further steps. So we are storing the field like ./metaData/watchEmails We see that values are not getting saved under metaData(/var/workflow/instances/server0/2021-01-04/new-model_26/data/metaData)

Case 2: Saving under history metaData (specific to workitem) If we save the field like 'watchEmails' then it is getting saved under (/var/workflow/instances/server0/2021-01-04/new-model_26/history/1609766229181/workItem/metaData)

Case 3: Saving under payload If we save the field like './jcr:content/watchEmails' then it will be saved under payload 

 

Kindly help us in storing the fields as mentioned in Case 1 - It would be helpful in accessing the value across other steps.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

kunal23

MVP

Avatar

kunal23

MVP

kunal23
MVP

05-01-2021

You should go with case #2 and access the stored data in subsequent process steps using workflow history API- 

 

Example-

List<HistoryItem> historyItemList = workflowSession.getHistory(workItem.getWorkflow());
HistoryItem currentItem = historyItemList.get(historyItemList.size() - 1);
HistoryItem prevItem = currentItem.getPreviousHistoryItem();

String str = prevItem.getMetadataMap().get("watchEmails ");

Answers (1)

Answers (1)

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

3.1K

Likes

1.2K

Correct Reply

879

Avatar

Arun_Patidar

MVP

Total Posts

3.1K

Likes

1.2K

Correct Reply

879
Arun_Patidar
MVP

07-01-2021

Hi, 

The dialog dialog participant step stores the value in payload node, not in workflow instance node. If you need this property only in the workflow then you can get ti from history or directly from payload.