Cannot write properties to workflow instance at workflow dialog participant step
Dear community,
I need a workflow that allows users to upload a file to DAM at one step, the same file can be downloaded at another step ahead.
Here comes the issue, I need WorkflowSession and WorkItem to write properties on workflow instance, but I cannot get them on the Servlet that adds asset to DAM.
find snippet below, the workitemId is null;
ResourceResolver resolver = request.getResourceResolver();
String workitemId = request.getParameter("item");
However, this part does work if I call the servlet with "sling:resourceType". So it's about the object that calls servlet I assume.
So there are 2 ways to get WorkflowSession and WorkItem
1. Using "custom process step", WorkflowProcess interface get me these two.
2. Calling servlet with sling:resourceType.
But in my case, I can only imagine designing upload / download step with participant dialog step. As I click custom upload button, the servlet writes the file path on workflow instance, and another servlet ahead fetch the property with same approach.
Is there anything I can do to get WorkflowSession and WorkItem with dialog participant step?
Or I could use other steps in my workflow to achieve this?