====== Workflow step by step explanation ======
The Workflow module provides a number of options to trigger actions based on events in the application or time based events.
To configure a workflow for a module enter the application as an admin user, go to the //Settings// page and click on the //Workflows// link (this can be found under the //Other Settings// block)
{{ :en:corebos:workflow:stepbystep:step1mw.png |}}
This will bring up the list of all defined workflows (by default all workflows are listed).
You can see all the available workflow for any particular module using the //Select Module// dropdown on the page.
{{ :en:corebos:workflow:stepbystep:step2mw.png |}}
The Workflow extension provides options to
*create a new workflow
*edit an existing workflow
*delete an existing workflow
===== Create Workflow =====
Click on the //New Workflow// button. A popup will appear listing the available modules.
{{ :en:corebos:workflow:stepbystep:step3mw.png |}}
Select a module and click //Create//. You will be taken to an edit page for the workflow.
Add a Description for the workflow. You can specify here [[en:workflow_launch_conditions|when the workflow should run]].
{{ :en:corebos:workflow:stepbystep:step4mw.png |}}
You can [[en:workflow_conditions|add more conditions]] by clicking the //New Condition// button.
{{ :en:corebos:workflow:stepbystep:step5mw.png |}}
Click the 'Save' Button to save the new workflow.
Once you have saved the workflow, you will be presented with a screen where you can add the tasks for the workflow. These task(s) will be executed once the workflow conditions are satisfied.
{{ :en:corebos:workflow:stepbystep:step6mw.png |}}
===== Create tasks =====
Click on the //New Task// button to add a new task. You will get a popup to select the type of task you can create. There are multiple types of tasks, among which you may find:
*//Send Email// task which can be used to send emails
*//Invoke custom function// task which will call certain specific methods on the entity objects.
*//Create Todo// task which will create a todo when the workflow condition is met.
*//Create Event// task, which will create an event.
Select a task type from the dropdown and click on the create button to create the task.
===== Configuring tasks =====
==== Common Fields ====
The following fields are common for all workflow tasks
*//Task Title// - This is the title of the task used in the task list to identify the task.
*//Status// - This is a selection box which should be set to active if the task is to be executed when the workflow executes.
*//Execute the task after some delay// - If this is checked you will be provided with additional fields to specify a time delay for when the task will be executed. You can specify when the task is executed relative to the time in a date field on the record.
{{ :en:corebos:workflow:stepbystep:step7mw.png |}}
==== Email Task ====
{{ :en:corebos:workflow:stepbystep:step8mw.png |}}
==== Invoke custom function ====
This option provides a way for developers to [[en:invokecustomfunction_workflows| add module specific actions to workflows]]. To define a task, you need to define a method to be called. This method should be defined as a function in it's own file.
focus->called = true;
}
?>
The method then needs to be registered, for example if the method was defined in the file modules/demo/Demo.inc for the Contacts module and given the name method.
require_once 'include/utils/utils.php';
require 'modules/com_vtiger_workflow/VTEntityMethodManager.inc';
$emm = new VTEntityMethodManager($adb);
$emm->addEntityMethod("PurchaseOrder", "method", "modules/Workflow/Demo.inc", "demo");
The method will appear in the list of methods available for the Contacts module.
{{ :en:corebos:workflow:stepbystep:step9mw.png |}}
==== Todo Task ====
Using this option, you can setup a workflow to create a new calendar Todo when a condition is matched. The following fields are provided in the create view of this option
*Todo - The title of the todo.
*Description - Of the todo.
*Status - The status of the todo, can be selected from the dropdown
*Priority - The priority of the todo, can be selected from the dropdown.
*Time - The start time of the todo, in 24 hours time.
*Due Date - The due date for the todo, the start date is also set using this.
*Send Notification - Set the send notification flag.
If the module which triggers the workflow is Contacts then the //Contact Name// field will be bound to the contact. If the module is one of the acceptable modules for the Related To field then the module //Related To// field will be bound to the module.
{{ :en:corebos:workflow:stepbystep:step10mw.png |}}
==== Event Task ====
This is same as Todo task other than that it creates an event instead of a task.