(OFBIZ-7696) Thanks Deepak Nigam for reporting and Sourabh Punyani for the patch.
92 lines
5.1 KiB
XML
92 lines
5.1 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="createInternalOrg" short-description="">
|
|
<set field="internalCtx.partyIdFrom" from-field="parameters.headpartyId"/>
|
|
<set field="internalCtx.partyIdTo" from-field="parameters.partyId"/>
|
|
<set field="internalCtx.partyRelationshipTypeId" value="GROUP_ROLLUP"/>
|
|
<set field="internalCtx.roleTypeIdFrom" value="INTERNAL_ORGANIZATIO"/>
|
|
<set field="internalCtx.roleTypeIdTo" value="INTERNAL_ORGANIZATIO"/>
|
|
<call-service service-name="createPartyRelationship" in-map-name="internalCtx"></call-service>
|
|
</simple-method>
|
|
<simple-method method-name="removeEmlpPosition" short-description="">
|
|
<entity-and entity-name="EmplPositionFulfillment" list="emplPositionFulfillment">
|
|
<field-map field-name="emplPositionId" from-field="parameters.emplPositionId"/>
|
|
<field-map field-name="partyId" from-field="parameters.partyId"/>
|
|
</entity-and>
|
|
<if-not-empty field="emplPositionFulfillment">
|
|
<set field="parameters.fromDate" from-field="emplPositionFulfillment[0].fromDate"/>
|
|
<set-service-fields service-name="deleteEmplPositionFulfillment" map="parameters" to-map="delFullfillCtx"/>
|
|
<call-service service-name="deleteEmplPositionFulfillment" in-map-name="delFullfillCtx"></call-service>
|
|
</if-not-empty>
|
|
|
|
<set-service-fields service-name="deleteEmplPosition" map="parameters" to-map="delEmlpCtx"/>
|
|
<call-service service-name="deleteEmplPosition" in-map-name="delEmlpCtx"></call-service>
|
|
</simple-method>
|
|
<simple-method method-name="removeInternalOrg" short-description="">
|
|
<entity-and entity-name="PartyRelationship" list="partyRelationship">
|
|
<field-map field-name="partyIdTo" from-field="parameters.partyId"/>
|
|
<field-map field-name="partyIdFrom" from-field="parameters.parentpartyId"/>
|
|
</entity-and>
|
|
<if-not-empty field="partyRelationship">
|
|
<set-service-fields service-name="deletePartyRelationship" map="partyRelationship[0]" to-map="deletePartyRelationship"/>
|
|
</if-not-empty>
|
|
<call-service service-name="deletePartyRelationship" in-map-name="deletePartyRelationship"></call-service>
|
|
</simple-method>
|
|
|
|
<!-- Public Holiday -->
|
|
<simple-method method-name="createPublicHoliday" short-description="Create Public Holiday">
|
|
<if-empty field="parameters.workEffortName">
|
|
<add-error>
|
|
<fail-property resource="HumanResErrorUiLabels" property="HumanResHolidayNameMissing"/>
|
|
</add-error>
|
|
<check-errors/>
|
|
</if-empty>
|
|
<if-empty field="parameters.estimatedStartDate">
|
|
<add-error>
|
|
<fail-property resource="HumanResErrorUiLabels" property="HumanResFromDateMissing"/>
|
|
</add-error>
|
|
<check-errors/>
|
|
</if-empty>
|
|
<set field="dateValue" from-field="parameters.estimatedStartDate" type="Timestamp"/>
|
|
<call-class-method method-name="getDayEnd" class-name="org.apache.ofbiz.base.util.UtilDateTime" ret-field="dateEnd">
|
|
<field field="dateValue" type="java.sql.Timestamp"/>
|
|
</call-class-method>
|
|
<set field="parameters.estimatedCompletionDate" from-field="dateEnd"/>
|
|
<entity-and entity-name="WorkEffort" list="workEffortList">
|
|
<field-map field-name="workEffortTypeId" value="PUBLIC_HOLIDAY"/>
|
|
<field-map field-name="estimatedStartDate" from-field="parameters.estimatedStartDate"/>
|
|
</entity-and>
|
|
<if-empty field="workEffortList">
|
|
<call-service service-name="createWorkEffortAndPartyAssign" in-map-name="parameters">
|
|
<default-message resource="CommonUiLabels" property="CommonSuccessfullyCreated"/>
|
|
</call-service>
|
|
<else>
|
|
<add-error>
|
|
<fail-property resource="HumanResErrorUiLabels" property="HumanResFromDateAlreadyExist"/>
|
|
</add-error>
|
|
<check-errors/>
|
|
</else>
|
|
</if-empty>
|
|
</simple-method>
|
|
</simple-methods>
|