Task state no longer visible in the task details in 7.4

Issue

  • While migrating fragment on the Workflow Task Portlet, we realized that some of the fields that were shown in the task details (edit_workflow_task.jsp) in DXP 7.0 are no longer available in DXP 7.4 u59. The 'state' value is no longer there and the API to get that value in the back end is no longer available too.

  • As states are still available in the workflow definitions, we are wondering why that field was removed. This way the user is no longer able to distinguish, in the task details, if the task has been approved or not.

Environment

  • DXP 7.4

Resolution

  • It is possible to check the true status of a workflow task doing the following:
    1. Navigate to Global Menu > Applications >  (Workflow) Submissions
    2. Or navigate to the User Profile Menu > My Submissions
  • Liferay has removed the endpoint com.liferay.portal.workflow.task.web.internal.display.context.WorkflowTaskDisplayContext.getState(WorkflowTask) API  because it did not make sense to select a task and display a name of another one.
  • This method was deprecated in Task display context because an instance can have more than one node as the current if the process builder is using a fork-join structure.

To get current nodes, it is possible to get it through the workflow instance's endpoint:

/headless-admin-workflow/v1.0/workflow-instances
Response:

{
  "items": [
    {
...
      "completed": false,
      "currentNodeNames": [
        "review"
      ],
      "dateCreated": "2023-03-31T18:27:12Z",
      "id": 89054,
      "objectReviewed": {
        "assetTitle": "Blog 1",
        "assetType": "Blogs Entry",
        "id": 89049,
        "resourceType": "BlogPosting"
      },
      "workflowDefinitionName": "Single Approver",
      "workflowDefinitionVersion": "1"
    }
  ],
...
}

 

Or get it in the Java code:

WorkflowInstanceLink workflowInstanceLink = getWorkflowInstanceLink(companyId, groupId, className, classPK);
WorkflowInstance workflowInstance =
  WorkflowInstanceManagerUtil.getWorkflowInstance(companyId, workflowInstanceLink.getWorkflowInstanceId());
List<WorkflowNode> currentWorkflowNodes = workflowInstance.getCurrentWorkflowNodes();

 

This makes the state (the current node names of an instance) available only to the user who submitted the task and to the portal administrators. If there is a reviewer, the proper way to check it is: 

  1. Configure the role (define the necessary permissions) to be able to reach the following path: Control Panel > Workflow > Submissions > The column "Status"

For a user that has submitted the entry to review it will be possible to see this information in My Submissions in the columns "Status".

To access the Workflow Metrics you can go to: Control Panel > Workflow > Metrics > Definition Name (Single Approver for example) > Dash Board > Total Pending > "Kebab menu" > Track Workflow

 

这篇文章有帮助吗?
0 人中有 0 人觉得有帮助