History: GalaxiaConcepts
Preview of version: 12
An open-source Workflow engine for Tiki.
Table of contents
Introduction and concepts
Galaxia is an "activity based" workflow. Workflow processes are implemented as a set of activities that must be completed to achieve some result. In Galaxia activities are represented as PHP scripts. Galaxia provides 3 big modules called: "Process Manager", "Process Controller" and "Workflow".
Definitions
Process
A process is defined as a set of activities that must be done to achieve some goal. Business circuits are mapped to processes to automate them. Process activities are connected using transitions defining what has to be done after each activity is completed.
Activity
An activity is something that has to be done as a part of a process. In Galaxia activities are mapped to PHP scripts so an activity can do anything that can be done from a PHP script. Role: Activities are asocited to roles defining who can perform activities. Roles are defined at a per-process level.
Instance
An instance is a process being executed. An instance is created when a process is started and the instance passes through the process activities until the process is terminated.
Workitem
When an activity is completed a workitem is added to the instance. Workitems thus represent completed activities.
Activity types
Galaxia defines seven basic activity types that can be used to design a process:
Galaxia activity types:
- Start
- End
- Activity
- Switch
- Split
- Join
- Standalone
Start activities
Start activities are represented using a circle. Every process must have at least one start activity. Start is the only activity type that can be executed without the presence of an inta nce in the activity because instances are created when a start activity is executed. Processes with many start activities are very strange but possible in Galaxia. No transitions can lead to a start activity and only one outgoing transition is allowed per each start activity.
End activities
The end activity represents the end of a process. When an instance reaches the end activity the process is considered completed. Process must have exactly one end activity. This doesn’t mean that processes can’t end in different ways since the end activity represents only that the process ends, how the process ends depends on the activities visited before the end activity. The end activity is represented in Galaxia using a double circle. The end activity can have many inbound transitions. Outbound transitions are not allowed.
Normal activities
Normal activities don’t have any special meaning so they are used to represent things that should be done as a part of a process. A rectangle is used to represent these activities. Normal activities can receive many inbound transitions but can only have one outbound transition.
Switch activities
A switch activity represents a point of decision in a process. Instances reaching a switch activity are evluated and depending on some conditions the instance can be routed to different activities. Then switch activities can have many inbound transitions and many outbound transitions. Switch activities are represented using a diamond.
Split activities
Sometimes two or more activities in a process can be done independantely in paralell. A split activity is used to split the an instance routing the same instance to many activities. Then it is true that an instance can be in many activities at the same time. Split activities represent subflows in a workflow. A split activity can receive many inbound transitions and can have many outbound transitions. Split activities are presented by a triangle.
Join activities
A join activity is used to re-group instances splitted from a split activity. When an instance reaches a join activity the engine verifies if the instance is present also in some other activity if so the instance must wait in the join activity until all the copies of the instance reach the join activity. Once all the instance copies reach the join activity the instance can be directed to the next activity. Join activities can have many inbound transitions (more than one is expected) and can only have one outbound activities. Jion activities are represented using an inverted triangle.
Standalone activities
Standalone activities are represented by hexagons. A standalone activity is not part of the normal flow of the process so they are not related to process instances. A standalone activity can be executed any time a user with the right permissions want. This activities are ideal for data management related to the process, listings, adding items, removing items, etc. It’s true that many processes can be designed as a set of standalone activities if there’s no order relationship between the different activities in the process. Other processes consist of a main process flow and a set of auxiliar standalone activities. Standalone activities can’t have inbound or outbound transitions.
Activity properties: ))AutoRouting(( and Interactiveness
Interactiveness
In Galaxia activities can be automatic or interactive. Interactive activities are activities requiring some kind of interaction with the user, these activities usually present a form asking the user to fill some fields and then after the information is submitted the activity is completed. Automatic activities in contrast are executed automatically by the Galaxia engine without any user interaction. Frequently automatic activities are hidden from the user view of a process.
AutoRouting
When an activitiy is completed the engine may or may not automatically route the instance to the next activity in the process. Activities with the "AutoRouting" setting activated automatically route the instance to the next process activity when the activity is completed. If the activity is not "AutoRouting" the user must "send" the activity after completion to let the process continue. This can be used in activities where the user can edit information and review it many times before deciding that the activity is completed.
Sample process
The picture on the left shows the graph of a process. This process defines requests to the company’s library by employees. The start activity (interactive) is where the user enters the book name and author, then the librarian must verify that the book is available in the "check book" activity. If the book is available the librarian sends the book to the user and the request is accepted. If not the request is rejected. The automatic activites "accepted" and "rejected" send an email to the user notifying the result of his request. The standalone activity "view books" can be used by the user or the librarian to browse the book catalog. Interactive activities are denoted by blue borders in the process graph. |
Modules
Galaxia defines three modules:
- The process manager
- The process monitor
- The user interafce
The process manager
The process manager is the module used to create processes and modify processes, this module is normally used by admin and process designers to create a process, the process manager covers the following functionality:
- Create process and process versions
- Rename and delete activities
- Define process acitivities, view a graph of the process activities
- Check if a process is valid
- Activate/de-activate a process
- Edit activities sources (php) and templates (interactive activities)
- Define roles and define what roles are allowed to execute what activities
- Map roles to users
- Save processes (processes are saved using an XML vocabulary)
- Load processes from XML files
The process monitor
The process monitor is used to control the execution of processes. The following list shows some functionality of the process monitor API.
- List processes, process activities and number of instances per activity
- List active instances and exceptions.
- Browse instances and modify instance properties.
- Send instances to some activity
- Assign or re-assign an instance to some user
- Abort instances
- View statistics about completed processes, execution time, time per activity.
The user interface
The user interface is used by the users to browse processes that they can start or activities where they have an assigned instance waiting to complete the activity. Users can execute activities see the results and some statistics about work asssigned to them.
Summary
This document presented an introduction to "Galaxia" a PHP based workflow engine that can be used in any PHP project and will be initially released with modules created for Tiki. Galaxia can be used to create new "features" in any PHP application defining processes where all the activities related to the feature are grouped. If necesary Galaxia can define the flow of activities for some process allowing the definition of "Workflows" the flexibility and extensibility of the engine open a lot of interesting new areas to any PHP project using this product.
Acknowledgements
- Galaxia is based on OpenFlow
- Marc Laporte was the first member of the Tiki team to suggest adding a Workflow engine to Tiki.
- This wikified version was originally a copy/paste from the PDF Galaxia introduction on SourceForge. This document was originally produced by Garland Foster, Richard Moore and Eduardo Polidor.