Expand my Community achievements bar.

SOLVED

Workflow gives NullPointerException on page move

Avatar

Level 2

Hi,
When moving pages in AEM as a Cloud Service, admin users can move without any workflow, but other users (with full permissions) trigger the "Request to Complete Move Operation" workflow, which fails with:

java.lang.NullPointerException

Permissions provided: read, write, modify, delete, replicate.

Why does the workflow trigger only for non-admins, and what could cause this NPE?
How can we prevent the workflow from triggering for fully privileged users?

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @SanaQu,

Try to grant jcr:read access to:

/conf/global/settings/workflow/models
/var/workflow/models
/var/workflow/instances
/var/workflow/packages

OR

You can disable the workflow from triggering for page move

  1. Go to:
    Tools -> Workflow -> Launchers

  2. Find: Request for Move Operation

  3. Disable it or add a condition to bypass certain groups.

Or I would reccomend: 

Instead of giving workflow access, create a rule to bypass workflow if the user belongs to an "AEM Content Admin" group using a launcher condition, e.g.:

not (user.memberOf("content-admin-group"))

This prevents workflow execution for trusted users and avoids the NPE.


Santosh Sai

AEM BlogsLinkedIn


View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi @SanaQu,

Try to grant jcr:read access to:

/conf/global/settings/workflow/models
/var/workflow/models
/var/workflow/instances
/var/workflow/packages

OR

You can disable the workflow from triggering for page move

  1. Go to:
    Tools -> Workflow -> Launchers

  2. Find: Request for Move Operation

  3. Disable it or add a condition to bypass certain groups.

Or I would reccomend: 

Instead of giving workflow access, create a rule to bypass workflow if the user belongs to an "AEM Content Admin" group using a launcher condition, e.g.:

not (user.memberOf("content-admin-group"))

This prevents workflow execution for trusted users and avoids the NPE.


Santosh Sai

AEM BlogsLinkedIn


Avatar

Employee Advisor

Hello @SanaQu ,

 

When moving pages  non-admin users - even with full rights (read, write, modify, delete, replicate) - may trigger the “Request to Complete Move Operation” workflow, whereas admin users do not. This is by design.

Why does the workflow trigger only for non-admin users?

  • The workflow is invoked when the user does not have replication (replicate) permission on the relevant path. Admin users inherently have this permission; other users or groups may need it granted explicitly on all necessary paths (including parent folders if references exist).
    Reference:
    https://experienceleague.adobe.com/en/docs/experience-cloud-kcs/kbarticles/ka-23690

  • What causes the workflow’s NullPointerException (NPE)?

Recent product issues (ASSETS) show that the workflow could trigger for unpublished pages/assets or in edge cases, then fail with a NullPointerException due to missing expected objects. 

  • How can we prevent the workflow for fully-privileged users?
  1. Explicitly grant the user or group “replicate” permission on the relevant path and all referenced subpaths.
  2. After this, non-admin users will be able to move content directly, and the workflow should not trigger.

Avatar

Level 10

Since the workflow does not trigger for you (as the environment admin) but does work for other users in the admin group, the most likely explanation is that, as the admin, you have access to AEM Workflow, JCR privileges, and OSGi configuration. However, your custom group does not have full workflow execution rights.

To resolve this issue, grant your admin group the following permissions:

1) Paths /conf/global/settings/workflow/models/request_to_complete_move_operation or /conf/global/settings/workflow/models:

  • jcr:read
  • jcr:write
  • crx:replicate

2) Path /var/workflow:

  • jcr:read

  • jcr:write

  • jcr:modifyProperties

  • crx:replicate

3) Add those users to the groups:

  • workflow-users
  • workflow-administrators