Microservice Step

Use this step to run a microservice.

Last published at: September 22nd, 2024

Description:

This step runs a FlowWright Microservice. 

 

Inputs

  • selMicroService: Select microservice from dropdown. 
  • ParamsMapping: Mapping of inputs & output params fields.
 

 

Returns

  • True – step executed successfully
  • False – step failed to execute
 

      

Usage:

 

 

Example:

Let’s build a workflow called “Add2NosDef” to sum two numbers, for example.            

  • Navigate to the Create - Process Definition page. 
  • Create a new definition called “Add2NosDef”
  • Select the definition and click the “design” button
  • Drag a "evalExpression" step to the canvas
  • Connect the dots between the start and “evalExpression” step as shown below

 

 

  • Click the “evalExpression” step to configure its “Settings” properties. Give the step a name. Provide the expression to evaluate. Provide a variable/global to store the expression result. Click the Save button to confirm. 

 

  • Save the process definition. The process step should execute the “evalExpression” step and store the result in the variable/global configured.

 

Let’s build a microservice, “AddTwoNumbers," for example.            

  • Navigate to the Integration - Microservices page. 
  • Click on the Actions - Create menu option to create a microservice. Provide a name to the microservice. Provide the description. Configure the HTTP method, Authentication, and Logging function as shown below. Select the workflow definition “Add2NosDef” from the drop-down list. Configure the Process Instance to ON to save the instance.  Select the Variables or Globals filter to map the input values. Provide the variable/global name and the description. Click the Add button to confirm. You may repeat this activity to include more variables/globals for the input. Likewise, select the Variables or Globals filter to map the output values. Provide the variable/global name and the description. Click the Add button to confirm. You may repeat this activity to include more variables/globals for the output. Click the Save button to confirm. 

 

 

You must build the microservice before using it. On the Manage Mircoserivce page, select the microservice from the list and click on the API - Build menu option. The microservice is built in the background, and the application restarts. You'll need to log in again to continue. The build log errors are available in the Build Log menu option. 

 

Let’s build and execute the “clsMicroServiceDef” step example.            

  • Create a new definition called “clsMicroServiceDef”
  • Select the definition and click the “design” button
  • Drag a "clsMicroService" step to the canvas
  • As below, connect the dots between the start and “clsMicroservice” step. 

 

 

 

  • Click the button to configure the input/output mapping of parameters and values. Provide variable/global references to the input and output parameters. Click on “Save” to confirm the changes.  

 

  • Save the process definition, create a new process instance, and execute. The process step should execute the microservice of “AddingTwoNumbers” and store the output in the variable/global configured in the output params.

 

Definition Sample:

You may download the sample definition(s) from the link here and later import it (drag-drop) to your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.

NOTE: Please verify and complete the process steps for any missing configurations, such as file path references and database connections after import. Then, save the definition to confirm the changes.

 

Workflow example to Add 2 Numbers

Click here to download the sample file.

 

Microservice example, which executes a workflow to Add 2 Numbers

Click here to download the sample file.

 

Workflow example with “clsMicroService” step to execute a Microservice

Click here to download the sample file.