Navigation:  »No topics above this level«

PHP API (Workflow)

Previous  Top  Next

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:

 

require_once('../../global.php');

require_once('workflow/api/class.WorkflowAPI.inc');

$workflow_api = new WorkflowAPI($_REQUEST["oid_process"]); //WFPROCESS.IDOBJECT

Frame 01 – Create API object

 

 

Methods

 

The API supports methods to search and update the form fields or process attributes. The methods are:

getAttributeValue

Searches for the value of a process attribute

getEntityAttributeValue

Searches the value of a form field

getEntityRelationshipValue

Searches the value of a form value list

getDateToday

Searches the current date

getTimeNow

Searches for the current time

setAttributeValue

Edits the value of a process attribute

setEntityAttributeValue

Edits the value of a form field

setEntityRelationshipValue

Edits the value of a form value list field

setWorkflowTitle

Editing the workflow title

getWorkflowTitle

Searching for the workflow title

 

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

Editing the workflow title

Searching for the workflow title