How to access or getAllWorkflows()



Hi All,

In the Java code shown below , what should serviceParams be set to , or how should serviceParams be set up , to allow access to getModels() or getAllWorkflows() ?

Thank you for your time.


resourceResolver = resourceResolverFactory.getServiceResourceResolver(serviceParams);
session = resourceResolver.adaptTo(Session.class);
WorkflowSession wfSession = workflowService.getWorkflowSession(session);

WorkflowModel wfModels[] = wfSession.getModels();
resultLog.add(new ResultLog.Entry(Result.Status.OK, "wfModels.length: " + wfModels.length));
Workflow flows[] = wfSession.getAllWorkflows();
resultLog.add(new ResultLog.Entry(Result.Status.OK, "flows.length: " + flows.length));


Accepted Solutions (1)

Accepted Solutions (1)






serviceParams in the snippet shared should be a map object with value being ResourceResolverFactory's subservice details in which Service user configured should have permission related to workflow paths.

(OSGI config named - Service User mapper Service amendment should be configured accordingly)

Eg. If it is about reading/getting workflow models then read permission on workflow related paths like /var/workflow/* and /conf/global/settings/workflow/* should be set for the configured service user. 

Answers (0)