-
Notifications
You must be signed in to change notification settings - Fork 30
Creating a new workflow
Here's how you might create a simple workflow to send an HTTP request in response to a user logging in.
-
As an admin, go to Site administration > plugins > Admin tools > Event Trigger
-
Press "Add new trigger workflow"
-
Give the trigger a name/description to help you remember what it does.
-
Search for an event to monitor and select it. This is a searchable list, if you enter the text "graded" you will see a list of related events.
There are 3 types of steps:
- Filter - Ability to check if the event meets certain conditions before processing it.
- Lookup - Most core events only contain a small amount of information, this allows you to obtain extra information from Moodle to pass to the trigger/action. (for example a users email or the course fullname)
- Trigger - this is an action such as an external HTTP post or email and should typically be the last step in your workflow.
- Press "Add workflow step"
- Choose "Trigger" -> "Http Post"
- Enter a name/description to help you remember what it does.
- Enter the url.
- Enter the http headers/parameters that should be used.
When developing the action/ trigger workflow steps, you can include a range of variables contained from the event or from the lookups by using the format {fieldname} for example if you wanted to include user information in the http post parameters you would enter:
param1={user_email}¶m2={user_firstname}
...and the users email and firstname would be passed to the external url with the names "param1" and "param2"