Welcome Guest! Log in


When a Stambia Web Service is invoked through the HTTP REST API, parameters can be transmitted directly in the URL's Path.

For instance: http://stambia:42200/rest/StambiaDeliveryService/2/myDelivery/id/3

In this example, 'id' and '3' are the URL Parameters we are talking about.

They can be retrieved and used in the Web Service's Process as explained below.

Prerequisites:
  • This is only available for the HTTP REST API
  • Stambia DI Runtime S17.3.0 or higher


Configuration of the Process

Creation of the Process Parameters

First, create the Process Parameters that will receive the values of the URL Parameters.

Design them as usual, and set a default value to avoid the case where it wouldn't be provided by the user.

1.parameterCreation

 

Configuration of the META-INF

Next, lead to the main Process Properties, and open the Meta-Inf tab.

Add in the box the following sample of code and replace it with your own settings:

<httpRestWebServiceProperties extractRequestInfo="true">
     <urlPartMapper urlPartPosition="1" parameterName="My_Url_Parameter_01"/>
</httpRestWebServiceProperties>

 

Attribute Description  Example
urlPartPosition The position of the Process Parameter in the URL. In the example of URL provided earlier, a position of '1' would retrieved the 'id' value, and a position of the '2' the '3' value.
parameterName The name of the Process Parameter in which the value should be loaded. My_Url_Parameter_01

You can put as many <urlPartMapper /> node as needed:

<httpRestWebServiceProperties extractRequestInfo="true">
    <urlPartMapper urlPartPosition="1" parameterName="My_Url_Parameter_01"/>
    <urlPartMapper urlPartPosition="2" parameterName="My_Url_Parameter_02"/>
    <urlPartMapper urlPartPosition="3" parameterName="My_Url_Parameter_03"/>
</httpRestWebServiceProperties>

 

Using the parameters in the Process

That's it, from now at each invocation the Process Parameters will be filled with the URL Parameters provided by the user calling the Web Service.

You can then use the Process Parameters as usual in your flow.

 

You have no rights to post comments

Articles

Suggest a new Article!