Custom Tasks
This document outlines the process of enhancing Governify services through the use of "Custom Tasks". Custom tasks are scripts executed within director service, wich is responsible for handling automatic calculations tasks (a predefined task). However you have the flexibility to create your own tasks, store them in assets-bluejay and then load and execute them in through Admin UI.
A good example of a custom task is Optimize Calculation Period wich evenly distribute the automatic calculations launches across a period of time.
Create a custom task in the UIâ
Go to ui.bluejay.[YourDomain].
Click on Admin UI.
Click on Task Runner tab.
Create the script and configuration.
dangerRefreshing the page will clear all previews. The next section will teach you how to save a task in the assets. Meanwhile use
ctrl+a
,ctrl+c
andwindows+v
.
Save a custom task in the assetsâ
In assets-bluejay go to public/director/tasks
. The folders created in this directory will be used as categories in the dropdown.
Let's create a folder named myCategory. The new path will be public/director/tasks/myCategory
.
Here we can create a folder called myScript. Inside public/director/tasks/myCategory/myScript
you must store 3 files:
configuration.json. This is the default file for configuration. Set the parameters to default values.
documentation.md. This is the markdown explaining the new task and it configuration parameters.
script.js. This is the script that will be executed.
bear in mindYou must use the template at
public/director/tasks/examples/template
for the script.js
Load and run a taskâ
Go to ui.bluejay.[YourDomain].
Click on Admin UI.
Click on Task Runner tab.
Open the dropdown and select the task. However you can also upload from your computer.
Configure the task.
Bear in mindLoading a task from assets will load a default config.json and a documentation.md. Please modifiy the config with the parameters explained in the documentation file.
Click on Run.
Logs will be shown inside Result.json: