Skip to main content
Version: 2.2.0

SoftExpert Workflow APIs: How to start, run, and query instances

The APIs presented in this section are mainly used to interact with the system via a graphical user interface, rather than providing structured data in JSON format. In other words, their purpose is to allow you to perform actions in the system and view information via the SoftExpert Workflow user interface, rather than obtaining data in a structured format.

tip

Such APIs are useful when the developer wants to send the user of a third-party system directly to the SoftExpert Workflow interface.

Workflow​

Starting a workflow​

GET /se/workflow/api/new_workflow.php

Starts a SoftExpert Workflow instance.

Query parametersTypeRequiredDescription
processidStringYesProcess ID #
workflowtitleStringYesWorkflow title
useridStringYesUser ID (optional)

This API allows starting a SoftExpert Workflow instance and can be accessed via HTTP GET request to the /se/workflow/api/new_workflow.php endpoint.

To start the instance, the values of the following parameters must be provided:

  • processid: unique ID # of the process to be started.
  • workflowtitle: title of the workflow instance being started.
  • userid (optional): ID of the user starting the instance. The API can be used to start a workflow instance in the system, thus allowing the process to be executed.

It is important to point out that the user starting the instance must be authenticated in the system before using this API and have permission to instantiate the requested workflow. Additionally, the correct values of the processid and workflowtitle parameters must be entered in order for the instance to be started.

To call the API, you will need to send a GET request to the https://my-domain.softexpert.com/se/workflow/api/new_workflow.php URL, passing the required parameters as part of the URL query string. For example: https://my-domain.softexpert.com/se/workflow/api/new_workflow.php?processid=1234&workflowtitle=MeuWorkflow&userid=5678.

Once the API is successfully called, a screen for executing the instance will be opened in SoftExpert Workflow. At this stage, it is essential to enter all mandatory data regarding the first activity of the instance and perform an action that has been parameterized in that activity. That is the only way to move the workflow forward.

Activity execution​

GET /se/workflow/api/execute_activity.php

Opens the SoftExpert Workflow activity execution screen.

Query parametersTypeRequiredDescription
workflowidStringYesSoftExpert Workflow instance ID #
activityidStringYesActivity ID #
activitysequenceStringYesActivity sequence (this parameter is required when there is more than one action with the same ID # in the activity)

This API is used to open the execution screen of an activity in SoftExpert Workflow. To use it, you will need to enter the values of the workflowid, activityid and, optionally, activitysequence parameters.

The workflowid parameter is the ID # of the SoftExpert Workflow instance that contains the activity you want to execute. The activityid parameter is the unique ID # of the activity you want to execute. If there is more than one action with the same ID # in the activity, you will also need to input the activitysequence parameter, which specifies the sequence of the action you want to execute.

To call the API, you will need to send a GET request to the https://my-domain.softexpert.com/se/workflow/api/execute_activity.php URL, passing the required parameters as part of the URL query string. For example: https://my-domain.softexpert.com/se/workflow/api/execute_activity.php?workflowid=1234&activityid=5678&activitysequence=1

When the API is successfully called, the activity execution screen will be opened in SoftExpert Workflow.

Information query​

GET /se/workflow/api/view_workflow.php

Opens the SoftExpert Workflow Instance data screen

Query parametersTypeRequiredDescription
workflowidStringYesSoftExpert Workflow instance ID #

This API is used to open the data screen of a specific SoftExpert Workflow instance. To use it, you will need to enter the value of the workflowid parameter, which is the unique ID # of the workflow instance you wish to query.

To call the API, you will need to send a GET request to the https://my-domain.softexpert.com/se/workflow/api/new_workflow.php URL, passing the workflowid parameter as part of the URL query string. For example: https://my-domain.softexpert.com/se/workflow/api/view_workflow.php?workflowid=1234

When the API is successfully called, the SoftExpert Workflow instance data screen will open, allowing you to view the information associated with the instance, such as current workflow status, finished activities, pending activities, etc.

caution

Make sure the user is authenticated before calling any API documented in this section, or you will not be able to use the API.