Alternative management of web content pending in a workflow blocked by another user
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
legacy-article
learn-legacy-article-disclaimer-text
Issue
- This article addresses the need to manage a workflow for web content that is in a pending state and is also in an intermediate task of the workflow, associated with a person or left undetermined. An alternative is provided for administrators to manage the workflow.
Resolution
- First, it should be noted that there is no way to advance the workflow and approve the content through the interface (unless the responsible user completes the pending task). However, an alternative is provided to address the case and attempt to approve the content.
- Below, we address a specific case of content where, using the Headless API, it is possible to determine its current state (task and status) and outline the steps to approve it without depending on the person responsible for that task, provided you are an administrator.
- Retrieve the workflow task associated with the content by executing the following database query:
SELECT workflowInstanceId FROM workflowinstancelink WHERE classPK IN (SELECT id_ FROM journalarticle WHERE articleId= "xxxx")
Here, xxxx is the articleId displayed in the administration panel for the pending content.
- Determine the task where the approval flow is currently located. To do this, access the Headless APIs in the
headless-admin-workflow module. In the WorkflowLog section, execute the following request:
GET /v1.0/workflow-instances/{workflowInstanceId}/workflow-logs
You only need to provide the workflowInstanceId obtained in the previous step.
- The response will display who is assigned to the workflow and the ID of the task, in the field
workflowTaskId.
- Using the previously obtained workflowTaskId, navigate to the WorkflowTask section within the Headless APIs under
headless-admin-workflow. Depending on the scenario:
-
Reassign to an Administrator Role. Use the following endpoint to assign the task to an Administrator role
POST /v1.0/workflow-tasks/{workflowTaskId}/assign-to-role
-
Assign to Yourself. If the user is already part of the role assigned to the task, use this endpoint to assign the task to yourself:
POST /v1.0/workflow-tasks/{workflowTaskId}/assign-to-me
- After that, you can continue the workflow as usual, but with the administrator as the person in charge.
-
did-this-article-resolve-your-issue