Expand my Community achievements bar.

SOLVED

send multiple paths as payload in workflow using java

Avatar

Level 4

I have seen a package path was sent as payload path when we want multiple paths as payload.

Now how to create package of multiple paths and send as payload in workflow using java.

 

I want to trigger a worflow using java with multiple paths as payload. Now how can i create a package of these paths and pass as payload to workflow.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @AliSyed1 
When you add multiple payload, it creates a package kind node structure in JCR and replicate content from there.

If you want to achieve same, you need to do exactly the same using java

example: https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/master/bundle/src/main/java/com/ad...  



Arun Patidar

View solution in original post

4 Replies

Avatar

Level 4

Sorry for the confusion I want to trigger workflow using java code.

Avatar

Correct answer by
Community Advisor

Hi @AliSyed1 
When you add multiple payload, it creates a package kind node structure in JCR and replicate content from there.

If you want to achieve same, you need to do exactly the same using java

example: https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/master/bundle/src/main/java/com/ad...  



Arun Patidar

Avatar

Community Advisor

Hi, 

 

Adding to what @arunpatidar already explained, you would need to:

 

  1. Create a workflow package as Arun has pointed out.

  2. Start the workflow with the path of the package created in step 1 as the payload. Something like this should work:

 

        WorkflowModel workflowModel = workflowSession.getModel("/var/workflow/models/yourModel");
        WorkflowData wfData = workflowSession.newWorkflowData("JCR_PATH", "/path/to/your/wfPackage");
        workflowSession.startWorkflow(workflowModel, wfData);

 

References:

https://experienceleague.adobe.com/en/docs/experience-manager-65/content/sites/administering/operati... 

 

Hope this helps



Esteban Bustamante