How to access com.day.cq.workflow.WorkflowSession.getModels() or getAllWorkflows() | Community
Skip to main content
Level 4
February 3, 2020
Solved

How to access com.day.cq.workflow.WorkflowSession.getModels() or getAllWorkflows()

  • February 3, 2020
  • 2 replies
  • 2881 views

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));

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Vijayalakshmi_S

Hi,

 

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. 

2 replies

Vijayalakshmi_S
Vijayalakshmi_SAccepted solution
Level 10
February 4, 2020

Hi,

 

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. 

arunpatidar
Community Advisor
Community Advisor
February 18, 2020