Hooks¶
Hooks
are the workflow component for you to
subscribe certain events in your workflow like
a transition happens, an auhorization rule is approved
or the workflow is completed. It can be either a rule
in general for whole workflow or for a specific workflow
object too. In this section, we will be looking into the
first one
After django-river
version 3.0.0
, hooks
are supported on the fly and this is another
feature of django-river
which River Admin
has some interfaces for.
Hooks are managed on the same page with authorizations for a workflow. So, to know how to navigate to the page, please take a look at How to Navigate
Note
To register a hook to a certain event, you need the required function to be defined preliminary. To see how to create a function please look at Create & Update Function
Note
Even though django-river
supports transition, approvals
and workflow completing events to hook up, River Admin
currently supports only transitions and approval hooks.
Apart from that even tough django-river
gives you the capability of
defining your hooks before the event happens or after the
event happens, River Admin
simplifies this by just
allowing before transition happens
and
after an authorization rule is approved
for the sake of
convinience. By this it is very smooth to create your workflow
along with your hooks all together.
Create Transition Hooks¶
Transition hooks can be defined for whole transition. It means that the hook will be executed right before the transition happens.
After you create, it should look like this;
Create Approval Hooks¶
Approval hooks can be defined for a specific authorization rule not for whole transition. After the authorization rule is approved your hook will be invoked.
After you create, it should look like this;