Workflows

How Can I Add Workflows to My App?

Both trained developers and tech-savvy business users can capture processes into workflows.

Developers can use the full power of Mendix Studio Pro to model the ins and outs of any process in the highest level of detail, apply advanced logic, integrate with any system, and create reusable workflow artifacts.

With Mendix, the process definition becomes part of the app. This increases maintainability. It also means that developers can work with different apps easier, as it becomes easy to understand the overarching logic in each app. This reduces the cost and time involved to switch contexts considerably.

Moreover, since the process is defined explicitly and visually, you can leverage the review capabilities of the Mendix Platform to involve business-minded users in the development process of advanced workflow logic, which significantly shortens the feedback loop.

Who Can Build Workflows?

In essence, workflows consist of user tasks (human tasks) and system tasks.

User tasks require user interaction: end users will see pages that contain the information they need to complete the task. These pages are regular Mendix pages that can be edited in the page editor of Studio Pro, hence have the full configuration flexibility of any page in Mendix.

System tasks call a microflow. They do not require user interaction.

Other workflow elements include the following:

  • Gateways to split the flow in multiple branches, allowing you to split the flow in several paths using exclusive behavior (decision) or parallel behavior (parallel split). The decision action makes a decision based on a condition and follows one and only one of the outgoing paths. The parallel split adds two or more parallel paths to your workflow.
  • A Jump element which allows you to proceed directly to one of the workflow steps on the workflow path. For instance, you can jump back in the process to redo the tasks on the path again or skip a number of downstream tasks.
  • A start activity and one or more end activities.
  • Reusable elements that developers can add to the workflow editor toolbox themselves, by exposing microflows as workflow actions.

For more information, see the How can I reuse workflow logic and content section below.

How Can I Trigger a Workflow?

Long-lived business processes imply the need for migration in case of workflow changes. The default behavior in the runtime is that running instances will be upgraded to the new workflow definition, or marked as ‘conflicting’ if auto-upgrading is not possible. The process administrator role then needs to deal with those. A developer can clone a workflow, effectively creating a new version, if it is desired to keep running instances following the old definition.

For more information, see Updating Your Workflow Definition in the Mendix Studio Pro Guide.

Which Workflow Actions Are Available?

Security is handled using the existing Mendix security model. For instance, only specified roles can start a workflow, can see it in the task inbox, have access to the underlying data and can complete the task using one of the task outcomes. This provides the developer with the granularity to effectively model workflow security. For more information, see Security Model.

How Can a Process Administrator Handle In-Flight Processes?

In every Mendix app, each workflow stores its execution data in a standard, publicly accessible format that is part of the System module. This means, that developers can extract the data into a central repository or reporting service (such as Business Intelligence tooling) to get an enterprise view on workflows in the company, for both active and completed workflow instances.

How Do Changes in the Workflow Definition Affect Running Processes?

Long-lived business processes imply the need for migration in case of workflow changes. The default behavior in the runtime is that running instances will be upgraded to the new workflow definition, or marked as ‘conflicting’ if auto-upgrading is not possible. The process administrator role then needs to deal with those. A developer can clone a workflow, effectively creating a new version, if it is desired to keep running instances following the old definition.

For more information, see Updating Your Workflow Definition in the Mendix Studio Pro Guide.

How Do I Assign Tasks to Potential Users?

User tasks need to be targeted at users, meaning the potential set of users that could pick up the task. Developers have complete control over modeling this group of users by using XPath or by implementing more flexible and advanced logic using a microflow per user task.

Moreover, each user task provides the OnCreated property that enables the developer to implement delegation policies using microflows. Escalation can also be modeled, using existing Mendix constructs.

User Assignment Example

How Can I Configure Workflow Security?

Security is handled using the existing Mendix security model. For instance, only specified roles can start a workflow, can see it in the task inbox, have access to the underlying data and can complete the task using one of the task outcomes. This provides the developer with the granularity to effectively model workflow security. For more information, see Security Model.

How Can I Reuse Workflow Logic and Content?

Mendix gives the developer full control to build reusable workflow artefacts. For initial speed, Mendix comes with a fully-functional Workflow Commons module that contains preconfigured process management screens, dashboards, and a generic inbox screen. Workflow Commons also contains other preconfigured documents, such as snippets, page templates, and microflows.

Installing this module is not required for workflow capabilities to be enabled.  However, it does simplify a developer’s work so that they can benefit from out-of-box functionality. All of the content is customizable and can be replaced by a module or implementation of your choice.

Moreover, developers can add reusable elements to the workflow editor toolbox by exposing microflows as workflow actions. These can also be imported via modules containing exposed microflows from the Marketplace and other repositories.

In this way, company best practices can be shared with anyone in the company wanting to build workflows, both business minded users as well as other professional developers on the team.

How Can I Reuse Workflow Logic and Content?

In every Mendix app, each workflow stores its execution data in a standard, publicly accessible format that is part of the System module. This means, that developers can extract the data into a central repository or reporting service (such as Business Intelligence tooling) to get an enterprise view on workflows in the company, for both active and completed workflow instances.