@@ -1,13 +1,22 @@ |
Workflow refers to procedures for processing documents, such as requiring an editor to review and approve a story.
|
|
+!References |
+Here are some links to ((bitweaver and TikiWiki)) documentation where some of the definitions have been taken from: |
+* [http://prdownloads.sourceforge.net/tikiwiki/Galaxia_introduction.pdf?download|Galaxia Introduction.pdf] |
+* [http://prdownloads.sourceforge.net/tikiwiki/Galaxia_manual.pdf?download|Galaxia Manual.pdf] |
+The above documents are not completely reflective of Galaxia in its current state within Bitweaver, but definitely informative. |
+ |
-=Pre Requisites=-
|
* Its presumed that you have basic programming knowledge including the assignment and use of variables.
|
* Please note - the workflow system greatly simplifies the amount of work needed to create a workflow application. You will require __very__ basic knowledge of PHP and Smarty, so do not delve too deeply and get discouraged.
|
* [http://www.php.net|PHP] will be used for the coding part of workflow generation. If you don't know what PHP is, take a look at [http://www.php.net/manual/en/intro-whatcando.php|What can PHP do?]. If you are unfamiliar with PHP and would like to learn more, its recommended that you read the [http://www.php.net/tut.php|PHP Tutorial].
|
* [http://smarty.php.net|Smarty Template Engine] will be used for the displaying of information in workflow generation. If you are unfamiliar with Smarty, it is also recommended that you read [http://codewalkers.com/tutorials/56/1.html|Codewalkers Smarty Tutorial].
|
|
-!Introduction
|
-bitweaver, has inherited a Workflow Engine from TikiWiki called Galaxia. This engine is quite powerful and easy to use once the basic concepts have been mastered. Rather than give you all the concepts now, I will introduce them throughout the tutorial to help understand their use and context in the scheme of workflow generation.
|
+!Hello World Process 1.0 - Introduction |
+Click here to download the XML file of the process. |
+{attachment id=148} |
+ |
+bitweaver, has inherited a Workflow Engine from ((bitweaver and TikiWiki)) called Galaxia. This engine is quite powerful and easy to use once the basic concepts have been mastered. Rather than give you all the concepts now, I will introduce them throughout the tutorial to help understand their use and context in the scheme of workflow generation. |
Ensure Workflow is enabled on your website.
|
-=Bonnie=-
|
If you have the permissions, you can visit __Administration / Administer Packages / Features__ and check the __Workflow__ feature. Click __Change Preferences__ to save your change.
|
|
|
@@ -23,16 +32,17 @@ |
|
To create our Test Process, open the __Workflow / Admin Processes__ section of bitweaver.
|
You notice at the top of the page are 4 icons.
|
-* {img src=/Galaxia/icons/Process.gif} __monitor processes__ - Shortcut to __Monitor processes__
|
-* {img src=/Galaxia/icons/Activity.gif} __monitor activities__ - Shortcut to __Monitor activities__
|
-* {img src=/Galaxia/icons/Instance.gif} __monitor instances__ - Shortcut to __Monitor instances__
|
-* {img src=/Galaxia/icons/memo.gif} __monitor workitems__ - Shortcut to __Monitor workitems__
|
+* {img src=/galaxia/icons/Process.gif} __monitor processes__ - Shortcut to __Monitor processes__ |
+* {img src=/galaxia/icons/Activity.gif} __monitor activities__ - Shortcut to __Monitor activities__ |
+* {img src=/galaxia/icons/Instance.gif} __monitor instances__ - Shortcut to __Monitor instances__ |
+* {img src=/galaxia/icons/memo.gif} __monitor workitems__ - Shortcut to __Monitor workitems__ |
These icons are shortcuts to monitor other parts of workflow generation. For now know that they represent monitoring processes, activities, instances and work items.
|
|
In __Process Name__, enter the title of your process. As an example, we will do ''Hello World Process''.
|
Optionally in the __Description__, enter a short description about the process.
|
__Is active?__ indicates that the process is available for users. Leave this unchecked, as nothing will work while the process is blank.
|
Now click __Create__.
|
+ |
|
-=Uploading Process XML Files=-
|
Just below the Create button are __Browse__ and __Upload__ buttons. Later in the tutorial, we will export our process to an XML file which can be later uploaded here or used on other bitweaver installations.
|
|
|
@@ -51,33 +61,37 @@ |
|
__Active__ indicates if the process is free from errors and available for public use.
|
|
-__Valid__ is a {img src=/Galaxia/icons/green_dot.gif} green or {img src=/Galaxia/icons/red_dot.gif} red circle indicating whether the process can be activated or not. This is dependent on whether it has any errors - mentioned above.
|
+__Valid__ is a {img src=/galaxia/icons/green_dot.gif} green or {img src=/galaxia/icons/red_dot.gif} red circle indicating whether the process can be activated or not. This is dependent on whether it has any errors - mentioned above. |
|
|
Lastly, the __Action__ icons are shortcuts to administer the process's activities, instances and other components. These are:
|
-* {img src=/Galaxia/icons/Activity.gif} __activities__ - This is a shortcut back to the __Admin process activities__ page.
|
-* {img src=/Galaxia/icons/book.gif} __code__ - This is a shortcut back to the __Admin process sources__ page.
|
-* {img src=/Galaxia/icons/myinfo.gif} __roles__ - This is a shortcut back to the __Admin process roles__ page.
|
-* {img src=/Galaxia/icons/export.gif} __export__ - This allows you to save a process to an XML file for later uploading.
|
+* {img src=/galaxia/icons/Activity.gif} __activities__ - This is a shortcut back to the __Admin process activities__ page. |
+* {img src=/galaxia/icons/book.gif} __code__ - This is a shortcut back to the __Admin process sources__ page. |
+* {img src=/galaxia/icons/myinfo.gif} __roles__ - This is a shortcut back to the __Admin process roles__ page. |
+* {img src=/galaxia/icons/export.gif} __export__ - This allows you to save a process to an XML file for later uploading. |
+ |
+Click on the first __Action__ icon - __activities__ {img src=/galaxia/icons/Activity.gif}. |
|
-Click on the first __Action__ icon - __activities__ {img src=/Galaxia/icons/Activity.gif}.
|
!Admin Activities
|
-Activities are actions that are performed during your process. A process can consist of many activities. By default, a ''start'' and ''end'' activity are created for you, but these can be renamed or deleted at a later stage. I'll define two other terms so you can understand their context later.
|
+An ''Activity'' is an action that is performed during your process. In Galaxia activities are mapped to PHP scripts so an activity can do anything that can be done from a PHP script. A process can consist of many activities. By default, a ''start'' and ''end'' activity are created for you, but these can be renamed or deleted at a later stage. I'll define two other terms so you can understand their context later. |
|
An ''instance'' is a particular process currently being executed. An activity can have many instances associated with it at any time. An instance is created when a process is initiated by a user and the instance will pass through the process activities until the process is terminated or completed.
|
|
A ''transition'' is the path between two or more activities. A transition defines what has to be done after each activity is completed.
|
+ |
+A ''workitem'' is added to the instance when an activity is completed. Workitems thus represent completed activities. |
|
Activities are broken up into different types. Here are two types listed below:
|
-* {img src=/Galaxia/icons/mini_circle.gif} __start__ - This activity type marks an entry point into the process. A process can contain many start type activities allowing for multiple ways to begin a process. Processes with many start activities are very strange but possible. Every process must contain at least one start activity. Instances are created when a start activity is executed. No transitions can lead to a start activity and only one outgoing transition is allowed per start activity.
|
-* {img src=/Galaxia/icons/mini_dbl_circle.gif} __end__ - This activity type marks the end point of the process. When an instance reaches the end activity the process is considered completed. A process can must contain only one end type activity. This doesn’t mean that processes can’t end in different ways. Since the end activity represents the process end, how the process ends depends on the activities visited beforehand. The end activity can have many inbound transitions but Outbound transitions are not allowed.
|
-* {img src=/Galaxia/icons/mini_rectangle.gif} __activity__ - 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. Normal activities can receive many inbound transitions but can only have one outbound transition.
|
|
+* {img src=/galaxia/icons/mini_circle.gif} __start__ - This activity type marks an entry point into the process. A process can contain many start type activities allowing for multiple ways to begin a process. Processes with many start activities are very strange but possible. Every process must contain at least one start activity. Instances are created when a start activity is executed. No transitions can lead to a start activity and only one outgoing transition is allowed per start activity. |
+* {img src=/galaxia/icons/mini_dbl_circle.gif} __end__ - This activity type marks the end point of the process. When an instance reaches the end activity the process is considered completed. A process can must contain only one end type activity. This doesn’t mean that processes can’t end in different ways. Since the end activity represents the process end, how the process ends depends on the activities visited beforehand. The end activity can have many inbound transitions but Outbound transitions are not allowed. |
+* {img src=/galaxia/icons/mini_rectangle.gif} __activity__ - 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. Normal activities can receive many inbound transitions but can only have one outbound transition. |
|
-* {img src=/Galaxia/icons/mini_diamond.gif} __switch__ - A switch activity represents a point of decision in a process. Instances reaching a switch activity are evaluated and depending on programmed conditions, the instance is routed to different activities. Switch activities can have many inbound transitions and many outbound transitions.
|
-* {img src=/Galaxia/icons/mini_triangle.gif} __split__ - When two or more activities in a process can be performed independently in paralell - a split activity is used to split the an instance, routing the same instance to many activities. This allows an instance to 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.
|
-* {img src=/Galaxia/icons/mini_inv_triangle.gif} __join__ - A join activity is used to re-group multiple instances from a split activity. When an instance reaches a join activity, it is verified that all other related instances have reached the join activity. At this point, 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 activity.
|
-* {img src=/Galaxia/icons/mini_hexagon.gif} __standalone__ - A standalone activity is not part of the normal flow of the process and are not related to process instances. A standalone activity can be executed any time by a user with the right permissions. These activities are ideal for data management related to the process, listings, adding items, removing items, etc. If there is no order relationship between different activities in a process, it can be designed as a set of standalone activities. Otherwise a processes will consist of a route of activities and a set of auxiliar standalone activities. Standalone activities can not have inbound or outbound transitions.
|
+ |
+* {img src=/galaxia/icons/mini_diamond.gif} __switch__ - A switch activity represents a point of decision in a process. Instances reaching a switch activity are evaluated and depending on programmed conditions, the instance is routed to different activities. Switch activities can have many inbound transitions and many outbound transitions. |
+* {img src=/galaxia/icons/mini_triangle.gif} __split__ - When two or more activities in a process can be performed independently in paralell - a split activity is used to split the an instance, routing the same instance to many activities. This allows an instance to 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. |
+* {img src=/galaxia/icons/mini_inv_triangle.gif} __join__ - A join activity is used to re-group multiple instances from a split activity. When an instance reaches a join activity, it is verified that all other related instances have reached the join activity. At this point, 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 activity. |
+* {img src=/galaxia/icons/mini_hexagon.gif} __standalone__ - A standalone activity is not part of the normal flow of the process and are not related to process instances. A standalone activity can be executed any time by a user with the right permissions. These activities are ideal for data management related to the process, listings, adding items, removing items, etc. If there is no order relationship between different activities in a process, it can be designed as a set of standalone activities. Otherwise a processes will consist of a route of activities and a set of auxiliar standalone activities. Standalone activities can not have inbound or outbound transitions. |
In our first example, we will only use the defaults, __start__ and __end__.
|
|
-=Add or edit an activity=-
|
|
|
@@ -95,7 +109,8 @@ |
|
At the bottom of the ''Add or edit an activity'' form, there are the roles associated with this activity.
|
|
-__Roles__: Activities are asocited to roles which define who can perform certain activities. Roles are defined at a per-process level and assigned to bitweaver groups. This allows simplified administration of particular activities and processes.
|
+ |
+__Roles__: Activities are asocited to roles which define who can perform certain activities. ''Roles'' are defined at a per-process level and assigned to bitweaver groups defining who is able to execute each activity. This allows simplified administration of particular activities and processes. |
|
-=Process activities=-
|
In our first example, we will use just the start and end activities. In the start activity we will display our name.
|
|
|
@@ -120,21 +135,22 @@ |
Now lets refer to the next error ''Activity: start is interactive but has no role assigned''. As the __start__ is marked as an __Interactive__ activity, we need to assign a role to the activity. In the __Add role__, enter ''testuser'' and press __add role__. You can see the screen update and ''testuser'' appears in the list of assigned roles. If you wish to remove an assigned role, click on the __x__ next to the name.
|
|
At this point, I will introduce you to the rest of the shortcut toolbar at the top of the page.
|
-* {img src=/Galaxia/icons/red_dot.gif} __invalid__ - This indicates that the process currently contains errors and cannot be activated or started.
|
+* {img src=/galaxia/icons/red_dot.gif} __invalid__ - This indicates that the process currently contains errors and cannot be activated or started. |
|
|
-* {img src=/Galaxia/icons/Activity.gif} __activities__ - This is a shortcut back to the __Admin process activities__ page.
|
-* {img src=/Galaxia/icons/change.gif} __edit__ - This is a shortcut back to the __Admin processes__ page.
|
-* {img src=/Galaxia/icons/book.gif} __code__ - This is a shortcut back to the __Admin process sources__ page.
|
-* {img src=/Galaxia/icons/myinfo.gif} __roles__ - This is a shortcut back to the __Admin process roles__ page.
|
-* {img src=/Galaxia/icons/graph.gif} __graph__ - This creates a flow chart of the process in graphical form.
|
-* {img src=/Galaxia/icons/export.gif} __export__ - This allows you to save a process to an XML file for later uploading.
|
-* {img src=/Galaxia/icons/Process.gif} __monitor processes__ - Shortcut to __Monitor processes__
|
-* {img src=/Galaxia/icons/Activity.gif} __monitor activities__ - Shortcut to __Monitor activities__
|
-* {img src=/Galaxia/icons/Instance.gif} __monitor instances__ - Shortcut to __Monitor instances__
|
-* {img src=/Galaxia/icons/memo.gif} __monitor workitems__ - Shortcut to __Monitor workitems__
|
+* {img src=/galaxia/icons/Activity.gif} __activities__ - This is a shortcut back to the __Admin process activities__ page. |
+* {img src=/galaxia/icons/change.gif} __edit__ - This is a shortcut back to the __Admin processes__ page. |
+* {img src=/galaxia/icons/book.gif} __code__ - This is a shortcut back to the __Admin process sources__ page. |
+* {img src=/galaxia/icons/myinfo.gif} __roles__ - This is a shortcut back to the __Admin process roles__ page. |
+* {img src=/galaxia/icons/graph.gif} __graph__ - This creates a flow chart of the process in graphical form. |
+* {img src=/galaxia/icons/export.gif} __export__ - This allows you to save a process to an XML file for later uploading. |
+* {img src=/galaxia/icons/Process.gif} __monitor processes__ - Shortcut to __Monitor processes__ |
+* {img src=/galaxia/icons/Activity.gif} __monitor activities__ - Shortcut to __Monitor activities__ |
+* {img src=/galaxia/icons/Instance.gif} __monitor instances__ - Shortcut to __Monitor instances__ |
+* {img src=/galaxia/icons/memo.gif} __monitor workitems__ - Shortcut to __Monitor workitems__ |
+ |
+Click on {img src=/galaxia/icons/myinfo.gif} __roles__ to map a user. |
|
-Click on {img src=/Galaxia/icons/myinfo.gif} __roles__ to map a user.
|
!Admin Roles
|
-=Admin process roles=-
|
Look at the __This process is invalid:__ section and you will notice a new error has appeared - ''Role: testuser is not mapped''.
|
|
|
@@ -148,7 +164,7 @@ |
!Admin Code
|
Look at the __This process is invalid:__ section and you will notice one error left - ''Activity start is interactive so it must use the $instance->complete() method''.
|
|
-Now we are ready to code some functionality. Click on {img src=/Galaxia/icons/book.gif} __code__ in the toolbar to begin coding.
|
+Now we are ready to code some functionality. Click on {img src=/galaxia/icons/book.gif} __code__ in the toolbar to begin coding. |
|
-=Admin process sources=-
|
You will see a edit window with the start of a PHP script.
|
|
|
@@ -168,7 +184,7 @@ |
|
First thing we want to do is set some text to be displayed on the screen. Enter this in the edit window.
|
{CODE()}<?php
|
- $smarty->assign('display_text', 'Hello world!');
|
+ $gBitSmarty->assign('display_text', 'Hello world!'); |
|
if(isset($_REQUEST['save'])){
|
$instance->complete();
|
|
|
@@ -177,7 +193,7 @@ |
You will notice that along the right side of the edit form are a number of links. These are coding shortcuts that allow you to quickly insert commonly used code.
|
|
Let me explain these lines.
|
-The first line ''$smarty->assign('display_text', 'Hello world!');'' is used to assign text to a ''variable'' which is used in __template__. Here we are assigning the variable ''display_text'' with the words '''Hello world!'''. You will see this used when we edit the template section.
|
+The first line ''$gBitSmarty->assign('display_text', 'Hello world!');'' is used to assign text to a ''variable'' which is used in __template__. Here we are assigning the variable ''display_text'' with the words '''Hello world!'''. You will see this used when we edit the template section. |
|
The second line is an ''if'' statement checking if the __save__ button was pressed. If the button was pressed, the ''$instance->complete();'' function is executed telling the workflow, that we have finished the activity and are ready to move to the next actitivity - in our case ''end''.
|
|
|
|
@@ -198,7 +214,7 @@ |
|
Press __save__ when finished editing.
|
|
-Look at the toolbar, and you will see two new icons - a {img src=/Galaxia/icons/green_dot.gif} green __valid__ dot and an {img src=/Galaxia/icons/refresh2.gif} __activate__ icon. These indicate that all errors have been resolved and by clicking on the __activate__ icon, you will activate the process. Click the {img src=/Galaxia/icons/refresh2.gif} __activate__ icon.
|
+Look at the toolbar, and you will see two new icons - a {img src=/galaxia/icons/green_dot.gif} green __valid__ dot and an {img src=/galaxia/icons/refresh2.gif} __activate__ icon. These indicate that all errors have been resolved and by clicking on the __activate__ icon, you will activate the process. Click the {img src=/galaxia/icons/refresh2.gif} __activate__ icon. |
!Starting an Instance
|
Click on __Admin Processes__ and you will see the two columns ''Active'' and ''Valid'' have now changed. These indicated that the workflow appears to be complete and is ready for execution.
|
-=User Processes=-
|
|
|
@@ -206,8 +222,8 @@ |
The user can use this screen to see all their available processes. As you can see currently we have one activity and no (zero) instances.
|
-=User Activities=-
|
The __User Activities__ menu item show all available activities. In our example, we have one item, the __start__ activity.
|
-The {img src=/Galaxia/icons/next.gif} arrow icon indicated that this activity can be started or ''instantiated''.
|
-Click on the {img src=/Galaxia/icons/next.gif} arrow to start our example process.
|
+The {img src=/galaxia/icons/next.gif} arrow icon indicated that this activity can be started or ''instantiated''. |
+Click on the {img src=/galaxia/icons/next.gif} arrow to start our example process. |
!Hello World!
|
When you start our example process, the screen changes to show the form we designed earlier.
|
^Ready to display text: __Hello world!__
|
|
|
@@ -216,9 +232,12 @@ |
-=Saving your Process=-
|
If you'd like to save your process to an XML file for later restoration, this is how to do it.
|
|
-Go to the __Admin Processes__ page and click the {img src=/Galaxia/icons/export.gif} __export__ icon. Depending on your browser, you will either be prompted to save the file somewhere or it will be displayed in the browser window. If it display, select __File__ / __Save As__ to save it to a file.
|
+Go to the __Admin Processes__ page and click the {img src=/galaxia/icons/export.gif} __export__ icon. Depending on your browser, you will either be prompted to save the file somewhere or it will be displayed in the browser window. If it display, select __File__ / __Save As__ to save it to a file. |
+ |
+!Hello World Process 1.1 - New Version |
+Click here to download the XML file of the process. |
+{attachment id=149} |
|
-!New Version
|
So we are going to create a more complex version of workflow. In the __Admin Processes__ page, you can select ''new major'' or ''new minor'', to create a duplicate process. This allows you to begin testing a new version of process and eventually, replace the old version with the new one.
|
|
Click __new minor__
|
|
|
@@ -230,19 +249,21 @@ |
Click on the ''Activities'' icon and create a new activity called ''display''.
|
In __Add transitions from:__ list, select ''start'' and in the __Add transitions to:__ list, select ''end''. This places the activity between the two previous activities.
|
Check ''auto routed:'' and select ''testuser'' role for this activity.
|
+ |
|
As you can see a new error came up ^This process is invalid:
|
Activity display is interactive so it must use the $instance->complete() method^
|
|
-Another point to note is the graph of the process - click the {img src=/Galaxia/icons/graph.gif} __graph__ icon. You can see the flow of the process is not right, as we want to start, then display and finally end.
|
+Another point to note is the graph of the process - click the {img src=/galaxia/icons/graph.gif} __graph__ icon. You can see the flow of the process is not right, as we want to start, then display and finally end. |
|
Click on the ''start'' activity.
|
In the __Add transitions to:__ list, select ''display'' and click __Save__. This places the ''start'' activity at the beginning of the process.
|
-Click the {img src=/Galaxia/icons/graph.gif} __graph__ icon again to see the flow of the process.
|
+Click the {img src=/galaxia/icons/graph.gif} __graph__ icon again to see the flow of the process. |
|
!Inputting Data
|
Click the __template__ link on the ''start'' process. Edit the code, to display an INPUT TEXT field.
|
{CODE()}{*Smarty template*}
|
+ |
<form method="post">
|
Ready to display text: <b>{$display_text}</b><br>
|
|
|
|
@@ -252,7 +273,7 @@ |
</form>{CODE}
|
Click the __code__ button to switch to the PHP code window. Edit the code, to store the text from the INPUT TEXT field.
|
{CODE()}<?php
|
- $smarty->assign('display_text', 'Hello world!');
|
+ $gBitSmarty->assign('display_text', 'Hello world!'); |
|
if(isset($_REQUEST['save'])){
|
|
|
|
@@ -264,7 +285,7 @@ |
Drop down the __select source:__ list, and choose ''display''. Edit the code, to retrieve the stored text.
|
{CODE()}<?php
|
$name = $instance->get("name");
|
- $smarty->assign('name', $name);
|
+ $gBitSmarty->assign('name', $name); |
|
if(isset($_REQUEST['save'])){
|
$instance->complete();
|
|
|
@@ -278,4 +299,7 @@ |
</form>{CODE}
|
Click __save__ to finish coding.
|
|
-Click the {img src=/Galaxia/icons/refresh2.gif} __activate__ icon to activate the process. Go to ''User Activities and try version 1.1 of the Hello World Process. |
+Click the {img src=/galaxia/icons/refresh2.gif} __activate__ icon to activate the process. Go to ''User Activities and try version 1.1 of the Hello World Process. |
+ |
+ |
+ |
|
|