-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Used oms-rest service runner to call the OMS rest api. Also reduced s…
…ervice transaction timeout from 3600 tp 120
- Loading branch information
1 parent
211c15c
commit 4622b45
Showing
3 changed files
with
4 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 1 addition & 34 deletions
35
service/co/hotwax/order/routing/InventoryReservationServices.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://moqui.org/xsd/service-definition-3.xsd"> | ||
|
||
<service verb="run" noun="OmsApi" type="interface"> | ||
<in-parameters> | ||
<parameter name="token"/> | ||
<parameter name="omsBaseUrl"/> | ||
</in-parameters> | ||
</service> | ||
<service verb="run" noun="OmsFacilityAllocation" type="remote-rest" location="${omsBaseUrl}/api/service/orderFulfillmentAllocation?token=${token}" method="post" transaction-timeout="3600"> | ||
<implements service="co.hotwax.order.routing.InventoryReservationServices.run#OmsApi"/> | ||
<service verb="run" noun="FacilityAllocation" type="oms-rest" location="service/orderFulfillmentAllocation" method="post" transaction-timeout="120"> | ||
<in-parameters> | ||
<parameter name="facilityAllocation" type="List"/> | ||
<parameter name="orderId"/> | ||
</in-parameters> | ||
</service> | ||
<service verb="run" noun="FacilityAllocation" transaction-timeout="3600"> | ||
<in-parameters> | ||
<parameter name="facilityAllocation" type="List" required="true"/> | ||
<parameter name="orderId" required="true"/> | ||
</in-parameters> | ||
<out-parameters> | ||
<parameter name="result"/> | ||
</out-parameters> | ||
<actions> | ||
<!-- In case of schedule job run no user logged in, use system user to get the token--> | ||
<set field="userName" from="ec.user.username" default-value="${System.getProperty('default.brokering.user')}"/> | ||
<script> | ||
omsBaseUrl = co.hotwax.util.MaargUtil.getOmsInstanceUrl(ec.ecfi); | ||
token = co.hotwax.util.MaargUtil.getOmsJwtToken(ec.ecfi, userName); | ||
</script> | ||
<if condition="!token"> | ||
<return error="true" message="Unable to generate oms token, check JWT configuration"/> | ||
</if> | ||
<if condition="!omsBaseUrl"> | ||
<return error="true" message="OMS base url not found"/> | ||
</if> | ||
<service-call name="co.hotwax.order.routing.InventoryReservationServices.run#OmsFacilityAllocation" transaction-timeout="3600" | ||
in-map="[orderId: orderId, token: token, facilityAllocation: facilityAllocation]" transaction="force-new" | ||
out-map="result"/> | ||
</actions> | ||
</service> | ||
</services> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters