Workflow fails for WorkflowSession.getBackRoutes(WorkItem, true) after migration to AEM 6.4

Avatar

Avatar
Ignite 1
Level 1
manishprabhut20
Level 1

Likes

0 likes

Total Posts

6 posts

Correct reply

0 solutions
Top badges earned
Ignite 1
Give Back
View profile

Avatar
Ignite 1
Level 1
manishprabhut20
Level 1

Likes

0 likes

Total Posts

6 posts

Correct reply

0 solutions
Top badges earned
Ignite 1
Give Back
View profile
manishprabhut20
Level 1

07-02-2020

We are migrating our instance to AEM 6.4 and the workflow fails with the error "No Authorizable with ID null" when this line in our code is executed WorkflowSession.getBackRoutes(WorkItem, true) whereas the same workflow works without any errors if we change the second parameter to false WorkflowSession.getBackRoutes(WorkItem, false).

 

We tried executing with admin user as well.

With respect to permission tried providing all the permissions to the workflow service users as well

 

The error being observed is :

com.adobe.granite.workflow.WorkflowException: Process execution resulted in an error
at com.adobe.granite.workflow.core.job.HandlerBase.executeProcess(HandlerBase.java:204) [com.adobe.granite.workflow.core:2.0.168.CQ640-B0006]
at com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.java:261) [com.adobe.granite.workflow.core:2.0.168.CQ640-B0006]
at org.apache.sling.event.impl.jobs.JobConsumerManager$JobConsumerWrapper.process(JobConsumerManager.java:502) [org.apache.sling.event:4.2.12]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.startJob(JobQueueImpl.java:293) [org.apache.sling.event:4.2.12]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.access$100(JobQueueImpl.java:60) [org.apache.sling.event:4.2.12]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl$1.run(JobQueueImpl.java:229) [org.apache.sling.event:4.2.12]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.adobe.granite.workflow.WorkflowException: No Authorizable with ID null
at com.adobe.granite.workflow.core.util.SecurityUtil.getAuthorizable(SecurityUtil.java:49) [com.adobe.granite.workflow.core:2.0.168.CQ640-B0006]
at com.adobe.granite.workflow.core.jcr.WorkItemManager.getBackRoutes(WorkItemManager.java:806) [com.adobe.granite.workflow.core:2.0.168.CQ640-B0006]
at com.adobe.granite.workflow.core.WorkflowSessionImpl.getBackRoutes(WorkflowSessionImpl.java:1030) [com.adobe.granite.workflow.core:2.0.168.CQ640-B0006]

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Ignite 1
Employee
aemmarc
Employee

Likes

184 likes

Total Posts

243 posts

Correct reply

92 solutions
Top badges earned
Ignite 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Ignite 1
Employee
aemmarc
Employee

Likes

184 likes

Total Posts

243 posts

Correct reply

92 solutions
Top badges earned
Ignite 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
aemmarc
Employee

07-02-2020

Reviewed : 

at com.adobe.granite.workflow.core.util.SecurityUtil.getAuthorizable(SecurityUtil.java:49) [com.adobe.granite.workflow.core:2.0.168.CQ640-B0006]
at com.adobe.granite.workflow.core.jcr.WorkItemManager.getBackRoutes(WorkItemManager.java:806) [com.adobe.granite.workflow.core:2.0.168.CQ640-B0006]
at com.adobe.granite.workflow.core.WorkflowSessionImpl.getBackRoutes(WorkflowSessionImpl.java:1030) [com.adobe.granite.workflow.core:2.0.168.CQ640-B0006]

 

 

 

    private static String DEFAULT_NO_AUTHORIZABLE_MESSAGE = "No Authorizable with ID %s";

    public static Authorizable getAuthorizable(final UserManager userManager, final String id) throws WorkflowException {
        try {
            Authorizable authorizable = userManager.getAuthorizable(id);
            if (authorizable == null) {
                throw new WorkflowException(String.format(DEFAULT_NO_AUTHORIZABLE_MESSAGE, authorizable));
            }

 

 

There's a participant step in your workflow model that has reference to some authorizableId that does not exist on your 6.4 instance .. 

Feel free to log a Daycare ticket to take this any further but that's what it seems like.  

 

                            if (node.getType().equals(WorkflowNodeImpl.TYPE_PARTICIPANT)) {
                                String participant = node.getMetaDataMap().get(WorkflowNodeImpl.TYPE_PARTICIPANT, String.class);
                                Authorizable authorizable = SecurityUtil.getAuthorizable(userManager, participant);
                                expand(authorizable, expandedRoutes, route, transition, node);
                            }

Answers (0)