Invoking REST Services Example Flow Chart

Invoking REST Services Example Flow Chart

This example illustrates how to invoke a REST service on a remote system using Flux. The Rest Action has only one required property: baseURL, which specifies the location of the HTTP service to invoke. Arguments can be passed to the REST service and the REST service can also return values that can be used in the flow chart.

  Screen_Shot_2022-03-08_at_10.34.53_AM.png

The above screenshot illustrates a Rest Action which invokes a website that returns your IP address, http://ip.jsontest.com/

The result returned from the REST service is of type RestAction.RestActionResult. The Rest Action postscript maps result.result to a flow context variable "ipaddress".

       

Variable substitution is used in the Console Action to display the value of the quote flow context variable.

       Screen_Shot_2022-03-08_at_10.38.32_AM.png

Running this Example

Getting Started

To get started, start your engine using the start-engine script and start your Operations Console by running the start-opsconsole script.

Once you have the Flux Operations console running, open the example ffc file, which can be downloaded here: GetIPAddress.ffc

To open this example, browse to the "Repository" tab of the Flux Operations Console and click the "Import" button, then open GetIPAddress.ffc from the file viewer that opens. 

 

Screen_Shot_2022-03-07_at_3.56.14_PM.png

Running the Example Flow Chart

Next, export your flow chart to the engine. You can do this by hovering your mouse over the "Workflow" tab near the top left of the screen clicking on the “Submit/Execute” button. You can also start it using the keyboard shortcut, Ctrl+E. 

       Screen_Shot_2022-03-08_at_9.17.25_AM.png

A confirmation window will appear if the job was successfully exported. If there is an error message, contact support@flux.ly for assistance.

The example will display output on the Flux engine console, similar to the screen shown below.

       Screen_Shot_2022-03-08_at_10.49.33_AM.png

Once this example is completed, you can shutdown your server by running the “shutdown-engine” batch or shell file within your Flux installation directory, depending upon which platform you are running Flux on.

     

Summary

The Rest Action is especially useful when integrating Flux with systems that are not Java-based. You can use Flux to communicate with these systems easily using the Rest Action.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.