Activiti Workflow Config - tsgrp/hpi GitHub Wiki

This page describes how to add and configure Activiti Workflows in OCMS. Note that this page does not describe how to configure and utilize Active Wizard workflows, which also use Activiti.

Activiti BPMN Template

Before adding your workflow to OCMS, you must create the BPMN template using Activiti Designer, an eclipse plugin. Ensure that the .bpmn file is placed in the correct place within OpenContent:

  • AMP Deployment (Alfresco) - .bpmn file should end up in alfresco\WEB-INF\classes\alfresco\module\com.tsgrp.opencontent\workflow
  • WAR Deployment (Non-Alfresco) - .bpmn file should end up in OpenContent/WEB-INF/classes

Make sure to also add the .bpmn entries into the appropriate OC configuration XML file. Typically these are located in either hpi-activiti-bean-config.xml or wizard-bean-config.xml. Which file is included may differ based on your particular OC build.

Upon startup, when any new Activiti Templates are recognized on the classpath, Activiti will auto-deploy the template. Note that upon subsequent startups of OpenContent, the templates are not redeployed. If you would like to update a template, you must set the following property in OC (typically in external properties):

activiti.template.force.redeploy=true

After redeploying your template, be sure to flip this flag back to false to prevent the templates from redeploying every time OC is started

Configuring Activiti Workflows in OCMS

After deploying your template, you must configure the template in OCMS. Here are the steps you should follow:

  1. Create any needed workflow forms in Workflow Form Config for any steps in the workflow (typically start workflow, any steps in the process that need user input, and delegate task
  2. Add your workflow template to Workflow Config, configuring forms in each step as appropriate
  3. Add the appropriate doc actions (ex: start workflow, complete task, abort, delegate) in your trac

Workflow Form Variables

Workflow forms contain a few out of the box variables. However, you can configure any variable you like. All variables are placed on the Activiti Context for your workflow and are visible both in listener code as well as condition expressions in your .bpmn template.

Out of the box attributes include:

Variable Name Pretty Name Description
bpm_assignees Assignees The user assignee(s) for a task
bpm_groupAssignee Group Assignee The group assignee for a task
bpm_reviewOutcome Review Outcome Variable that can be used in expressions to determine which task to route to next or end the workflow
bpm_workflowDueDate Workflow Due Date Variable that can be used in expressions to perform behavior relative to a due date
bpm_comment Comment Comment field that can be used in listener code for audit purposes, or can simply be imported forward on future task forms

Notes

  • When setting up picklists for user and group assignee(s), ensure that the input value is the user ID or group ID as appropriate.
  • When a task is encountered or the workflow is started, ensure that at least one user or group assignee is set. This can be done through forms as described above, directly in Activiti Configuration, or by listener code on your template.
  • Out of the box, the comment and due date fields are information-only. Your Activiti configuration and/or listener code can utilize these in different ways as you wish.