Managing Workflows
With the workflow framework, Users manage asset publication in custom-built workflow processes. Users with permission to access workflow process definitions in the Control Panel can upload new workflow definitions, edit existing definitions, and delete definitions for processes no longer in use.
Workflow Definition Publication Permissions
As of DXP 2024.Q3, scripting is disabled by default. You can enable it in System Settings → Script Management (under the Security category).
Users with permission to edit or publish workflow definitions can add Groovy scripts to the workflow. Access to the scripting engine means access to the server’s Java Virtual Machine (JVM). Users with permission to publish (or edit) can therefore access any data within the reach of the JVM, such as data contained in a separate Virtual Instance of Liferay DXP.
Because of this far-reaching access, permission to create or edit workflow definitions is limited to Regular Administrators of the Default Virtual Instance. For Liferay DXP customers, Users (e.g., Site Administrators) can also edit and publish workflows with their access to the Kaleo Designer and Kaleo Forms Admin applications.
To grant Users with these Roles the workflow publication access in additional Virtual Instances,
- Make sure you understand the access you’re granting these administrators.
- Navigate to Control Panel → System Settings → Workflow → Workflow Definition.
- Check the box for the setting Allow Administrators to Publish and Edit Workflows.
This only applies to Virtual Instances that have been added to the system. The Default Virtual Instance provides out of the box workflow publication access to Regular Administrators, via Control Panel → Workflow → Process Builder and for Liferay DXP subscribers via the Kaleo Forms Admin application.
Uploading a New Workflow Definition
Workflow process definitions can be built in Liferay or uploaded in XML
format. DXP workflow definitions are written in XML
format; see the Introduction to Crafting XML Workflow Definitions to learn more.
To upload a new definition:
-
Navigate to the Control Panel → Workflow → Process Builder.
-
Click the New Workflow button (
).
-
If you have a local XML definition file based on an embedded workflow, you can upload it to DXP. Click the Source tab.
-
Enter a name for the new definition.
-
Copy the content of the XML file and and overwrite the sample code or click “import a file” to upload the file.
-
Click the Save button.
-
Click the Publish button.
The newly added definition is ready to be used as a workflow process.
Task Assignee Notifications and Site Membership
Liferay DXP 2024.Q3+/Portal 7.4 GA132+
When workflow tasks are assigned to site roles and assignees are notified, role users in parent sites are notified along with child site role users. In some situations, this can lead to parent site members receiving notifications for workflow tasks they cannot resolve, because they are not members of the child site. You can make notifications follow Liferay’s site permission inheritance and only notify site roles with explicit access to the content and site in question:
-
Navigate to Control Panel → System Settings → Workflow → Workflow Definition.
-
Check the box for the setting Notifications must honor site membership rules.
Editing a Workflow Definition
-
Navigate to the Control Panel → Workflow → Process Builder.
-
Click the Actions button (
) for the workflow then Edit.
Changes to Workflow Definitions are tracked in the Details and Revision History menus.
Viewing and Restoring Workflow Revisions
To view the workflow definition details and the revision history:
-
Click the Information button (
)
-
Next to a previous version on the Revision History tab, click the Actions button (
) and select either Preview or Restore.
-
When you click Restore and see the success message, the prior version is the current version of the workflow. You can now edit the restored version of the workflow.
-
If edits are necessary, edit and click Update. This creates another version of the workflow.
Deleting a Workflow Definition
There are two statuses for a workflow:
- Published: Validation is complete, and the workflow can be assigned to assets.
- Unpublished: Validation is not performed on the unpublished workflow, and it cannot be assigned to assets until it is published.
Only Unpublished workflows can be deleted.
Published workflow definitions cannot be deleted if they are current associated with an asset type. Users have to first deactivate the workflow process and then place the workflow in the Unpublished status.
-
To deactivate an asset type’s workflow, reverse the steps found in the Activating Workflow article for each asset type and select No Workflow.
-
Navigate to the Control Panel → Workflow → Process Builder.
-
Click the Actions button (
) for the workflow then Unpublish.
-
The selected definition is now in the Unpublished section. Click the Actions button (
) for the workflow then Delete.