Contents
Introduction
We also provide a javasscript demonstration class that can be used to access evQueue directly from javascript (client side). This class uses session storage to store the running instances.
For this to work, you however need an evQueue proxy.
Source code can be found in our sample project on GitHub.
Accessing the API
Create a new evQueue object and pass the url of your proxy:
evq = new evQueue('/evqueue-api.php');
The API method provides a complete access to the evQueue API. The parameters are the following:
- group
API command group - action
API command action - attributes
API command attributes. These are the parameters of the command. - parameters
Workflow parameters. This is used when launching a new instance or planning schedules.
Here is an example of how to launch a new instance:
evq.({ group:'instance', action:'launch', attributes:{name:'my_workflow'}, parameters:{...} });
This returns a jQuery deferred object, that you can use to get the result of the API command:
evq.({ group:'instance', action:'launch', attributes:{name:'my_workflow'}, parameters:{...} }).done(function(xml_return) { console.log(xml); });
For launching a new instance, the class provides a simple method:
evq.Launch('workflow',{parameter:value});
You can then monitor the status of running instances by providing a callback:
evq.MonitorStatus(function(instances) { console.log(instances); });
For more details, see the sample project.