PHP API (Workflow) |
The purpose of the API is to allow viewing and editing the data of an instance of the process. Methods are available in PHP to perform the operations. In this way, it is not necessary to know the database of SE Workflow and it is also guaranteed that the changes in the system will be applied in the API without the need of adjustments by the customer.
API usage
The workflow API must be used in an external application associated with a system activity or in the workflow action. To create an external application, you must access the PM042 menu. The first step in the external application file is to make the require_once of the global.php file. The "../../" path means that the external application is 2 directories from the root of the SE Suite. Example: workflow/wf_app/my_app.php. Then you must carry out the require_once of the workflow API. To do that, use the file: workflow/api/class.WorkflowAPI.inc. Done so, just create the object of the API passing as parameter the code of the instance. By default, all external system applications already receive the "oid_process" parameter. It is not necessary to pass additional parameters for this purpose. Frame 01 shows the example:
Frame 01 – Create API object
Methods
The API supports methods to search and update the form fields or process attributes. The methods are:
▪Searching for the value of a process attribute ▪Searching for the value of a form field ▪Searching for the value of a form list field ▪Searching for the current date and time ▪Editing the value of a process attribute ▪Editing the value of a form field ▪Editing the value of a form value list field ▪Searching for the workflow title |