blob: d611fee9aa1ca979b3c2e17c2fee6450b5e38617 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
<simple-method method-name="testPackingServices" short-description="test packing services" login-required="false">
<set field="packSingleItemInMap.productId" value="GZ-2644"/>
<set field="packSingleItemInMap.orderId" value="DEMO10090"/>
<set field="packSingleItemInMap.shipGroupSeqId" value="00001"/>
<set field="packSingleItemInMap.quantity" value="2" type="BigDecimal"/>
<set field="packSingleItemInMap.packageSeq" value="1" type="Integer"/>
<set field="packSingleItemInMap.pickerPartyId" value="DemoCustomer"/>
<set field="packSingleItemInMap.handlingInstructions" value="Handle with care"/>
<entity-one entity-name="UserLogin" value-field="userLogin" auto-field-map="false">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="packSingleItemInMap.userLogin" from-field="userLogin"/>
<create-object class-name="org.apache.ofbiz.shipment.packing.PackingSession" field="packingSession">
<field field="dispatcher" type="org.apache.ofbiz.service.LocalDispatcher"/>
<field field="userLogin" type="org.apache.ofbiz.entity.GenericValue"/>
</create-object>
<set field="packSingleItemInMap.packingSession" from-field="packingSession"/>
<call-service service-name="packSingleItem" in-map-name="packSingleItemInMap">
<results-to-map map-name="packSingleItemOutMap"/>
</call-service>
<log level="info" message="=====packSingleItemOutMap========${packSingleItemOutMap}========="/>
<set field="packBulkItemInMap.updateQuantity" value="Y" type="Boolean"/>
<set field="packBulkItemInMap.orderId" value="DEMO10090"/>
<set field="packBulkItemInMap.shipGroupSeqId" value="00001"/>
<set field="packBulkItemInMap.pickerPartyId" value="DemoCustomer"/>
<set field="packBulkItemInMap.handlingInstructions" value="Handle with care"/>
<set field="packBulkItemInMap.nextPackageSeq" value="1" type="Integer"/>
<set field="packBulkItemInMap.userLogin" from-field="userLogin"/>
<set field="packBulkItemInMap.packingSession" from-field="packingSession"/>
<call-service service-name="packBulkItems" in-map-name="packBulkItemInMap">
<results-to-map map-name="packBulkItemsResponseMap"/>
</call-service>
<log level="info" message="=====packBulkItemsResponseMap=======${packBulkItemsResponseMap}======"/>
<set field="completePackInMap.orderId" value="DEMO10090"/>
<set field="completePackInMap.packingSession" from-field="packingSession"/>
<set field="completePackInMap.handlingInstructions" value="Handle with care"/>
<set field="completePackInMap.pickerPartyId" value="DemoCustomer"/>
<set field="completePackInMap.additionalShippingCharge" value="10.0" type="BigDecimal"/>
<set field="completePackInMap.forceComplete" value="Y" type="Boolean"/>
<set field="completePackInMap.userLogin" from-field="userLogin"/>
<call-service service-name="completePack" in-map-name="completePackInMap">
<results-to-map map-name="completePackOutMap"/>
</call-service>
<log level="info" message="=======ShipmentId=======${completePackOutMap.shipmentId}===="/>
<entity-one entity-name="Shipment" value-field="shipment">
<field-map field-name="shipmentId" from-field="completePackOutMap.shipmentId"/>
</entity-one>
<assert>
<not><if-empty field="shipment"/></not>
<if-compare-field field="shipment.shipmentId" to-field="completePackOutMap.shipmentId" operator="equals"/>
</assert>
<check-errors/>
<set field="createInvFrmShipmentInMap.shipmentId" value="${completePackOutMap.shipmentId}"/>
<set field="createInvFrmShipmentInMap.userLogin" from-field="userLogin"/>
<call-service service-name="createInvoicesFromShipment" in-map-name="createInvFrmShipmentInMap">
<results-to-map map-name="createInvFrmShipmentOutMap"/>
</call-service>
<log level="info" message="=============createInvFrmShipmentOutMap===========${createInvFrmShipmentOutMap}====="/>
<set field="invoicesCreated" from-field="createInvFrmShipmentOutMap.invoicesCreated"/>
<iterate list="invoicesCreated" entry="invoiceCreated">
<entity-one entity-name="Invoice" value-field="invoice">
<field-map field-name="invoiceId" from-field="invoiceCreated"/>
</entity-one>
<assert>
<not><if-empty field="invoice"/></not>
</assert>
<check-errors/>
</iterate>
<log level="info" message="=============Test case completed===================================="/>
</simple-method>
<simple-method method-name="testShipmentServices" short-description="test shipment services" login-required="false">
<set field="createShipmentInMap.shipmentTypeId" value="SALES_SHIPMENT"/>
<set field="createShipmentInMap.statusId" value="SHIPMENT_INPUT"/>
<set field="createShipmentInMap.primaryOrderId" value="DEMO10090"/>
<set field="createShipmentInMap.partyIdTo" value="DemoCustomer"/>
<set field="createShipmentInMap.originFacilityId" value="WebStoreWarehouse"/>
<entity-one entity-name="UserLogin" value-field="userLogin" auto-field-map="false">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="createShipmentInMap.userLogin" from-field="userLogin"/>
<call-service service-name="createShipment" in-map-name="createShipmentInMap">
<results-to-map map-name="createShipmentOutMap"/>
</call-service>
<log level="info" message="==========Shipment Id============${createShipmentOutMap.shipmentId}=========="/>
<set field="updateShipmentInMap.shipmentId" from-field="createShipmentOutMap.shipmentId"/>
<set field="updateShipmentInMap.statusId" value="SHIPMENT_PACKED"/>
<set field="updateShipmentInMap.userLogin" from-field="userLogin"/>
<call-service service-name="updateShipment" in-map-name="updateShipmentInMap">
<results-to-map map-name="updateShipmentOutMap"/>
</call-service>
<set field="updateShipmentInMap.shipmentId" from-field="createShipmentOutMap.shipmentId"/>
<set field="updateShipmentInMap.statusId" value="SHIPMENT_SHIPPED"/>
<set field="updateShipmentInMap.userLogin" from-field="userLogin"/>
<call-service service-name="updateShipment" in-map-name="updateShipmentInMap">
<results-to-map map-name="updateShipmentOutMap"/>
</call-service>
<log level="info" message="=============Update Shipment Id=============${updateShipmentOutMap.shipmentId}========================="/>
<entity-one entity-name="Shipment" value-field="shipment">
<field-map field-name="shipmentId" from-field="updateShipmentOutMap.shipmentId"/>
</entity-one>
<assert>
<not><if-empty field="shipment"/></not>
<if-compare-field field="shipment.shipmentId" to-field="updateShipmentOutMap.shipmentId" operator="equals"/>
<if-compare-field field="shipment.statusId" to-field="updateShipmentInMap.statusId" operator="equals"/>
</assert>
<check-errors/>
<set field="sendShipmentCompleteNotificationInMap.shipmentId" from-field="updateShipmentOutMap.shipmentId"/>
<set field="sendShipmentCompleteNotificationInMap.userLogin" from-field="userLogin"/>
<call-service service-name="sendShipmentCompleteNotification" in-map-name="sendShipmentCompleteNotificationInMap">
<results-to-map map-name="sendShipmentCompleteNotificationOutMap"/>
</call-service>
<log level="info" message="=============Shipment Notification ===========${sendShipmentCompleteNotificationOutMap}========="/>
<log level="info" message="=============Test case completed===================================="/>
</simple-method>
<simple-method method-name="testReceiveInventoryNonSerialized" short-description="Test Receive Non-Serialized Inventory" login-required="false">
<now-timestamp field="nowTimeStamp"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<set field="serviceCtx.facilityId" value="WebStoreWarehouse"/>
<set field="serviceCtx.productId" value="GZ-2644"/>
<set field="serviceCtx.quantityAccepted" value="5" type="BigDecimal"/>
<set field="serviceCtx.quantityRejected" value="0" type="BigDecimal"/>
<set field="serviceCtx.unitCost" value="24" type="BigDecimal"/>
<set field="serviceCtx.inventoryItemTypeId" value="NON_SERIAL_INV_ITEM"/>
<set field="serviceCtx.datetimeReceived" from-field="nowTimeStamp"/>
<call-service service-name="receiveInventoryProduct" in-map-name="serviceCtx">
<result-to-field field="inventoryItemId" result-name="inventoryItemId"/>
</call-service>
<entity-one entity-name="InventoryItem" value-field="inventoryItem"/>
<get-related value-field="inventoryItem" relation-name="InventoryItemDetail" list="inventoryItemDetails"/>
<entity-condition entity-name="ShipmentReceipt" list="shipmentReceipts">
<condition-expr field-name="inventoryItemId" from-field="inventoryItemId"/>
<order-by field-name="datetimeReceived"/>
</entity-condition>
<first-from-list list="shipmentReceipts" entry="shipmentReceipt"/>
<assert>
<not><if-empty field="inventoryItem"></if-empty></not>
<not><if-empty field="inventoryItemDetails"></if-empty></not>
<not><if-empty field="shipmentReceipt"></if-empty></not>
<if-compare-field field="inventoryItem.productId" operator="equals" to-field="serviceCtx.productId"/>
<if-compare-field field="inventoryItem.facilityId" operator="equals" to-field="serviceCtx.facilityId"/>
<if-compare-field field="inventoryItem.quantityOnHandTotal" operator="equals" to-field="serviceCtx.quantityAccepted"/>
<if-compare-field field="inventoryItem.availableToPromiseTotal" operator="equals" to-field="serviceCtx.quantityAccepted"/>
<if-compare-field field="shipmentReceipt.quantityAccepted" operator="equals" to-field="serviceCtx.quantityAccepted"/>
<if-compare-field field="shipmentReceipt.productId" operator="equals" to-field="serviceCtx.productId"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateShipmentRouteSegment" short-description="Test to create Shipment Route Segment" login-required="false">
<log level="info" message="====================Create a Shipment Route Segment test case=========================================="/>
<entity-and entity-name="Shipment" list="shipments">
<field-map field-name="primaryOrderId" value="DEMO10090"/>
<field-map field-name="shipmentId" value="9998"/>
</entity-and>
<first-from-list list="shipments" entry="shipment"/>
<set field="shipRouteSegMap.shipmentId" from-field="shipment.shipmentId"/>
<entity-one entity-name="UserLogin" value-field="shipRouteSegMap.userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<call-service service-name="createShipmentRouteSegment" in-map-name="shipRouteSegMap">
<result-to-field result-name="shipmentRouteSegmentId" field="routeSegMap.shipmentRouteSegmentId"/>
</call-service>
<entity-one entity-name="ShipmentRouteSegment" value-field="shipmentRouteSegment">
<field-map field-name="shipmentId" from-field="shipRouteSegMap.shipmentId"/>
<field-map field-name="shipmentRouteSegmentId" from-field="routeSegMap.shipmentRouteSegmentId"/>
</entity-one>
<assert>
<not><if-empty field="shipmentRouteSegment"/></not>
<if-compare-field field="shipmentRouteSegment.shipmentId" to-field="shipRouteSegMap.shipmentId" operator="equals"/>
<if-compare-field field="shipmentRouteSegment.shipmentRouteSegmentId" to-field="routeSegMap.shipmentRouteSegmentId" operator="equals"/>
</assert>
<check-errors/>
</simple-method>
</simple-methods>