Documentation

Subscription

Using the workflow designer, users can configure Workflow Actions and notifications for each node.

Actions are very adaptable and you can specify when the Action occurs: before entering the node, after exiting a node, or once a task node is assigned. For example, when a reviewer rejects a Web Content article, a Workflow Action sets the asset’s status as Pending and automatically reassigns the article to the original author.

Workflow Notifications are sent to tell task assignees that the workflow needs attention or to update asset creators on the status of the process. They can be sent for tasks or any other type of node in the workflow.

However, not every node requires a Workflow Action or a notification. Generally, Start and End nodes do not have actions or notifications, unless you want to notify the original author that the review process has begun or ended.

In the Single Approver definition, the two Task nodes (Review and Update) have Actions and Notifications.

If you’re creating the Single Approver workflow definition, you must add a Reject Action to the Update Task node. This Reject Action contains a Groovy script which, when executed, sets the asset’s status as denied then pending.

1. Go to the Global menuApplicationsProcess Builder.

2. Click the Workflows tab.

3. Click on the Workflow definition (for example, Single Approver).

4. Click the Update node.

5. Click an existing action or New if there are none currently defined.

6. Enter reject in the Name field.

7. Select On Assignment from the Execution Type dropdown menu.

8. Enter the script in the Template (Groovy) field (it’s called the Script field in some versions). The Single Approver workflow contains an Update task with an action written in Groovy that sets the status of the asset as denied, then sets it to pending.

import com.liferay.portal.kernel.workflow.WorkflowConstants;
import com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil;



9. Click the back arrow () when finished (in some versions you must click Save in the action definition).

Next add a notification that informs the asset creator that the submission has been rejected at this time and needs more work.

Add notifications to the Update Task node which informs the asset creator that the submission needs more work and has been reassigned back to him.

1. In the Update node’s properties sidebar, click an existing notification or New if none are defined yet.

1. Enter the following:

• Description: Enter a description for this notification

2. Select Freemarker from the Template Language dropdown menu.

3. Enter a message in the Template field:

• Your submission was rejected by \${userName}, please modify and resubmit.

• Email