svn commit: r1866286 - in /ofbiz/ofbiz-framework/trunk/applications/product: config/ minilang/shipment/issuance/ minilang/shipment/receipt/ minilang/shipment/shipment/ servicedef/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1866286 - in /ofbiz/ofbiz-framework/trunk/applications/product: config/ minilang/shipment/issuance/ minilang/shipment/receipt/ minilang/shipment/shipment/ servicedef/

nmalin
Author: nmalin
Date: Mon Sep  2 15:13:47 2019
New Revision: 1866286

URL: http://svn.apache.org/viewvc?rev=1866286&view=rev
Log:
Improved: Convert Shipment Crud simple service to entity-auto
(OFBIZ-6996)
I converted all available shipment entities crud currently on simple service to entity-auto service :
 * ItemIssuanceRole
 * ShipmentItem
 * ShipmentPackageContent
 * ShipmentPackageRouteSeg
 * ShipmentRouteSegment
 * QuantityBreak

I also transformed a simple method call to a permission service: checkCanChangeShipmentStatus, who check for a shipment is it on good status for the change.
With this last conversion, the permission control set on the service definition instead of core service

Modified:
    ofbiz/ofbiz-framework/trunk/applications/product/config/ProductErrorUiLabels.xml
    ofbiz/ofbiz-framework/trunk/applications/product/minilang/shipment/issuance/IssuanceServices.xml
    ofbiz/ofbiz-framework/trunk/applications/product/minilang/shipment/receipt/ShipmentReceiptServices.xml
    ofbiz/ofbiz-framework/trunk/applications/product/minilang/shipment/shipment/ShipmentServices.xml
    ofbiz/ofbiz-framework/trunk/applications/product/servicedef/secas_shipment.xml
    ofbiz/ofbiz-framework/trunk/applications/product/servicedef/services_shipment.xml

Modified: ofbiz/ofbiz-framework/trunk/applications/product/config/ProductErrorUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/config/ProductErrorUiLabels.xml?rev=1866286&r1=1866285&r2=1866286&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/config/ProductErrorUiLabels.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/config/ProductErrorUiLabels.xml Mon Sep  2 15:13:47 2019
@@ -1489,6 +1489,10 @@
         <value xml:lang="zh">创建快速添加变型数据时发生交易错误:${errMessage}。</value>
         <value xml:lang="zh-TW">新建快速增加變型資料時發生交易錯誤: ${errMessage}.</value>
     </property>
+    <property key="ShipmentCanChangeStatusPermissionError">
+        <value xml:lang="en">Cannot perform this operation when the shipment [${testShipment.shipmentId}] is in the ${testShipmentStatus.description} [${testShipment.statusId}] status."</value>
+        <value xml:lang="fr">Impossible de réaliser l'opération demandée quand l'expédition [${testShipment.shipmentId}] est dans le statut ${testShipmentStatus.description} [${testShipment.statusId}]</value>
+    </property>
     <property key="variantevents.variantProductId_required_but_missing_enter_an_id">
         <value xml:lang="de">variantProductId wir benötigt, fehlt aber, bitte geben Sie eine ID für die neue Produktvariante an.</value>
         <value xml:lang="en">variantProductId is required but missing, please enter an id for the new variant product.</value>

Modified: ofbiz/ofbiz-framework/trunk/applications/product/minilang/shipment/issuance/IssuanceServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/minilang/shipment/issuance/IssuanceServices.xml?rev=1866286&r1=1866285&r2=1866286&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/minilang/shipment/issuance/IssuanceServices.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/minilang/shipment/issuance/IssuanceServices.xml Mon Sep  2 15:13:47 2019
@@ -22,10 +22,6 @@ under the License.
         xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
     <!-- ItemIssuance services -->
     <simple-method method-name="createItemIssuance" short-description="Create ItemIssuance">
-        <set value="Create ItemIssuance" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked" xml-resource="component://product/minilang/shipment/shipment/ShipmentServices.xml"/>
-        <check-errors/>
-
         <make-value entity-name="ItemIssuance" value-field="newEntity"/>
         <sequenced-id sequence-name="ItemIssuance" field="newEntity.itemIssuanceId"/>
         <field-to-result field="newEntity.itemIssuanceId" result-name="itemIssuanceId"/>
@@ -64,48 +60,9 @@ under the License.
         </if-not-empty>
         <field-to-result field="affectAccounting" result-name="affectAccounting"/>
     </simple-method>
-    <simple-method method-name="updateItemIssuance" short-description="Update ItemIssuance">
-        <set value="Update ItemIssuance" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked" xml-resource="component://product/minilang/shipment/shipment/ShipmentServices.xml"/>
-        <check-errors/>
-
-        <entity-one entity-name="ItemIssuance" value-field="lookedUpValue"/>
-        <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
-        <store-value value-field="lookedUpValue"/>
-    </simple-method>
-    <simple-method method-name="deleteItemIssuance" short-description="Delete ItemIssuance">
-        <set value="Delete ItemIssuance" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked" xml-resource="component://product/minilang/shipment/shipment/ShipmentServices.xml"/>
-        <check-errors/>
-
-        <entity-one entity-name="ItemIssuance" value-field="lookedUpValue"/>
-        <remove-value value-field="lookedUpValue"/>
-    </simple-method>
-
-    <!-- ItemIssuanceRole services -->
-    <simple-method method-name="createItemIssuanceRole" short-description="Create ItemIssuanceRole">
-        <set value="Create ItemIssuanceRole" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked" xml-resource="component://product/minilang/shipment/shipment/ShipmentServices.xml"/>
-        <check-errors/>
-        <make-value entity-name="ItemIssuanceRole" value-field="newEntity"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-        <create-value value-field="newEntity"/>
-    </simple-method>
-
-    <simple-method method-name="deleteItemIssuanceRole" short-description="Delete ItemIssuanceRole">
-        <set value="Delete ItemIssuanceRole" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked" xml-resource="component://product/minilang/shipment/shipment/ShipmentServices.xml"/>
-        <check-errors/>
-        <entity-one entity-name="ItemIssuanceRole" value-field="lookedUpValue"/>
-        <remove-value value-field="lookedUpValue"/>
-    </simple-method>
 
     <!-- the actual issuance services -->
     <simple-method method-name="issueOrderItemToShipment" short-description="Issue OrderItem to Shipment">
-        <set value="Issue OrderItem to Shipment" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked" xml-resource="component://product/minilang/shipment/shipment/ShipmentServices.xml"/>
-        <check-errors/>
 
         <!-- get orderHeader -->
         <entity-one entity-name="OrderHeader" value-field="orderHeader" auto-field-map="true"/>
@@ -132,9 +89,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="issueOrderItemShipGrpInvResToShipment" short-description="Issue OrderItemShipGrpInvRes to Shipment">
-        <set value="Issue OrderItemShipGrpInvRes to Shipment" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked" xml-resource="component://product/minilang/shipment/shipment/ShipmentServices.xml"/>
-        <check-errors/>
 
         <!-- get orderItemShipGrpInvRes -->
         <make-value entity-name="OrderItemShipGrpInvRes" value-field="OrderItemShipGrpInvResLookupPk"/>
@@ -464,7 +418,7 @@ under the License.
         <field-to-result field="itemIssuanceId"/>
     </simple-method>
     <simple-method method-name="associateIssueRoles" short-description="Associate Roles for ItemIssuance - meant to be called in-line">
-        <!-- make sure the party is in the PACKER role -->
+        <!-- make sure the party is in the PACKER role TODO need to replace by ensurePartyRole-->
         <make-value entity-name="PartyRole" value-field="partyRole"/>
         <set field="partyRole.partyId" from-field="userLogin.partyId"/>
         <set field="partyRole.roleTypeId" value="PACKER"/>
@@ -565,8 +519,9 @@ under the License.
         <!-- issuance can be canceled only if the sales shipment is not packed -->
 
         <if-compare field="shipment.statusId" operator="not-equals" value="SHIPMENT_CANCELLED">
-            <set from-field="itemIssuance.shipmentId" field="shipmentId"/>
-            <call-simple-method method-name="checkCanChangeShipmentStatusPacked" xml-resource="component://product/minilang/shipment/shipment/ShipmentServices.xml"/>
+            <set from-field="itemIssuance.shipmentId" field="checkCanChangeShipmentStatusPackedMap.shipmentId"/>
+            <set value="UPDATE" field="checkCanChangeShipmentStatusPackedMap.mainAction"/>
+            <call-service service-name="checkCanChangeShipmentStatusPacked" in-map-name="checkCanChangeShipmentStatusPackedMap" />
             <check-errors/>
         </if-compare>
 

Modified: ofbiz/ofbiz-framework/trunk/applications/product/minilang/shipment/receipt/ShipmentReceiptServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/minilang/shipment/receipt/ShipmentReceiptServices.xml?rev=1866286&r1=1866285&r2=1866286&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/minilang/shipment/receipt/ShipmentReceiptServices.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/minilang/shipment/receipt/ShipmentReceiptServices.xml Mon Sep  2 15:13:47 2019
@@ -361,9 +361,6 @@ under the License.
     </simple-method>
     
     <simple-method method-name="issueOrderItemToShipmentAndReceiveAgainstPO" short-description="Issues order item quantity specified to the shipment, then receives inventory for that item and quantity">
-        <set value="Issue OrderItem to Shipment and Receive against PO" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked" xml-resource="component://product/minilang/shipment/shipment/ShipmentServices.xml"/>
-        <check-errors/>
 
         <!-- get orderItem -->
         <entity-one entity-name="OrderItem" value-field="orderItem" auto-field-map="true"/>

Modified: ofbiz/ofbiz-framework/trunk/applications/product/minilang/shipment/shipment/ShipmentServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/minilang/shipment/shipment/ShipmentServices.xml?rev=1866286&r1=1866285&r2=1866286&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/minilang/shipment/shipment/ShipmentServices.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/minilang/shipment/shipment/ShipmentServices.xml Mon Sep  2 15:13:47 2019
@@ -112,9 +112,6 @@ under the License.
     </simple-method>
     
     <simple-method method-name="updateShipment" short-description="Update Shipment">
-        <set value="Update Shipment" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusDelivered"/>
-        <check-errors/>
 
         <make-value entity-name="Shipment" value-field="lookupPKMap"/>
         <set-pk-fields map="parameters" value-field="lookupPKMap"/>
@@ -283,14 +280,6 @@ under the License.
         <store-value value-field="lookedUpValue"/>
     </simple-method>
 
-    <simple-method method-name="deleteShipment" short-description="Delete Shipment">
-        <set value="Delete Shipment" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked"/>
-        <check-errors/>
-        <entity-one entity-name="Shipment" value-field="lookedUpValue"/>
-        <remove-value value-field="lookedUpValue"/>
-    </simple-method>
-
     <simple-method method-name="createShipmentForReturn" short-description="Create Shipment based on ReturnHeader">
         <entity-one entity-name="ReturnHeader" value-field="returnHeader">
             <field-map field-name="returnId" from-field="parameters.returnId"/>
@@ -428,10 +417,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="setShipmentSettingsFromPrimaryOrder" short-description="Set Shipment Settings From Primary Order">
-        <set value="Set Shipment Settings From Primary Order" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked"/>
-        <check-errors/>
-
         <!-- on Shipment set partyIdFrom, partyIdTo (vendorPartyId), originContactMechId, destinationContactMechId, estimatedShipCost -->
         <entity-one entity-name="Shipment" value-field="shipment"/>
 
@@ -670,12 +655,7 @@ under the License.
     </simple-method>
 
     <simple-method method-name="setShipmentSettingsFromFacilities" short-description="Set Shipment Settings From Facilities">
-        <set value="Set Shipment Settings From Facilities" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked"/>
-        <check-errors/>
-
         <entity-one entity-name="Shipment" value-field="shipment"/>
-
         <clone-value value-field="shipment" new-value-field="shipmentCopy"/>
 
         <string-to-list string="-fromDate" list="descendingFromDateOrder"/>
@@ -817,35 +797,8 @@ under the License.
     </simple-method>
 
     <!-- ShipmentItem services -->
-    <simple-method method-name="createShipmentItem" short-description="Create ShipmentItem">
-        <set value="Create ShipmentItem" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked"/>
-        <check-errors/>
-
-        <make-value entity-name="ShipmentItem" value-field="newEntity"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-        <!-- if no shipmentItemSeqId, generate one based on existing items, ie one greater than the current higher number -->
-        <make-next-seq-id value-field="newEntity" seq-field-name="shipmentItemSeqId"/>
-        <field-to-result field="newEntity.shipmentItemSeqId" result-name="shipmentItemSeqId"/>
-        <create-value value-field="newEntity"/>
-    </simple-method>
-    <simple-method method-name="updateShipmentItem" short-description="Update ShipmentItem">
-        <set value="Update ShipmentItem" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked"/>
-        <check-errors/>
-
-        <make-value entity-name="ShipmentItem" value-field="lookupPKMap"/>
-        <set-pk-fields map="parameters" value-field="lookupPKMap"/>
-        <find-by-primary-key entity-name="ShipmentItem" map="lookupPKMap" value-field="lookedUpValue"/>
-        <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
-        <store-value value-field="lookedUpValue"/>
-    </simple-method>
     <simple-method method-name="deleteShipmentItem" short-description="Delete ShipmentItem">
-        <set value="Delete ShipmentItem" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked"/>
-        <check-errors/>
-        <!-- If there is any Shipment Package Content available for this Shipment Item then it cannot be deleted as it require
+        <!-- If there is any Shipment Package Content available for this Shipment Item then it cannot be deleted as it require
                 Shipment Package content to be deleted first -->
         <entity-and entity-name="ShipmentPackageContent" list="shipmentPackageContents">
             <field-map field-name="shipmentId" from-field="parameters.shipmentId"/>
@@ -946,10 +899,6 @@ under the License.
 
     <!-- ShipmentPackage services -->
     <simple-method method-name="createShipmentPackage" short-description="Create ShipmentPackage">
-        <set value="Create ShipmentPackage" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked"/>
-        <check-errors/>
-
         <make-value entity-name="ShipmentPackage" value-field="newEntity"/>
         <set-pk-fields map="parameters" value-field="newEntity"/>
         <set-nonpk-fields map="parameters" value-field="newEntity"/>
@@ -971,10 +920,6 @@ under the License.
         <call-simple-method method-name="ensurePackageRouteSeg"/>
     </simple-method>
     <simple-method method-name="updateShipmentPackage" short-description="Update ShipmentPackage">
-        <set value="Update ShipmentPackage" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusShipped"/>
-        <check-errors/>
-
         <make-value entity-name="ShipmentPackage" value-field="lookupPKMap"/>
         <set-pk-fields map="parameters" value-field="lookupPKMap"/>
         <find-by-primary-key entity-name="ShipmentPackage" map="lookupPKMap" value-field="lookedUpValue"/>
@@ -986,9 +931,6 @@ under the License.
         <call-simple-method method-name="ensurePackageRouteSeg"/>
     </simple-method>
     <simple-method method-name="deleteShipmentPackage" short-description="Delete ShipmentPackage">
-        <set value="Delete ShipmentPackage" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked"/>
-        <check-errors/>
         <!-- If there is any Shipment Package Content available for this shipment than Shipment Package cannot be deleted as it require
              Shipment Package Content to be deleted first -->
         <entity-and entity-name="ShipmentPackageContent" list="shipmentPackageContents">
@@ -1029,43 +971,7 @@ under the License.
     </simple-method>
 
     <!-- ShipmentPackageContent services -->
-    <simple-method method-name="createShipmentPackageContent" short-description="Create ShipmentPackageContent">
-        <set value="Create ShipmentPackageContent" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked"/>
-        <check-errors/>
-
-        <make-value entity-name="ShipmentPackageContent" value-field="newEntity"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-
-        <create-value value-field="newEntity"/>
-        <field-to-result field="newEntity.shipmentPackageSeqId" result-name="shipmentPackageSeqId"/>
-    </simple-method>
-    <simple-method method-name="updateShipmentPackageContent" short-description="Update ShipmentPackageContent">
-        <set value="Update ShipmentPackageContent" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked"/>
-        <check-errors/>
-
-        <make-value entity-name="ShipmentPackageContent" value-field="lookupPKMap"/>
-        <set-pk-fields map="parameters" value-field="lookupPKMap"/>
-        <find-by-primary-key entity-name="ShipmentPackageContent" map="lookupPKMap" value-field="lookedUpValue"/>
-        <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
-        <store-value value-field="lookedUpValue"/>
-    </simple-method>
-    <simple-method method-name="deleteShipmentPackageContent" short-description="Delete ShipmentPackageContent">
-        <set value="Delete ShipmentPackageContent" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked"/>
-        <check-errors/>
-
-        <make-value entity-name="ShipmentPackageContent" value-field="lookupPKMap"/>
-        <set-pk-fields map="parameters" value-field="lookupPKMap"/>
-        <find-by-primary-key entity-name="ShipmentPackageContent" map="lookupPKMap" value-field="lookedUpValue"/>
-        <remove-value value-field="lookedUpValue"/>
-    </simple-method>
     <simple-method method-name="addShipmentContentToPackage" short-description="Add Shipment Content To Package">
-        <set value="Create ShipmentPackageContent" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked"/>
-        <check-errors/>
         <make-value entity-name="ShipmentPackageContent" value-field="newEntity"/>
         <set-pk-fields map="parameters" value-field="newEntity"/>
         <find-by-primary-key value-field="shipmentPackageContent" map="newEntity"/>
@@ -1089,86 +995,16 @@ under the License.
         <field-to-result field="newEntity.shipmentPackageSeqId" result-name="shipmentPackageSeqId"/>
     </simple-method>
 
-    <!-- ShipmentPackageRouteSeg services -->
-    <simple-method method-name="createShipmentPackageRouteSeg" short-description="Create ShipmentPackageRouteSeg">
-        <make-value entity-name="ShipmentPackageRouteSeg" value-field="newEntity"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-
-        <create-value value-field="newEntity"/>
-    </simple-method>
-    <simple-method method-name="deleteShipmentPackageRouteSeg" short-description="Delete ShipmentPackageRouteSeg">
-        <set value="Delete ShipmentPackageRouteSeg" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked"/>
-        <check-errors/>
-
-        <make-value entity-name="ShipmentPackageRouteSeg" value-field="lookupPKMap"/>
-        <set-pk-fields map="parameters" value-field="lookupPKMap"/>
-        <find-by-primary-key entity-name="ShipmentPackageRouteSeg" map="lookupPKMap" value-field="lookedUpValue"/>
-        <remove-value value-field="lookedUpValue"/>
-    </simple-method>
-
     <!-- ShipmentRouteSegment services -->
-    <simple-method method-name="createShipmentRouteSegment" short-description="Create ShipmentRouteSegment">
-        <set value="Create ShipmentRouteSegment" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked"/>
-        <check-errors/>
-
-        <make-value entity-name="ShipmentRouteSegment" value-field="newEntity"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-
-        <!-- if no shipmentRouteSegmentSeqId, generate one based on existing items, ie one greater than the current higher number -->
-        <make-next-seq-id value-field="newEntity" seq-field-name="shipmentRouteSegmentId"/>
-        <field-to-result field="newEntity.shipmentRouteSegmentId" result-name="shipmentRouteSegmentId"/>
-
-        <if-empty field="newEntity.carrierServiceStatusId">
-            <set value="SHRSCS_NOT_STARTED" field="newEntity.carrierServiceStatusId"/>
-        </if-empty>
-
-        <create-value value-field="newEntity"/>
-
-        <set from-field="newEntity.shipmentId" field="shipmentId"/>
-        <set from-field="newEntity.shipmentRouteSegmentId" field="shipmentRouteSegmentId"/>
-        <call-simple-method method-name="ensureRouteSegPackage"/>
-    </simple-method>
-    <simple-method method-name="updateShipmentRouteSegment" short-description="Update ShipmentRouteSegment">
-        <set value="Update ShipmentRouteSegment" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusDelivered"/>
-        <check-errors/>
-
-        <entity-one entity-name="ShipmentRouteSegment" value-field="lookedUpValue"/>
-        <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
-
-        <if-empty field="newEntity.carrierServiceStatusId">
-            <set value="SHRSCS_NOT_STARTED" field="newEntity.carrierServiceStatusId"/>
-        </if-empty>
-
-
-        <set from-field="userLogin.userLoginId" field="lookedUpValue.updatedByUserLoginId"/>
-        <now-timestamp field="lookedUpValue.lastUpdatedDate"/>
-        <store-value value-field="lookedUpValue"/>
-
-        <set from-field="lookedUpValue.shipmentId" field="shipmentId"/>
-        <set from-field="lookedUpValue.shipmentRouteSegmentId" field="shipmentRouteSegmentId"/>
-        <call-simple-method method-name="ensureRouteSegPackage"/>
-    </simple-method>
-    <simple-method method-name="deleteShipmentRouteSegment" short-description="Delete ShipmentRouteSegment">
-        <set value="Delete ShipmentRouteSegment" field="operationName"/>
-        <call-simple-method method-name="checkCanChangeShipmentStatusPacked"/>
-        <check-errors/>
-
-        <entity-one entity-name="ShipmentRouteSegment" value-field="lookedUpValue"/>
-        <remove-value value-field="lookedUpValue"/>
-    </simple-method>
     <simple-method method-name="ensureRouteSegPackage" short-description="Ensure ShipmentPackageRouteSeg exists for all Packages for this RouteSegment">
+        <entity-one entity-name="ShipmentRouteSegment" value-field="shipmentRouteSegment" use-cache="true"/>
         <entity-and entity-name="ShipmentPackage" list="shipmentPackages">
-            <field-map field-name="shipmentId" from-field="shipmentId"/>
+            <field-map field-name="shipmentId" from-field="shipmentRouteSegment.shipmentId"/>
         </entity-and>
         <iterate list="shipmentPackages" entry="shipmentPackage">
             <entity-one entity-name="ShipmentPackageRouteSeg" value-field="checkShipmentPackageRouteSeg" auto-field-map="false">
-                <field-map field-name="shipmentId" from-field="shipmentId"/>
-                <field-map field-name="shipmentRouteSegmentId" from-field="shipmentRouteSegmentId"/>
+                <field-map field-name="shipmentId" from-field="shipmentRouteSegment.shipmentId"/>
+                <field-map field-name="shipmentRouteSegmentId" from-field="shipmentRouteSegment.shipmentRouteSegmentId"/>
                 <field-map field-name="shipmentPackageSeqId" from-field="shipmentPackage.shipmentPackageSeqId"/>
             </entity-one>
             <if-empty field="checkShipmentPackageRouteSeg">
@@ -1194,7 +1030,17 @@ under the License.
         <call-simple-method method-name="checkCanChangeShipmentStatusGeneral"/>
     </simple-method>
     <simple-method method-name="checkCanChangeShipmentStatusGeneral" short-description="Check the Status of a Shipment to see if it can be changed - meant to be called in-line">
-        <entity-one entity-name="Shipment" value-field="testShipment"/>
+        <if-empty field="parameters.mainAction">
+            <set field="parameters.mainAction" value="UPDATE"/>
+        </if-empty>
+        <set-service-fields service-name="facilityGenericPermission" to-map="facilityGenericPermissionMap" map="parameters"/>
+        <call-service service-name="facilityGenericPermission" in-map-name="facilityGenericPermissionMap">
+            <result-to-field field="hasPermission" result-name="hasPermission"/>
+        </call-service>
+        <check-errors/>
+
+        <entity-one entity-name="Shipment" value-field="testShipment" use-cache="true"/>
+        <set field="fromStatusId" from-field="fromStatusId" default-value="${parameters.fromStatusId}"/>
         <if>
             <condition>
                 <or>
@@ -1225,9 +1071,12 @@ under the License.
             </condition>
             <then>
                 <get-related-one relation-name="StatusItem" value-field="testShipment" to-value-field="testShipmentStatus"/>
-                <string-to-list string="Cannot perform operation ${operationName} when the shipment is in the ${testShipmentStatus.description} [${testShipment.statusId}] status." list="error_list"/>
+                <property-to-field resource="ProductErrorUiLabels" property="ShipmentCanChangeStatusPermissionError" field="failMessage"/>
+                <set field="hasPermission" type="Boolean" value="false"/>
+                <field-to-result field="failMessage"/>
             </then>
         </if>
+        <field-to-result field="hasPermission"/>
     </simple-method>
 
     <!-- quick ship entire order in one package per facility & ship group -->
@@ -1987,23 +1836,5 @@ under the License.
             <call-service service-name="cancelOrderItemIssuanceFromSalesShipment" in-map-name="inputMap"/>
         </iterate>
     </simple-method>
-
-    <!-- QuantityBreak services -->
-    <!-- create a new QuantityBreak -->
-    <simple-method method-name="createQuantityBreak" short-description="Create a QuoteAttribute">
-        <make-value entity-name="QuantityBreak" value-field="quantityBreak"/>
-        <set-nonpk-fields map="parameters" value-field="quantityBreak"/>
-        <sequenced-id sequence-name="QuantityBreak" field="quantityBreak.quantityBreakId"/>
-        <create-value value-field="quantityBreak"/>
-        <check-errors/>
-    </simple-method>
-
-    <!-- remove an existing QuantityBreak -->
-    <simple-method method-name="deleteQuantityBreak" short-description="Remove an existing QuantityBreak">
-        <entity-one entity-name="QuantityBreak" value-field="quantityBreak" auto-field-map="true"/>
-        <check-errors/>
-        <remove-value value-field="quantityBreak"/>
-        <check-errors/>
-    </simple-method>
 </simple-methods>
 

Modified: ofbiz/ofbiz-framework/trunk/applications/product/servicedef/secas_shipment.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/servicedef/secas_shipment.xml?rev=1866286&r1=1866285&r2=1866286&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/servicedef/secas_shipment.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/servicedef/secas_shipment.xml Mon Sep  2 15:13:47 2019
@@ -151,6 +151,13 @@ under the License.
         <action service="updatePurchaseShipmentFromReceipt" mode="sync"/>
     </eca>
 
+    <eca service="createShipmentRouteSegment" event="commit">
+        <action service="ensureRouteSegPackage" mode="sync"/>
+    </eca>
+    <eca service="updateShipmentRouteSegment" event="commit">
+        <action service="ensureRouteSegPackage" mode="sync"/>
+    </eca>
+
     <eca service="createShipmentPackageContent" event="in-validate">
         <condition field-name="shipmentPackageSeqId" operator="equals" value="New"/>
         <action service="createShipmentPackage" mode="sync"/>

Modified: ofbiz/ofbiz-framework/trunk/applications/product/servicedef/services_shipment.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/servicedef/services_shipment.xml?rev=1866286&r1=1866285&r2=1866286&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/servicedef/services_shipment.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/servicedef/services_shipment.xml Mon Sep  2 15:13:47 2019
@@ -136,7 +136,7 @@ under the License.
     <service name="updateShipment" default-entity-name="Shipment" engine="simple"
             location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="updateShipment" auth="true">
         <description>Update Shipment</description>
-        <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusDelivered" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="INOUT" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true">
             <exclude field-name="shipmentTypeId"/>
@@ -152,10 +152,9 @@ under the License.
         <attribute name="oldOriginFacilityId" type="String" mode="OUT" optional="true"/>
         <attribute name="oldDestinationFacilityId" type="String" mode="OUT" optional="true"/>
     </service>
-    <service name="deleteShipment" default-entity-name="Shipment" engine="simple"
-            location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="deleteShipment" auth="true">
+    <service name="deleteShipment" default-entity-name="Shipment" engine="entity-auto" invoke="delete" auth="true">
         <description>Delete Shipment</description>
-        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="DELETE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
     <service name="createShipmentStatus" default-entity-name="ShipmentStatus" engine="entity-auto" invoke="create" auth="true">
@@ -167,19 +166,13 @@ under the License.
     <service name="setShipmentSettingsFromPrimaryOrder" engine="simple"
             location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="setShipmentSettingsFromPrimaryOrder" auth="true">
         <description>Set Shipment Settings From Primary Order</description>
-        <required-permissions join-type="AND">
-            <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
-            <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
-        </required-permissions>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="UPDATE"/>
         <attribute name="shipmentId" type="String" mode="IN" optional="false"/>
     </service>
     <service name="setShipmentSettingsFromFacilities" engine="simple"
             location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="setShipmentSettingsFromFacilities" auth="true">
         <description>Set Shipment Settings From Facilities</description>
-        <required-permissions join-type="AND">
-            <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
-            <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
-        </required-permissions>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="UPDATE"/>
         <attribute name="shipmentId" type="String" mode="IN" optional="false"/>
     </service>
     <service name="sendShipmentScheduledNotification" engine="simple"
@@ -220,25 +213,22 @@ under the License.
     </service>
 
     <!-- ShipmentItem Services -->
-    <service name="createShipmentItem" default-entity-name="ShipmentItem" engine="simple"
-            location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="createShipmentItem" auth="true">
+    <service name="createShipmentItem" default-entity-name="ShipmentItem" engine="entity-auto" invoke="create" auth="true">
         <description>Create ShipmentItem</description>
-         <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
+         <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <override name="shipmentItemSeqId" mode="INOUT" optional="true"/>
     </service>
-    <service name="updateShipmentItem" default-entity-name="ShipmentItem" engine="simple"
-            location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="updateShipmentItem" auth="true">
+    <service name="updateShipmentItem" default-entity-name="ShipmentItem" engine="entity-auto" invoke="update" auth="true">
         <description>Update ShipmentItem</description>
-         <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusDelivered" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="deleteShipmentItem" default-entity-name="ShipmentItem" engine="simple"
-            location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="deleteShipmentItem" auth="true">
+    <service name="deleteShipmentItem" default-entity-name="ShipmentItem" engine="entity-auto" invoke="delete" auth="true">
         <description>Delete ShipmentItem</description>
-         <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="DELETE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
 
@@ -256,7 +246,7 @@ under the License.
     <service name="createShipmentPackage" default-entity-name="ShipmentPackage" engine="simple"
             location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="createShipmentPackage" auth="true">
         <description>Create ShipmentPackage</description>
-        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true">
             <exclude field-name="dateCreated"/>
@@ -266,43 +256,40 @@ under the License.
     <service name="updateShipmentPackage" default-entity-name="ShipmentPackage" engine="simple"
             location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="updateShipmentPackage" auth="true">
         <description>Update ShipmentPackage</description>
-        <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="deleteShipmentPackage" default-entity-name="ShipmentPackage" engine="simple"
             location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="deleteShipmentPackage" auth="true">
         <description>Delete ShipmentPackage</description>
-        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="DELETE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
 
     <!-- ShipmentPackageContent Services -->
-    <service name="createShipmentPackageContent" default-entity-name="ShipmentPackageContent" engine="simple"
-            location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="createShipmentPackageContent" auth="true">
+    <service name="createShipmentPackageContent" default-entity-name="ShipmentPackageContent" engine="entity-auto" invoke="create" auth="true">
         <description>Create ShipmentPackageContent</description>
-        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <override name="shipmentPackageSeqId" mode="INOUT" optional="false"/>
     </service>
-    <service name="updateShipmentPackageContent" default-entity-name="ShipmentPackageContent" engine="simple"
-            location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="updateShipmentPackageContent" auth="true">
+    <service name="updateShipmentPackageContent" default-entity-name="ShipmentPackageContent" engine="entity-auto" invoke="update" auth="true">
         <description>Update ShipmentPackageContent</description>
-        <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="deleteShipmentPackageContent" default-entity-name="ShipmentPackageContent" engine="simple"
-            location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="deleteShipmentPackageContent" auth="true">
+    <service name="deleteShipmentPackageContent" default-entity-name="ShipmentPackageContent" engine="entity-auto" invoke="delete" auth="true">
         <description>Delete ShipmentPackageContent</description>
-        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="DELETE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
     <service name="addShipmentContentToPackage" default-entity-name="ShipmentPackageContent" engine="simple"
             location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="addShipmentContentToPackage" auth="true">
         <description>Add Shipment Content To Package</description>
-        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <override name="quantity" mode="IN" optional="false"/>
@@ -310,23 +297,21 @@ under the License.
     </service>
 
     <!-- ShipmentPackageRouteSeg Services -->
-    <service name="createShipmentPackageRouteSeg" default-entity-name="ShipmentPackageRouteSeg" engine="simple"
-            location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="createShipmentPackageRouteSeg" auth="true">
+    <service name="createShipmentPackageRouteSeg" default-entity-name="ShipmentPackageRouteSeg" engine="entity-auto" invoke="create" auth="true">
         <description>Create ShipmentPackageRouteSeg</description>
-        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="updateShipmentPackageRouteSeg" default-entity-name="ShipmentPackageRouteSeg" engine="entity-auto" invoke="update" auth="true">
         <description>Update ShipmentPackageRouteSeg</description>
-        <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusDelivered" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="deleteShipmentPackageRouteSeg" default-entity-name="ShipmentPackageRouteSeg" engine="simple"
-            location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="deleteShipmentPackageRouteSeg" auth="true">
+    <service name="deleteShipmentPackageRouteSeg" default-entity-name="ShipmentPackageRouteSeg" engine="entity-auto" invoke="delete" auth="true">
         <description>Delete ShipmentPackageRouteSeg</description>
-        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="DELETE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
 
@@ -350,25 +335,23 @@ under the License.
     </service>
 
     <!-- ShipmentRouteSegment Services -->
-    <service name="createShipmentRouteSegment" default-entity-name="ShipmentRouteSegment" engine="simple"
-            location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="createShipmentRouteSegment" auth="true">
+    <service name="createShipmentRouteSegment" default-entity-name="ShipmentRouteSegment" engine="entity-auto" invoke="create" auth="true">
         <description>Create ShipmentRouteSegment</description>
-        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <override name="shipmentRouteSegmentId" mode="INOUT" optional="true"/>
     </service>
-    <service name="updateShipmentRouteSegment" default-entity-name="ShipmentRouteSegment" engine="simple"
-            location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="updateShipmentRouteSegment" auth="true">
+    <service name="updateShipmentRouteSegment" default-entity-name="ShipmentRouteSegment" engine="entity-auto" invoke="update" auth="true">
         <description>Update ShipmentRouteSegment</description>
-        <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <override name="carrierServiceStatusId" default-value="SHRSCS_NOT_STARTED"/>
     </service>
-    <service name="deleteShipmentRouteSegment" default-entity-name="ShipmentRouteSegment" engine="simple"
-            location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="deleteShipmentRouteSegment" auth="true">
+    <service name="deleteShipmentRouteSegment" default-entity-name="ShipmentRouteSegment" engine="entity-auto" invoke="delete" auth="true">
         <description>Delete ShipmentRouteSegment</description>
-        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="DELETE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
     <service name="duplicateShipmentRouteSegment" default-entity-name="ShipmentRouteSegment" engine="java"
@@ -386,44 +369,46 @@ under the License.
         </description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
+    <service name="ensureRouteSegPackage" default-entity-name="ShipmentRouteSegment" engine="simple"
+            location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="ensureRouteSegPackage" auth="true">
+        <description>Ensure ShipmentPackageRouteSeg exists for all Packages for this RouteSegment</description>
+        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+    </service>
 
     <!-- ============================================================== -->
     <!-- ItemIssuance Services -->
     <service name="createItemIssuance" default-entity-name="ItemIssuance" engine="simple"
             location="component://product/minilang/shipment/issuance/IssuanceServices.xml" invoke="createItemIssuance" auth="true">
         <description>Create ItemIssuance</description>
-        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="CREATE"/>
         <auto-attributes include="pk" mode="OUT" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <attribute name="affectAccounting" type="Boolean" mode="OUT" optional="true"/>
     </service>
-    <service name="updateItemIssuance" default-entity-name="ItemIssuance" engine="simple"
-            location="component://product/minilang/shipment/issuance/IssuanceServices.xml" invoke="updateItemIssuance" auth="true">
+    <service name="updateItemIssuance" default-entity-name="ItemIssuance" engine="entity-auto" invoke="update" auth="true">
         <description>Update ItemIssuance</description>
-        <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="deleteItemIssuance" default-entity-name="ItemIssuance" engine="simple"
-            location="component://product/minilang/shipment/issuance/IssuanceServices.xml" invoke="deleteItemIssuance" auth="true">
+    <service name="deleteItemIssuance" default-entity-name="ItemIssuance" engine="entity-auto" invoke="delete" auth="true">
         <description>Delete ItemIssuance</description>
-        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="DELETE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
 
     <!-- ItemIssuanceRole Services -->
-    <service name="createItemIssuanceRole" default-entity-name="ItemIssuanceRole" engine="simple"
-            location="component://product/minilang/shipment/issuance/IssuanceServices.xml" invoke="createItemIssuanceRole" auth="true">
+    <service name="createItemIssuanceRole" default-entity-name="ItemIssuanceRole" engine="entity-auto" invoke="create" auth="true">
         <description>Create ItemIssuanceRole</description>
-        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <!-- Will check if OK to change status of shipment, so Shipment PK is needed -->
         <auto-attributes entity-name="Shipment" include="pk" mode="IN" optional="false"/>
     </service>
-    <service name="deleteItemIssuanceRole" default-entity-name="ItemIssuanceRole" engine="simple"
-            location="component://product/minilang/shipment/issuance/IssuanceServices.xml" invoke="deleteItemIssuanceRole" auth="true">
+    <service name="deleteItemIssuanceRole" default-entity-name="ItemIssuanceRole" engine="entity-auto" invoke="delete" auth="true">
         <description>Delete ItemIssuanceRole</description>
-        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
+        <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="DELETE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <!-- Will check if OK to change status of shipment, so Shipment PK is needed -->
         <auto-attributes entity-name="Shipment" include="pk" mode="IN" optional="false"/>
@@ -433,7 +418,7 @@ under the License.
             location="component://product/minilang/shipment/issuance/IssuanceServices.xml" invoke="issueOrderItemToShipment" auth="true">
         <description>Issue an OrderItem to a Shipment - only for non-sales orders</description>
         <required-permissions join-type="AND">
-            <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
+            <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="CREATE"/>
             <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
         </required-permissions>
         <auto-attributes entity-name="Shipment" include="pk" mode="IN" optional="false"/>
@@ -445,7 +430,7 @@ under the License.
             location="component://product/minilang/shipment/issuance/IssuanceServices.xml" invoke="issueOrderItemShipGrpInvResToShipment" auth="true">
         <description>Add an OrderItemShipGrpInvRes to a Shipment - only for sales orders</description>
         <required-permissions join-type="AND">
-            <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
+            <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="CREATE"/>
             <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
         </required-permissions>
         <auto-attributes entity-name="Shipment" include="pk" mode="IN" optional="false"/>
@@ -775,7 +760,7 @@ under the License.
             location="component://product/minilang/shipment/receipt/ShipmentReceiptServices.xml" invoke="issueOrderItemToShipmentAndReceiveAgainstPO" auth="true">
         <description>Issues order item quantity specified to the shipment, then receives inventory for that item and quantity</description>
         <required-permissions join-type="AND">
-            <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
+            <permission-service service-name="checkCanChangeShipmentStatusPacked" main-action="CREATE"/>
             <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
         </required-permissions>
         <implements service="issueOrderItemToShipment"/>
@@ -888,11 +873,11 @@ under the License.
     </service>
 
     <!-- QuantityBreak services -->
-    <service name="createQuantityBreak" engine="simple"
-            location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="createQuantityBreak" auth="true">
+    <service name="createQuantityBreak" default-entity-name="QuantityBreak" engine="entity-auto" invoke="create" auth="true">
         <description>Create a QuantityBreak</description>
         <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
         <auto-attributes entity-name="QuantityBreak" include="nonpk" mode="IN" optional="true"/>
+        <auto-attributes entity-name="QuantityBreak" include="pk" mode="OUT" optional="false"/>
     </service>
     <service name="updateQuantityBreak" engine="entity-auto" invoke="update" default-entity-name="QuantityBreak" auth="true">
         <description>Update a QuantityBreak</description>
@@ -900,8 +885,7 @@ under the License.
         <auto-attributes entity-name="QuantityBreak" include="pk" mode="IN" optional="false"/>
         <auto-attributes entity-name="QuantityBreak" include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="deleteQuantityBreak" engine="simple"
-            location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="deleteQuantityBreak" auth="true">
+    <service name="deleteQuantityBreak" default-entity-name="QuantityBreak" engine="entity-auto" invoke="delete" auth="true">
         <description>Delete a QuantityBreak</description>
         <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
         <auto-attributes entity-name="QuantityBreak" include="pk" mode="IN" optional="false"/>
@@ -1161,4 +1145,27 @@ under the License.
         <description>Delete a ShipmentItemBilling</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
+
+    <!-- Permission Services -->
+    <service name="checkCanChangeShipmentStatusPacked" engine="simple"
+        location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="checkCanChangeShipmentStatusPacked">
+        <description>Check the Status of a Shipment to see if it can be changed for an operation relative to the packed state</description>
+        <!-- Info : permission-service service-name="facilityGenericPermission" -->
+        <implements service="permissionInterface"/>
+        <attribute name="shipmentId" type="String" mode="IN" optional="true"/>
+    </service>
+    <service name="checkCanChangeShipmentStatusShipped" engine="simple"
+        location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="checkCanChangeShipmentStatusShipped">
+        <description>Check the Status of a Shipment to see if it can be changed for an operation relative to the shipped state</description>
+        <!-- Info : permission-service service-name="facilityGenericPermission" -->
+        <implements service="permissionInterface"/>
+        <attribute name="shipmentId" type="String" mode="IN" optional="true"/>
+    </service>
+    <service name="checkCanChangeShipmentStatusDelivered" engine="simple"
+        location="component://product/minilang/shipment/shipment/ShipmentServices.xml" invoke="checkCanChangeShipmentStatusDelivered">
+        <description>Check the Status of a Shipment to see if it can be changed for an operation relative to the delivered state</description>
+        <!-- Info : permission-service service-name="facilityGenericPermission" -->
+        <implements service="permissionInterface"/>
+        <attribute name="shipmentId" type="String" mode="IN" optional="true"/>
+    </service>
 </services>