Expand my Community achievements bar.

SOLVED

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

Avatar

Level 1

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]

1 Accepted Solution

Avatar

Correct answer by
Employee

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

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

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

Avatar

Level 1

Thanks aemmarc

We have logged a ticket and it seems to be a issue in vanilla instance also. Waiting for a reply from the adobe ticket