Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
8501e897
Commit
8501e897
authored
11 years ago
by
Vo Minh Thu
Browse files
Options
Downloads
Patches
Plain Diff
[DOC] workflows: improved Triggers section.
bzr revid: vmt@openerp.com-20130723151249-oa18owwzg82ea79t
parent
3f9fb6ea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/workflows.rst
+20
-23
20 additions, 23 deletions
doc/workflows.rst
with
20 additions
and
23 deletions
doc/workflows.rst
+
20
−
23
View file @
8501e897
...
...
@@ -74,7 +74,9 @@ been processed), and thus also process the "b" activity.
Transitions
-----------
Transitions provide the control structures to orchestrate a workflow. In their
Transitions provide the control structures to orchestrate a workflow. When an
activity is completed, the workflow engine will try to get across transitions
departing from the completed activity, towards the next activities. In their
simplest form they just link activities from one to the others (as in the
example above), and activities are processed as soon as the activities
preceding them are completed.
...
...
@@ -129,28 +131,23 @@ attribute of the button.
Triggers
''''''''
When an activity is completed, the workflow engine will try to get across
transitions departing from the completed activity, towards the next activities.
To get across a transition, its associated condition should evaluate to True.
If the condition evaluates to False, the transition is not taken (and thus the
With conditions that evaluate to false, transitions are not taken (and thus the
activity it leads to will not be processed). Still, the workflow instance can
get new chances to progress across that transition by providing so-called
triggers. The idea is that when the condition fails, triggers (actually just
model name/record IDs pairs) are recorded in database. Later, it is possible to
wake-up specifically the workflow instances that installed those triggers,
offering them a new chance to evaluation their transition conditions. This
mechnism makes it cheaper to wake-up workflow instances by targetting just a
few of them (those that have installed the triggers) instead of all of them.
On each transition, in addition to a condition, records can be defined as a
trigger. The records will be defined as triggers as the transition is tried
withing a workflow, after the condition has failed. The actual records are
stored as model name and record ids. The model name is defined by the
trigger_model attribute of the transition while the record IDs are retrived by
evaluating the trigger_expression (also defined on the transition).
- I think the triggers are never deleted from the database. They are: they are
'on delete cascade' on both the workflow instance and the workitem.
- Are those triggers re-installed whenever the transition is tried ? Nope.
triggers. The idea is that when the condition fails, triggers are recorded in
database. Later, it is possible to wake-up specifically the workflow instances
that installed those triggers, offering them a new chance to evaluation their
transition conditions. This mechnism makes it cheaper to wake-up workflow
instances by targetting just a few of them (those that have installed the
triggers) instead of all of them.
Triggers are recorded in database as record IDs (together with the model name)
and refer to the workflow instance waiting for them. The transition definition
can thus provide a Python expression (using the ``trigger_model`` attribute)
that when evaluated will return the record IDs. Unlike the other expressions
defined on the workflow, this one is evaluated with respect to a model that can
be chosen on a per-transition basis with the ``trigger_expression`` attribute.
.. note:: Note that triggers are not re-installed whenever the transition is
re-tried.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment