The Activiti Designer 5.14.0 has been released recently and comes with a new component, called Activiti Kickstart.
The tool allows for easy creation of Activiti workflows used in Alfresco. Not only does it create the process-definitions, but it also takes care of the required content-models, forms and configuration to have a fully functional workflow in an Alfresco environment.
This blog-post will give an insight in the technical implementation of the tool as well as a quick overview of how to use it. The tool was first revealed and presented in November 2013, on the Alfresco Summit by Joram Barrez in Boston and by myself in Barcelona. These talks contain a live demo of the tool, covering a lot of the features that are available. The recordings of these talks are made available for anyone to watch, as is done with all the Summit talks:
- Boost Your Productivity with Next Gen BPM Tooling – Barcelona Summit (Youtube-link)
- Boost Your Productivity with Next Gen BPM Tooling – Boston Summit (Youtube-link)
When the Activiti project was started about 4 years ago. From that moment on, Activiti has been used as the component inside Alfresco, catering for all things workflow.
The Alfresco mechanism for connecting forms and properties with workflows could be leveraged in order to get a powerful way of defining both process flow and the human interaction with it. Although flexible, this approach involves multiple artifacts which cross-reference each other and need to be kept in sync. This process is error-prone and time-consuming.
We thought it was time to create more tooling around this, in order to take some of the pain away involved in creating Alfresco workflows. The initial idea was to create an app that was part of the Alfresco environment and ran in the browser, allowing users to model simple processes, without the need to know all nuts and blots involved in BPMN and content-modelling. The technical implementation was done, but the development of the web app has not yet started. We decided to make use of the technical implementation we had and release it rather sooner than later in the wild – with an Eclipse/Graphiti-based frontend instead. This does not mean that the Activiti Kickstart Elipse Plugin is just demo-ware or just a prototype, it’s a working tool and will be maintained in the future.
What does it do?
The tool contains 2 new editors: a process editor and a form editor.
The process-editor is really different from the existing BPMN editor that is already present in the Designer. It abstracts away the somewhat complex nature of BPMN-diagrams and goes for a sequential approach, laying out the steps top-down. This is easier to follow for people not familiar with BPMN notation. The number of available steps you can use is limited but cover a lot of the features needed for document-centric processes with a lot of human interaction, some decision making and email capabilities.
The form-editor allows you to add forms to certain steps (or create a start form, shown when the workflow is started). It allows you to drag/drop form-components and group them. It supports a lot of different input-types: text, numbers, boolean, value in a predefined list, alfresco user selection, content selection, dates, … It allows the user to group the form fields into groups using the layout that best for the type of input required.
Once the workflow steps and the forms are designed, the workflow is ready to be exported and used in Alfresco. When exporting a kickstart process, a number of artefacts is created for you:
- A BPMN, containing the process definition
- An Alfresco content model XML, containing the content types for all tasks in the
- An Alfresco form configuration, containing the appearance of the task-forms ant the task-form.
- A spring context file, which bootstraps the workflow and models in the repository.
- A custom Alfresco Surf configuration file to hook up the new forms.
When these artifacts are dropped in the right location in your Alfresco environment, you’ll be able to use them. On top of that, we made sure that the time it takes to deploy a kickstart workflow is reduced to the absolute minimum. By leveraging the dynamic workflow-deployment and model-deployment through CMIS (or data dictionary), no repository-reboots are needed. Also, with a bit of creativity, we made a share extension to be used in development only to reload the form-config without rebooting the share container (see the github project page for this
hack creative solution).
In case more advanced usacases are needed (and cannot be solved using a script-step), the generated artefacts can be used as a solid foundation to extend and refine to your specific needs. Ofcourse, converting back from the “complex” representation to the “simple” model is not possible. Doing incremental changes to existing “simple” models is definitely possible.
Below you see a screenshot of the workflow-editor, the form-editor and the full BPMN-representation of the exported process.
The “simple” model used to define steps and forms in a workflow are represented as a POJO-model with built-in conversion from and to a JSON-structure. This model is available in the activiti-simple-workflow module. This module is also responsible for generating the (Alfresco independent) BPMN-representation, based on this simple format.
To add the Alfresco-specific bits, an additional module is plugged in (activiti-simple-worklfow-alfresco) and takes care of generating the additional artefacts (content-model, forms) according to best-practices for workflow-related modelling.
Currently, the only fully functional implementation/usage of this simple model and conversion is the Alfresco-usecase. However, we envision an implementation (in the near future) that is Alfresco-agnostic an can generate workflows and forms to use in a pure Activiti-environment.
The Activiti designer plugin contains Graphiti-based editors that manipulate this simple model and allows calling the conversion and export. However, the conversion and creation of these artefacts can also be done using the activiti-simple-workflow-alfresco module, independent of the eclipse UI. The eclipse editors are just an easy way to construct this simple model.
As with all Activiti projects/modules, the sources are Apache 2.0 licensed and bug/requests can be logged though the usual channels (Activiti Jira, forum).
The current state of the Activiti Kickstart plugin is stable and offers a solid base for creating Alfresco workflows with zero XML-fiddling, without the requirement to know the details about content-modeling and form-rendering in Alfresco. Generated artefacts are also usable as a base for extending and work without any modifications to the Alfresco Repository itself (4.0+ compatibility, since this is the first version that included the Activiti engine).
I recommend watching one of the two talks which are linked in the beginning of this post, to get a good overview of what the tool can and cannot do for you. No doubt, the recording of Joram’s talk in Boston will be more amusing to listen to and watch than mine, due to his superior speaking skills and warm romantic voice