Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

One of the ideas behind translate5 workflows is, that specific actions in the application are triggered automatically by a well defined list of triggering conditions.

The mapping between actions and triggers is predefined but can be set by the admin of a translate5 installation. Currently there is no GUI for that, so the settings has to be done directly in the database in the LEK_workflow_action table.

Using the LEK_workflow_action table

Example of inserting a new workflow action
INSERT INTO `LEK_workflow_action` (`workflow`,`trigger`,`inStep`,`byRole`,`userState`,`actionClass`,`action`,`parameters`,`position`)
VALUES ('default', 'doCronDaily', null, null, null, 'editor_Workflow_Actions', 'finishOverduedTasks', null, 0);

Example Content in the LEK_workflow_action table

MariaDB [icorrectT5]> select * from LEK_workflow_action;
+----+----------+--------------------------------------------------+-----------+--------+-----------+------------------------------+---------------------------+------------+----------+
| id | workflow | trigger                                          | inStep    | byRole | userState | actionClass                  | action                    | parameters | position |
+----+----------+--------------------------------------------------+-----------+--------+-----------+------------------------------+---------------------------+------------+----------+
|  1 | default  | handleAllFinishOfARole                           | lectoring | lector | finished  | editor_Workflow_Actions      | segmentsSetUntouchedState |            |        0 |
|  2 | default  | handleAllFinishOfARole                           | lectoring | lector | finished  | editor_Workflow_Actions      | taskSetRealDeliveryDate   |            |        1 |
|  3 | default  | handleAllFinishOfARole                           | NULL      | NULL   | finished  | editor_Workflow_Notification | notifyAllFinishOfARole    |            |        2 |
|  4 | default  | handleUnfinish                                   | NULL      | lector | NULL      | editor_Workflow_Actions      | segmentsSetInitialState   |            |        0 |
|  5 | default  | handleBeforeImport                               | NULL      | NULL   | NULL      | editor_Workflow_Actions      | autoAssociateTaskPm       |            |        0 |
|  6 | default  | handleImport                                     | NULL      | NULL   | NULL      | editor_Workflow_Notification | notifyNewTaskForPm        |            |        0 |
|  7 | default  | handleImport                                     | NULL      | NULL   | NULL      | editor_Workflow_Actions      | autoAssociateEditorUsers  |            |        1 |
|  8 | default  | handleUserAssociationAdded                       | NULL      | NULL   | NULL      | editor_Workflow_Notification | notifyNewTaskAssigned     |            |        0 |
| 45 | default  | handleDirect::notifyAllUsersAboutTaskAssociation | NULL      | NULL   | NULL      | editor_Workflow_Notification | notifyAllAssociatedUsers  |            |        0 |
| 51 | default  | doCronDaily                                      | NULL      | NULL   | NULL      | editor_Workflow_Actions      | deleteOldEndedTasks       | NULL       |        0 |
+----+----------+--------------------------------------------------+-----------+--------+-----------+------------------------------+---------------------------+------------+----------+



External Workflow Trigger

The TaskController provides a callable action to trigger workflow events via URL - if configured in the workflow action table.

Workflow Trigger in the application

  • TODO List all in the core available workflow trigger
  • TODO Explain that more Actions can be added in the core code

Workflow Actions and Notifications

  • TODO List all in the core available workflow actions and notifications and explain them (from editor_Workflow_Actions)
  • TODO Explain that more Actions can be added by custom Plugins or in the core code

Default activated Actions

  • TODO To be done

Daily called (Cronjob) Actions

In order to use the periodically triggered actions (cronjobs) the following configuration has to be done:

  • Setup a cronjob or scheduled task which calls the URL https://YOURINSTALLATION/editor/cron/daily/ (under linux for example with wget)
  • The IP Adress of the caller must configured in the Zf_configuration table for security reasons

After setting up the cron job, the workflow trigger "doCronDaily" is fired on each call of the above URL.
By default no actions are bound to the "doCronDaily" trigger, so no daily actions are activated.

Useful actions for this trigger are: 

  • editor_Workflow_Actions::finishOverduedTasks
  • editor_Workflow_Actions::deleteOldEndedTasks
  • No labels