Integrating IBM Sterling Order Management System with Store Inventory Management microservice
Use the SIMInvokeRestAPI service to call the Store Inventory
Management
REST APIs from Sterling
Order Management System.
SIMInvokeRestAPI
service.<SIMApi HTTPMethod="GET" URL="/stores/Mtrx_Store_1/locations/BackShelf-5">
<RequestHeaders>
<Header Name="Accept" Value="application/json"/>
<Header Name="Content-Type" Value="application/json"/>
</RequestHeaders>
<Template>
<Location></Location>
</Template>
</SIMApi>
Here, the HTTPMethod attribute can be a valid HTTP method such as GET, POST,
PUT, DELETE, and PATCH. The URL attribute is a relative URL of the REST API. For example, if the
complete URL of the HTTP API is
https://<host-ip>:8080/<tenant-id>/v1/stores/Node1/locations/BackShelf-5,
the relative URL is /stores/Node1/locations/BackShelf-5. To set all the request
headers, use the RequestHeaders element as illustrated in the sample input.
When the HTTP methods POST, PUT, DELETE, and PATCH are used, you can send the request body as part
of the input by using the RequestBody element. For more information about the
RequestBody element, see the sample input. Use
the Template element to specify the root element name of the
SIMInvokeRestAPI service. If you do not define a template, the default
<Entity> root element is inserted in the output XML.
<Location
aisle=""
bay=""
bin="false"
depth=""
height=""
id="a91c7099-4dc8-4195-91f6-e33a132c0c3a"
length=""
locationId="BackShelf-5"
name=""
parentLocationId=""
physicalSpaceIdentifier=""
sequence="0"
storeId="Mtrx_Store_1"
tenantId="Matrix-R"
type="STOCKROOM"
virtual="false"
weightLimit=""
zone=""
/>
If you want to transform the JSON output of the REST API to a particular XPath in the output, define the jsonXPathTransformations.xml file and copy the file to the class path in /resources/jsonXPathTransformations.xml file.
<SIMApi HTTPMethod="POST" URL="/stores/Node1/locations">
<RequestBody>
<Location length="122" locationId="DockYYNew" name="new11" parentLocationId="" physicalSpaceIdentifier="" sequence="0" storeId="Store1" tenantId="T1" type="STOCKROOM" virtual="false" weightLimit="" zone="Z1"/>
</RequestBody>
<RequestHeaders>
<Header Name="Accept" Value="application/json"/>
<Header Name="Content-Type" Value="application/json"/>
</RequestHeaders>
<Template>
<Location></Location>
</Template>
</SIMApi><SIMApi HTTPMethod="PUT" URL="/stores/Store1/locations/StoreDock01">
<RequestBody>
<Location length="122" locationId="StoreDock01" name="new11" parentLocationId="" physicalSpaceIdentifier="" sequence="0" storeId="Node1" tenantId="Nisha" type="STOCKROOM" virtual="false" weightLimit="" zone="Z1"/>
</RequestBody>
<RequestHeaders>
<Header Name="Accept" Value="application/json"/>
<Header Name="Content-Type" Value="application/json"/>
</RequestHeaders>
<Template>
<Location></Location>
</Template>
</SIMApi><SIMApi HTTPMethod="POST" URL="/stores/Node1/locations/StoreDock01/inventory:add">
<RequestBody>
<product productId="202" unitOfMeasure="EACH" addQuantity="500" inventoryStatus="GOOD"/>
</RequestBody>
<RequestHeaders>
<Header Name="Accept" Value="application/json"/>
<Header Name="Content-Type" Value="application/json"/>
</RequestHeaders>
<Template>
<product></product>
</Template>
</SIMApi>
The Store Inventory Management APIs generates a JSON output. The
SIMInvokeRestAPIservice converts the JSON into an XML file. To force data conversion, use the/resources/jsonXPathTransformations.xmlfile.