I have uploaded a patch for the simple methods schema. In general, the top level attributes are converted to simpleType, and attributeGroups to complexType. Changed the following attribute name 1. ‘field’ to ‘fieldType’ 2. ‘level’ to ‘levelType' Denormalize the following attributeGroups 1. attlist.compare 2. attlist.compare-field Left attributeGroup ‘typeDefaultString’ unchanged, cos it doesn’t matter. Not in use, it seem. jleroux: we also fixed an issue with <xs:element name="field" type="fieldType"/> to <xs:element ref="field"/> In the patch And I found a small issue (not minilang related) in ExampleCompoundWidgets.xml - <sm:log message="CompoundWidgetsFunc runs" sm:level="info"/> + <sm:log message="CompoundWidgetsFunc runs" level="info"/> git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1750647 13f79535-47bb-0310-9956-ffa450edef68
147 lines
9.3 KiB
XML
147 lines
9.3 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="testCreateFixedAssetMaintUpdateWorkEffortWithProductMaint" short-description="Test case for service createFixedAssetMaintUpdateWorkEffort with a product Maintenance" login-required="false">
|
|
<set field="fixedAssetId" value="DEMO_VEHICLE_01"/>
|
|
<set field="serviceCtx.fixedAssetId" from-field="fixedAssetId"/>
|
|
<set field="serviceCtx.statusId" value="FAM_CREATED"/>
|
|
<set field="serviceCtx.productMaintSeqId" value="seq03"/><!-- Product Maintenance -->
|
|
<set field="serviceCtx.intervalMeterTypeId" value="ODOMETER"/>
|
|
<set field="serviceCtx.estimatedStartDate" value="2009-12-18 00:00:00.000" type="Timestamp"/>
|
|
<set field="serviceCtx.estimatedCompletionDate" value="2009-12-18 01:00:00.000" type="Timestamp"/>
|
|
<set field="serviceCtx.actualStartDate" value="2009-12-20 00:00:00.000" type="Timestamp"/>
|
|
<entity-one entity-name="UserLogin" value-field="userLogin">
|
|
<field-map field-name="userLoginId" value="system"/>
|
|
</entity-one>
|
|
<set field="serviceCtx.userLogin" from-field="userLogin"/>
|
|
<call-service service-name="createFixedAssetMaintUpdateWorkEffort" in-map-name="serviceCtx">
|
|
<result-to-field result-name="maintHistSeqId"/>
|
|
</call-service>
|
|
|
|
<entity-one entity-name="FixedAssetMaint" value-field="fixedAssetMaint"/>
|
|
<get-related-one relation-name="ScheduleWorkEffort" value-field="fixedAssetMaint" to-value-field="workEffort"/>
|
|
<assert>
|
|
<not><if-empty field="fixedAssetMaint"/></not>
|
|
<not><if-empty field="fixedAssetMaint.scheduleWorkEffortId"/></not>
|
|
<not><if-empty field="workEffort"/></not>
|
|
<if-compare-field field="workEffort.estimatedStartDate" operator="equals" to-field="serviceCtx.estimatedStartDate"/>
|
|
<if-compare-field field="workEffort.estimatedCompletionDate" operator="equals" to-field="serviceCtx.estimatedCompletionDate"/>
|
|
<if-compare-field field="workEffort.actualStartDate" operator="equals" to-field="serviceCtx.actualStartDate"/>
|
|
</assert>
|
|
<check-errors/>
|
|
</simple-method>
|
|
|
|
<simple-method method-name="testCreateFixedAssetMaintUpdateWorkEffortWithoutProductMaint" short-description="Test case for service createFixedAssetMaintUpdateWorkEffort without a product maintenance" login-required="false">
|
|
<set field="fixedAssetId" value="DEMO_VEHICLE_01"/>
|
|
<set field="serviceCtx.fixedAssetId" from-field="fixedAssetId"/>
|
|
<set field="serviceCtx.statusId" value="FAM_CREATED"/>
|
|
<set field="serviceCtx.productMaintTypeId" value="OIL_CHANGE"/>
|
|
<set field="serviceCtx.intervalMeterTypeId" value="ODOMETER"/>
|
|
<set field="serviceCtx.estimatedStartDate" value="2009-12-18 00:00:00.000" type="Timestamp"/>
|
|
<set field="serviceCtx.estimatedCompletionDate" value="2009-12-18 01:00:00.000" type="Timestamp"/>
|
|
<set field="serviceCtx.actualStartDate" value="2009-12-20 00:00:00.000" type="Timestamp"/>
|
|
<entity-one entity-name="UserLogin" value-field="userLogin">
|
|
<field-map field-name="userLoginId" value="system"/>
|
|
</entity-one>
|
|
<set field="serviceCtx.userLogin" from-field="userLogin"/>
|
|
<call-service service-name="createFixedAssetMaintUpdateWorkEffort" in-map-name="serviceCtx">
|
|
<result-to-field result-name="maintHistSeqId"/>
|
|
</call-service>
|
|
|
|
<entity-one entity-name="FixedAssetMaint" value-field="fixedAssetMaint">
|
|
<field-map field-name="fixedAssetId"/>
|
|
<field-map field-name="maintHistSeqId"/>
|
|
</entity-one>
|
|
<get-related-one relation-name="ScheduleWorkEffort" value-field="fixedAssetMaint" to-value-field="workEffort"/>
|
|
<assert>
|
|
<not><if-empty field="fixedAssetMaint"/></not>
|
|
<not><if-empty field="fixedAssetMaint.scheduleWorkEffortId"/></not>
|
|
<not><if-empty field="workEffort"/></not>
|
|
<if-compare-field field="workEffort.estimatedStartDate" operator="equals" to-field="serviceCtx.estimatedStartDate"/>
|
|
<if-compare-field field="workEffort.estimatedCompletionDate" operator="equals" to-field="serviceCtx.estimatedCompletionDate"/>
|
|
<if-compare-field field="workEffort.actualStartDate" operator="equals" to-field="serviceCtx.actualStartDate"/>
|
|
</assert>
|
|
<check-errors/>
|
|
</simple-method>
|
|
|
|
<simple-method method-name="testUpdateFixedAssetMaintAndWorkEffort" short-description="Test case for service updateFixedAssetMaintAndWorkEffort" login-required="false">
|
|
<set field="fixedAssetId" value="DEMO_VEHICLE_01"/>
|
|
<set field="maintHistSeqId" value="00001"/><!-- Sequence created by testCreateFixedAssetMaintUpdateWorkEffortWithProductMaint -->
|
|
<set field="serviceCtx.fixedAssetId" from-field="fixedAssetId"/>
|
|
<set field="serviceCtx.maintHistSeqId" from-field="maintHistSeqId"/>
|
|
<set field="serviceCtx.estimatedCompletionDate" value="2009-12-22 01:00:00.000" type="Timestamp"/><!-- Changed estimatedCompletionDate to test update service -->
|
|
<entity-one entity-name="FixedAssetMaint" value-field="fixedAssetMaint"/>
|
|
<set field="serviceCtx.workEffortId" from-field="fixedAssetMaint.scheduleWorkEffortId"/>
|
|
<entity-one entity-name="UserLogin" value-field="userLogin">
|
|
<field-map field-name="userLoginId" value="system"/>
|
|
</entity-one>
|
|
<set field="serviceCtx.userLogin" from-field="userLogin"/>
|
|
<call-service service-name="updateFixedAssetMaintAndWorkEffort" in-map-name="serviceCtx"/>
|
|
<clear-field field="fixedAssetMaint"/>
|
|
<entity-one entity-name="FixedAssetMaint" value-field="fixedAssetMaint"/>
|
|
<get-related-one relation-name="ScheduleWorkEffort" value-field="fixedAssetMaint" to-value-field="workEffort"/>
|
|
<assert>
|
|
<not><if-empty field="fixedAssetMaint"/></not>
|
|
<not><if-empty field="fixedAssetMaint.scheduleWorkEffortId"/></not>
|
|
<not><if-empty field="workEffort"/></not>
|
|
<if-compare-field field="workEffort.estimatedCompletionDate" operator="equals" to-field="serviceCtx.estimatedCompletionDate"/>
|
|
</assert>
|
|
<check-errors/>
|
|
</simple-method>
|
|
|
|
<simple-method method-name="testUpdateFixedAssetMaintAndWorkEffortComplete" short-description="Test case for service updateFixedAssetMaintAndWorkEffort" login-required="false">
|
|
<entity-one entity-name="FixedAssetMaint" value-field="fixedAssetMaint">
|
|
<field-map field-name="fixedAssetId" value="DEMO_VEHICLE_01"/>
|
|
<field-map field-name="maintHistSeqId" value="00001"/>
|
|
</entity-one>
|
|
<set field="serviceInMap.fixedAssetId" from-field="fixedAssetMaint.fixedAssetId"/>
|
|
<set field="serviceInMap.maintHistSeqId" from-field="fixedAssetMaint.maintHistSeqId"/>
|
|
<set field="serviceInMap.scheduleWorkEffortId" from-field="fixedAssetMaint.scheduleWorkEffortId"/>
|
|
<set field="serviceInMap.statusId" value="FAM_COMPLETED"/>
|
|
<now-timestamp field="nowTimestamp"/>
|
|
<set field="serviceInMap.actualCompletionDate" from-field="nowTimestamp"/>
|
|
<entity-one entity-name="UserLogin" value-field="userLogin">
|
|
<field-map field-name="userLoginId" value="system"/>
|
|
</entity-one>
|
|
<set field="serviceInMap.userLogin" from-field="userLogin"/>
|
|
<call-service service-name="updateFixedAssetMaintAndWorkEffort" in-map-name="serviceInMap"/>
|
|
|
|
<entity-one entity-name="FixedAssetMaint" value-field="newFixedAssetMaint">
|
|
<field-map field-name="fixedAssetId" value="DEMO_VEHICLE_01"/>
|
|
<field-map field-name="maintHistSeqId" value="00001"/>
|
|
</entity-one>
|
|
<assert>
|
|
<if-compare field="newFixedAssetMaint.statusId" operator="equals" value="FAM_COMPLETED"/>
|
|
</assert>
|
|
<check-errors/>
|
|
<entity-one entity-name="WorkEffort" value-field="workEffort">
|
|
<field-map field-name="workEffortId" from-field="fixedAssetMaint.scheduleWorkEffortId"/>
|
|
</entity-one>
|
|
<assert>
|
|
<if-compare field="workEffort.currentStatusId" operator="equals" value="CAL_COMPLETED"/>
|
|
<if-compare-field field="workEffort.actualCompletionDate" operator="equals" to-field="nowTimestamp" type="Timestamp"/>
|
|
</assert>
|
|
<check-errors/>
|
|
</simple-method>
|
|
</simple-methods>
|