Updating the BPMN file

Updating the bpmn file

A UserTask in a bpmn file in its simplest form looks as follows:

    <userTask id="editUserTask" name="EDIT" activiti:candidateGroups="MANAGERS,USERS,USER">
      ...
    </userTask>

Here we specify:

  • the id of the task
  • the name of the task
  • the user roles (candidate groups) who may execute the task, which is managed by Activiti

To add a custom workflow action, add the following to your UserTask:

    <userTask id="editUserTask" name="EDIT" activiti:candidateGroups="MANAGERS,USERS,USER">
      <extensionElements>
        <activiti:formProperty id="workflowTaskActionBeans" type="enum">
          <activiti:value name="approveButtonWorkflowAction"/>
          <activiti:value name="rejectButtonWorkflowAction"/>
        </activiti:formProperty>
      </extensionElements>
    </userTask>

where

  • the formProperty id = workflowTaskActionBeans tells Atoti Limits that it should pick up the contents of this formProperty to resolve one or more Spring Beans.

    note

    The id must be workflowTaskActionBeans, otherwise Atoti Limits will not resolve the tasks.

  • the value’s name tells Atoti Limits the name of the Spring Bean it should resolve.

    note

    Take care when selecting the name of the Spring Bean. These must be unique for each action and every other Spring Bean in the application. A good naming convention is to prefix/suffix the bean with something unique to the type of bean, for example, ButtonWorkflowAction.

Now Atoti Limits can find the actions linked to each task. The next step is to define the actions as Spring Beans.