Advanced workflows
Copyright 2008-2012 ManyDesigns srl. All rights reserved.
Contents
Introduction
ManyDesigns Portofino supports three features (guards, actions, and notifications) which are all related to workflow transitions.To use them, make sure you have defined a workflow with a certain number of states and transitions. Then visit the workflow attribute's details page and click on the Operations button.
A page will appear containing:
- in the upper part, a summary of the class' actors.
- in the lower part, a matrix.
The rows of the matrix contain three sections for guards, actions, and notifications.
At the intersections of the rows with the columns are a number of checkboxes that you can use to configure these advanced features.
Guards
Guards are boolean attributes that enable (if true) or disable (if false) a workflow transition on an object.
In the guards section, the system offers all the boolean attribute of the class. Select the combinations of guard/transition that you want to associate.
Actions
Before you can you this section, you must create at least one workflow action. Click on the Workflow actions tab, then on create. You are given the choice of creating either a Java workflow action or a Script workflow action. Both address the same purpose and functionality. What is different is the implementation: while the former needs a externally-complied Java class, the latter allows you to edit aBeanShell script directly in Portofino.
A Java workflow action has the following fields:
- Name: the action's name.
- Java class: the full name of the Java class implementing thecom.manydesigns.portofino.base.workflow.WfActionAPI interface. The class must be available in the classpath.
A Script workflow action has the following fields:
- Name: the action's name.
- Script: the text of the BeanShell script.
Once you have a number of workflow actions in place, you can return to the workflow operations page.
In the actions section, the system offers all the workflow actions you have defined. Select the combinations of action/transition that you want to associate.
The system is instructed that, when a transition is executed, also the associated actions are executed.
Notifications
You can instruct Portofino to notify certain users by email when a transition is executed on an object.
Make sure the following properties are configured in the portofino-custom.properties
file:
-
mail.smtp.host
: the address of an SMTP server. -
model.workflow.notifications.sender
: the email account that appears as the sender of workflow notifications.
Then, in the workflow operations page, check that you have at least one actor defined. If you don't have any, use the Add actors button and proceed as discussed for permissions.
Finally, in the notifications section, select the combinations of actor/transition that you want to associate.
Previous: Constraints
Next: Portals and portlets