Skip to main content
Version: 2.2.1

SDK PHP: SoftExpert Workflow

The SoftExpert Workflow SDK PHP is a development tool that aims to allow developers to easily query and edit data from a workflow instance. With this development kit, it is not necessary to have prior knowledge of the internal structure of SoftExpert Workflow, as several methods are offered to enable operations in the component.

caution

The available methods guarantee the security and integrity of the data, as validations are carried out to ensure that performed operations are in accordance with the platform's business and security rules.

danger

The use of methods and functions that are not included in the scope of thisSDK is forbidden. SoftExpert will not offer support or be responsible for any problems arising from the use of functions not covered by the established scope.

Using the SoftExpert Workflow SDK​

To use the SoftExpert Workflow SDK, you must create an external application associated with a system activity or with an Workflow action, through the PM042 file menu.

Step 1: Access to the PM042 file menu​

To create an external application, you must access the PM042 file menu, located in the SoftExpert Process component. This menu is responsible for configuring and creating external applications. For detailed information on how to create an external application, refer to the following article: "How to create an external application in the system".

Step 2: Creating the external application file​

In this step, you need to create a PHP file and use "require_once" for the "global.php" file. It is important to note that the "../../" path means that the external application is two directories above the SoftExpert Suite root, as in this example: "workflow/wf_app/my_app.php".

Step 3: SoftExpert Workflow SDK requirement​

Use "require_once" for the SoftExpert Workflow SDK by means of the "workflow/api/class.WorkflowAPI.inc" file. This way, you can create the API object, passing the workflow instance code as a parameter. All external applications of the system receive, by default, the "oid_process" parameter, so there is no need to pass additional parameters for this purpose.

Step 4: Using the methods provided by the SoftExpert Workflow SDK​

It is then possible to use the methods provided by the SDK for queries and edits to the data of the Workflow instance. For example, you can use the getWorkflowTitle() method to get the title of an instance, and then perform the desired operations with that data.

Example of PHP file header:

require_once('../../global.php');
require_once('workflow/api/class.WorkflowAPI.inc');
$workflow_api = new WorkflowAPI($_REQUEST["oid_process"]); //WFPROCESS.IDOBJECT

Available methods​

The SDK of the SoftExpert Workflow component offers some methods that allow you to search for and update form fields or process attributes.

MethodDescription
getAttributeValueSearches for the value of a workflow attribute
getEntityAttributeValueSearches for the value of a workflow form field
getEntityRelationshipValueSearches for the value of a workflow "list of values" form
getDateTodaySearches for the current date of the WEB server
getTimeNowSearches for the current time of the WEB server
setAttributeValueEdits the value of a workflow attribute
setEntityAttributeValueEdits the value of a workflow form field
setEntityRelationshipValueEdits the value of a workflow "list of values" form
setWorkflowTitleChanges workflow title
getWorkflowTitleSearches for workflow title