Skip to content

Workflow Commons - New WorkflowEndedUserTask + OQL View approach #9506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: development
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ You can find the following pages in Workflow Commons:
* **MyInitiatedWorkflows** – This page gives end-users an overview of all their initiated workflows. They can view the current state, task timeline and can withdraw workflows that are in progress, paused, or incompatible.
* **TaskDashboard** – This page gives end-users an overview of their performance. It contains such information as the number of completed tasks, average time spent to complete a task, and percentage of completed tasks within a deadline.
* **TaskInbox** – This page contains a list of all tasks that a user can interact with. **My open tasks** shows the tasks assigned to current users, **All open tasks** is a list of tasks they could pick up and **Unassigned tasks** shows all unassigned tasks.
* **WorkflowAdminCenter** – A navigational page for workflow administrators. From here, a workflow administrator can go the **Workflow Dashboard**, which gives them general statistics of workflows. Workflow administrators also gain access to **Workflow management**, where they can see all the instances of specific workflows and make changes to their data or even abort workflows.
* **WorkflowAdminCenter** – A navigational page for workflow administrators. From here, a workflow administrator can go the **Workflow dashboard**, which gives them general statistics of workflows. Workflow administrators also gain access to **Workflow management**, where they can see all the instances of specific workflows and make changes to their data or even abort workflows. Additionally, the Workflow administrator can monitor audit records by accessing the **Workflow audit trail**, and manage assignments and user targeting via the **Manage task assignments** page from here.
* **WorkflowDashboard** – This page gives you workflow/task based metrics and direct access to all *Workflow* and *WorkflowUserTask* data. When you want to use the Workflow Dashboard as your only admin go-to page, add this to the navigation instead of the **WorkflowAdminCenter**.
* **TaskAssignment** – This page allows the workflow administrator to manage the assignment and targeting of user tasks based on a selected user. This is typically done when a user is leaving the organization or their current role. Thus, all tasks that user is working on must be unassigned from that user or assigned to another user. On the page, first select the user whose tasks should be listed. Then, use the following tabs to reassign the user's tasks based on their involvement:
* **Assigned tasks** – Shows a list of tasks assigned to the selected user (possible actions are reassigning and unassigning the corresponding tasks).
Expand Down Expand Up @@ -110,11 +110,36 @@ You can find the following microflows in Workflow Commons:
2. Views personal performance in the **Task Dashboard**.
3. Views workflow progress in the **My Initiated Workflows** overview.
3. Make sure the correct user entity is set in the **App Settings**: open **App Settings** > **Workflows** tab and set **User entity** to *Administration.Account*.
4. For Workflow Commons v2.1.0 and above, you need to configure the state change microflows in the **App Settings**: open **App Settings** > **Workflows** tab to configure the following state change microflows:
4. For Workflow Commons v2.1.0 up to (but not including) v4.0.0, you need to configure the state change microflows in the **App Settings**: open **App Settings** > **Workflows** tab to configure the following state change microflows:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yiyun333 Now there is a single page for all version of WFC combined with all version of MX and it's very confusing. Version numbers are everywhere. With MX 11 there will be a new WFC module that only works with Mx 11 (and up). Can't we have a WFC page that does not mentioned any previous (prior to MX 11) Mx and WFC version other than: "if you want to upgrade WFC from Mx 10 to 11 click here"?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not just here, but also further down.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PaulJongenMx Sorry, I've missed this message.

Can't we have a WFC page that does not mentioned any previous (prior to MX 11) Mx and WFC version other than: "if you want to upgrade WFC from Mx 10 to 11 click here"?

Could you clarify this a bit more? Since we don't have a versioned Workflow Commons page (like our refguide and how-tos), I think it's still valuable to keep the version information. But indeed we need to structure the information better. I am not exactly sure what you mean by the above comment though. Please explain further. Thanks!

1. Set **Workflow state change** to *OCh_Workflow_State*
2. Set **User task state change** to *OCh_WorkflowUserTask_State*

{{% alert color="info" %}}
For version 4.0 and above, this step is no longer required.
{{% /alert %}}

5. For Workflow Commons v3.10.0 and above, we introduced the `DueDateExpirationInDays` constant to configure the period in days for which the workflows/user tasks are to be considered almost due with visual indicators in pages **Task Inbox**, **Task Dashboard**, **Default Workflow Admin** and **Workflow Definition View**. The default value is set to 2 days. You should set the value based on your business needs.

### Upgrading from Mendix 10 to Mendix 11

This section explains the required steps when upgrading an existing app that is using Workflow Commons from Mendix 10 to Mendix 11. With the removal of state-change events in Mendix 11, it is required to upgrade Workflow Commons to version 4.0.0 or higher. In addition, it is required to perform a one-off migration for your existing data.

Starting with version 4.0.0, Workflow Commons uses the new [View Entities](https://docs.mendix.com/refguide/view-entities) feature for unified access to user tasks, regardless of whether these tasks are in progress or completed. The WorkflowUserTaskView view entity combines objects from System.WorkflowUserTask and System.WorkflowEndedUserTask into a single view. This removes the need for the custom entities (WorkflowView and UserTaskView) that used to be part of Workflow Commons in versions below v4.0.0, that were kept up to date using state-change events.

Starting with Mendix 11, ended user tasks are now stored in the WorkflowEndedUserTask entity in the System module. In order to preserve existing data, it is important to migrate information on ended user tasks from WorkflowCommons.UserTaskView objects into System.WorkflowEndedUserTask objects. A migration microflow is shipped with Workflow Commons v4.0.0 to help you perform this task.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... ended user tasks (with state Aborted, Completed) ...


To perform the migration, follow the steps below:

1. After upgrading your project to Mendix 11, download Workflow Commons v4.0.0 from the marketplace.

2. In the runtime settings of your app, configure the ASU_UserTaskView_Migrate microflow for the after startup property. If there is already an after startup microflow set, add the ASU_UserTaskView_Migrate microflow as an action to the existing microflow.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a note somewhere that in case of any modifications to WFC by the developer, they should check if the migration MF should be modified as well to result in the desired migration of data.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about a note that in case a lot of ...view entity records need to be migrated, the initial startup of the app may take some time

3. Alternatively, you can manually start the migration by clicking the "Migrate UserTaskView object(s) to WorkflowEndedUserTask entity" button which is available on the Workflow Admin Center page, or use the ACT_UserTaskView_Migrate microflow in your project.

{{% alert color="info" %}}
As a result of upgrading to Mendix 11, the pages, microflows, and snippets that previously used the `WorkflowCommons.UserTaskView` entity have either been removed from the WorkflowCommons module or replaced with documents that uses `WorkflowCommons.WorkflowUserTaskView` or `System.WorkflowEndedUserTask` as a parameter. For a full list, refer to the release notes of v4.0.0 of the Workflow Commons module.
{{% /alert %}}

## Workflow Audit Trail

{{% alert color="info" %}}
Expand Down