Skip to main content
Oct 16, 2015 2:27 AM UTC
Solved

Pass WorkFlow data from one custom step to another

Wondering how to persist workflow data from one step to another.

From my understanding we use the following code to save the workflow data for the second step:

 

public void execute(WorkItem item, WorkflowSession session, MetaDataMap args) throws WorkflowException {
         
    MetaDataMap wfd = item.getWorkflow().getMetaDataMap();
 
    wfd.put("mykey", "My Step Value");
         
    Set<String> keyset = wfd.keySet();
    Iterator<String> i = keyset.iterator();
    while (i.hasNext()){
        Object key = i.next();
        log.info("The workflow medata includes key {} and value {}",key.toString(),wfd.get(key).toString());
    }
}

 

How do you retreive the data from the second custom step?

 

Thanks,

Ram

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Scott_Brodersen
Scott_BrodersenAccepted solution
Level 8
Oct 16, 2015 2:27 AM UTC

The MetaDataMap object contains all of the workitem data. The key/value pair is one item of data. So, you would add each data item that you are handling to the object. 

Perhaps you could describe in more detail what it is you are implementing and we could help you more directly?

scott

5 replies

Scott_Brodersen
Scott_BrodersenAccepted solution
Level 8
Oct 16, 2015 2:27 AM UTC

The MetaDataMap object contains all of the workitem data. The key/value pair is one item of data. So, you would add each data item that you are handling to the object. 

Perhaps you could describe in more detail what it is you are implementing and we could help you more directly?

scott

Translate
Oct 16, 2015 2:27 AM UTC

Sorry can't seem to wrap my head around this.

The following line of code:

wfd.put("mykey", "My Step Value");

 

What exactly is "my step value"? Workflow Item/Data?

If someone can show me an example that would be greatly appreciated.

Thanks

Translate
Scott_Brodersen
Level 8
Oct 16, 2015 2:27 AM UTC
Oct 16, 2015 2:27 AM UTC

Sorry, took a look at that AEM topic and it didn't have anything on pass workflow data between custom processes.

Translate
smacdonald2008
Level 10
Oct 16, 2015 2:27 AM UTC