Hi All,
For one of my requirements I have had to create a custom console from where authors can select pages and initiate a workflow. Since authors can select multiple pages, I need to be able to pass multiple payload to the workflow. I know this could be done via Workflow packages but the documentation around it seems rather limited. I need to create Workflow package on the fly. I'm aware of a ResourceCollection and ResourceCollectionManager service that could be used but somehow it doesn't work. I'm using the following code:-
ResourceCollection resourceCollection = resourceCollectionManager.createCollection(session.getNode(workflowPkgPage.getPath())); logger.debug("resourceCollection node created = {}", resourceCollection.getPath());
and I get the following logged in my logs (INFO):-
"com.adobe.granite.workflow.core.collection.ResourceCollectionManagerImpl Resource collection at /etc/workflow/packages/mypackage2 is not a package."
Followed by a NPE in the second line of code above. "/etc/workflow/packages/mypackage2" does indeed exist in CRX. This is a node I am creating first and passing to the above code.
To add to confusion, there are two set of workflow APIs in CQ with following namespace:
- com.adobe.granite.workflow.*
- com.day.cq.workflow.*
I am using the first package, as I believe it to be the "latest and greatest" (Possibly because I thought that Adobe will gradually move to granite packaging namespace). Although most classes and methods do seem identical between the two namespaces.
Which one among the two should be used ?
To summarize there are two questions:
- Which package to use for Workflow implementation?
- How to create workflow packages programmatically?
Thanks
Ashish