Files
ofbiz-framework/applications/manufacturing/minilang/techdata/RoutingSimpleEvents.xml
T
Nicolas Malin deebac1bb1 Fixed: Consistency and Readability improvements for make-value tag (OFBIZ-8986)
Consistency on the attribute order for make-value element as : entity-name, value-field
Thanks to Ankush Upadhyay and Devanshu Vyas for the issue and the corrective patch

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805956 13f79535-47bb-0310-9956-ffa450edef68
2017-08-23 20:44:44 +00:00

82 lines
4.8 KiB
XML

<?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="addRoutingTaskAssoc"
short-description="If copyTask field = Y create a copy of the routingTask, in all the case add a RoutingTaskAssociation">
<if-compare field="parameters.copyTask" operator="equals" value="Y">
<make-value entity-name="WorkEffort" value-field="lookupPKMap"/>
<set field="lookupPKMap.workEffortId" from-field="parameters.workEffortIdTo"/>
<find-by-primary-key entity-name="WorkEffort" map="lookupPKMap" value-field="lookedUpValue"/>
<call-map-processor xml-resource="component://manufacturing/minilang/techdata/RoutingMapProcs.xml"
processor-name="copyRoutingTask" in-map-name="lookedUpValue" out-map-name="context"/>
<call-service service-name="createWorkEffort" in-map-name="context">
<default-message resource="ManufacturingUiLabels" property="ManufacturingRoutingTaskCopiedSuccessfully"/>
<result-to-field result-name="workEffortId" field="parameters.workEffortIdTo"/>
</call-service>
</if-compare>
<if-empty field="parameters.fromDate">
<now-timestamp field="parameters.fromDate"/>
</if-empty>
<call-map-processor xml-resource="component://manufacturing/minilang/techdata/RoutingMapProcs.xml"
processor-name="routingTaskAssoc" in-map-name="parameters" out-map-name="context1"/>
<check-errors/>
<set value="Y" field="context1.create"/>
<call-service service-name="checkRoutingTaskAssoc" in-map-name="context1">
<result-to-field result-name="sequenceNumNotOk" field="sequenceNumNotOk"/>
</call-service>
<if-compare field="sequenceNumNotOk" operator="equals" value="Y">
<add-error>
<fail-property resource="ManufacturingUiLabels" property="ManufacturingTwoRoutingTaskWithSameSeqId"/>
</add-error>
<check-errors/>
</if-compare>
<call-map-processor xml-resource="component://manufacturing/minilang/techdata/RoutingMapProcs.xml"
processor-name="routingTaskAssoc" in-map-name="parameters" out-map-name="context2"/>
<check-errors/>
<call-service service-name="createWorkEffortAssoc" in-map-name="context2">
<default-message resource="ManufacturingUiLabels" property="ManufacturingRoutingTaskAssocCreateSuccessfully"/>
</call-service>
</simple-method>
<simple-method method-name="updateRoutingTaskAssoc" short-description="check if there is no pb with date and SeqId and call service updateWorkEffortAssoc">
<call-map-processor xml-resource="component://manufacturing/minilang/techdata/RoutingMapProcs.xml"
processor-name="routingTaskAssoc" in-map-name="parameters" out-map-name="context1"/>
<check-errors/>
<call-service service-name="checkRoutingTaskAssoc" in-map-name="context1">
<result-to-field result-name="sequenceNumNotOk" field="sequenceNumNotOk"/>
</call-service>
<if-compare field="sequenceNumNotOk" operator="equals" value="Y">
<add-error>
<fail-property resource="ManufacturingUiLabels" property="ManufacturingTwoRoutingTaskWithSameSeqId"/>
</add-error>
<check-errors/>
</if-compare>
<call-map-processor xml-resource="component://manufacturing/minilang/techdata/RoutingMapProcs.xml"
processor-name="routingTaskAssoc" in-map-name="parameters" out-map-name="context2"/>
<check-errors/>
<call-service service-name="updateWorkEffortAssoc" in-map-name="context2">
<default-message resource="ManufacturingUiLabels" property="ManufacturingRoutingTaskAssocCreateSuccessfully"/>
</call-service>
</simple-method>
</simple-methods>