Access and delete user data

You can access and delete user data from a workflow instance in the repository. To achieve this, you must know the instance ID of the workflow instance associated with the user. You can find instance ID of a workflow instance by using the user name of the user who initiated the workflow instance or who is the current assignee of the workflow instance.

However, you cannot identify or the results may be ambiguous when identifying workflows associated with an initiator in the following scenarios:

  • Workflow triggered through a watched folder: A workflow instance cannot be identified using its initiator if the workflow is triggered by a watched folder. In this case, the user information is encoded in the stored data.
  • Workflow initiated from publish AEM instance: All workflow instances are created using a service user when adaptive forms, interactive communications, or letters are submitted from AEM publish instance. In these cases, the user name of the logged-in user is not captured in the workflow instance data.

Access user data

To identify and access user data stored for a workflow instance, perform the following steps:

  1. On AEM author instance, go to https://'[server]:[port]'/crx/de and navigate to Tools > Query.

    Select SQL2 from the Type drop-down.

  2. Depending on the available information, execute one of the following queries:

    • Execute the following if the workflow initiator is known:

    SELECT * FROM [cq:Workflow] AS s WHERE ISDESCENDANTNODE([path-to-workflow-instances]) and s.[initiator]='*initiator-ID*'

    • Execute the following if the user whose data you are finding is the current workflow assignee:

    SELECT * FROM [cq:WorkItem] AS s WHERE ISDESCENDANTNODE([path-to-workflow-instances]) and s.[assignee]='*assignee-id*'

    The query returns the location of all workflow instances for the specified workflow initiator or the current workflow assignee.

    For example, the following query returns two workflow instances path from the /var/workflow/instances node whose workflow initiator is srose.

    workflow-instance

  3. Go to a workflow instance path returned by the query. The status property displays the current status of the workflow instance.

    status

  4. In the workflow instance node, navigate to data/payload/. The path property stores the path to the payload for the workflow instance. You can navigate to the path to access data stored in the payload.

    payload-path

  5. Navigate to the locations for drafts and history for the workflow instance.

    For example:

    /var/fd/dashboard/instances/server0/2018-04-09/_var_workflow_instances_server0_2018-04-09_basicmodel_54/draft/

    /var/fd/dashboard/instances/server0/2018-04-09/_var_workflow_instances_server0_2018-04-09_basicmodel_54/history/

  6. Repeat steps 3 - 5 for all workflow instances returned by the query in step 2.

    NOTE
    AEM Forms app also stores data in offline mode. It is possible that data for a workflow instance is locally stored on individual devices and gets submitted to the Forms server when the app synchronizes with the server.

Delete user data

You must be an AEM administrator to delete user data from workflow instances by performing the following steps:

  1. Follow the instructions in Access user data and take note of the following:

    • Paths to workflow instances associated with the user
    • Status of the workflow instances
    • Paths to payloads for the workflow instances
    • Paths to drafts and history for the workflow instances
  2. Perform this step for workflow instances in RUNNING, SUSPENDED, or STALE status:

    1. Go to https://'[server]:[port]'/aem/start.html and log in with administrator credentials.

    2. Navigate to Tools > Workflow> Instances.

    3. Select relevant workflow instances for the user and select Terminate to terminate running instances.

      For more information about working with workflow instances, see Administering Workflow Instances.

  3. Go to CRXDE Lite console, navigate to the payload path for a workflow instance, and delete the payload node.

  4. Navigate to the drafts path for a workflow instance, and delete the draft node.

  5. Navigate to the history path for a workflow instance, and delete the history node.

  6. Navigate to the workflow instance path for a workflow instance, and delete the [workflow-instance-ID] node for the workflow.

    NOTE
    Deleting the workflow instance node will remove the workflow instance for all workflow participants.
  7. Repeat steps 2 - 6 for all workflow instances identified for a user.

  8. Identify and delete offline draft and submission data from AEM Forms app outbox of workflow participants to avoid any submission to the server.

You can also use APIs to access and remove nodes and properties. See the following docs for more information.

Experience Manager


Espressos & Experience Manager: AEM Forms

Espressos & Experience Manager

Thursday, Mar 6, 7:00 PM UTC

Join Adobe's AEM product team as they highlight AEM Forms' latest innovations, including: the new Gen AI Assistant, Unified Composition with AEM Sites, and new ways to deploy forms through conversations.

Register

Rapid Feature Releases with AEM Cloud: Telegraph Media Group’s RDE Strategy

Online | Session | Intermediate

Hear how Telegraph Media Group, the award-winning publisher of The Daily Telegraph, The Sunday Telegraph, The Telegraph Magazine,...

Wed, Mar 19, 3:30 PM PDT (10:30 PM UTC)

Register

Put the Customer at the Center and Build Relationships That Last a Lifetime

Online | Strategy Keynote | General Audience

First impressions last a lifetime. Great first impressions feel personal, connected, and relevant right from the start. From the first...

Wed, Mar 19, 2:30 PM PDT (9:30 PM UTC)

Register

Connect with Experience League at Summit!

Get front-row access to top sessions, hands-on activities, and networking—wherever you are!

Learn more