git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@707261 13f79535-47bb-0310-9956-ffa450edef68
98 lines
6.1 KiB
XML
98 lines
6.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" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
|
|
<simple-method method-name="CreateCustRequestAndAssignTaskToPerson" short-description="">
|
|
<set-service-fields service-name="createCustRequest" map-name="parameters" to-map-name="createCust"/>
|
|
<call-service service-name="createCustRequest" in-map-name="createCust">
|
|
<result-to-field result-name="custRequestId" field-name="custRequestId"/>
|
|
</call-service>
|
|
<if-not-empty field="parameters.workEffortParentId">
|
|
<set-service-fields service-name="createWorkEffort" map-name="parameters" to-map-name="createTask" />
|
|
<set field="createTask.custRequestId" from-field="custRequestId"/>
|
|
<set field="createTask.workEffortName" from-field="parameters.custRequestName"/>
|
|
<call-service service-name="createWorkEffort" in-map-name="createTask" >
|
|
<result-to-field result-name="workEffortId" field-name="workEffortId"/>
|
|
</call-service>
|
|
<set field="updCust.statusId" value="CRQ_REVIEWED"/>
|
|
<set field="updCust.custRequestId" from-field="custRequestId"/>
|
|
<call-service service-name="updateCustRequest" in-map-name="updCust"/>
|
|
<if-not-empty field="parameters.partyId">
|
|
<set field="assignParty.workEffortId" from-field="workEffortId"/>
|
|
<set field="assignParty.partyId" from-field="parameters.partyId"/>
|
|
<set field="assignParty.roleTypeId" from-field="parameters.roleTypeId"/>
|
|
<set field="assignParty.statusId" value="PAS_ASSIGNED"/>
|
|
<call-service service-name="assignPartyToWorkEffort" in-map-name="assignParty" />
|
|
</if-not-empty>
|
|
</if-not-empty>
|
|
</simple-method>
|
|
<simple-method method-name="acceptRequestAndConnectToTask" short-description="Accept a customer request and connect to an existing task">
|
|
<entity-one entity-name="WorkEffort" value-name="workEffort"/>
|
|
<if-empty field="workEffort">
|
|
<add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorTaskNotFound"/></add-error>
|
|
</if-empty>
|
|
<if-compare field="workEffort.currentStatusId" value="PTS_CREATED" operator="not-equals">
|
|
<add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorTaskStatusWrong"/></add-error>
|
|
</if-compare>
|
|
<entity-one entity-name="CustRequest" value-name="custRequest"/>
|
|
<if-empty field="custRequest">
|
|
<add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorRequestNotFound"/></add-error>
|
|
</if-empty>
|
|
<if-compare field="custRequest.statusId" value="CRQ_ACCEPTED" operator="not-equals">
|
|
<entity-one entity-name="StatusItem" value-name="status">
|
|
<field-map field-name="statusId" value="custRequest.statusId"/>
|
|
</entity-one>
|
|
<add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorRequestStatusWrong"/></add-error>
|
|
</if-compare>
|
|
<check-errors/>
|
|
<set field="updCust.statusId" value="CRQ_REVIEWED"/>
|
|
<set field="updCust.custRequestId" from-field="parameters.custRequestId"/>
|
|
<call-service service-name="updateCustRequest" in-map-name="updCust"/>
|
|
<set-service-fields service-name="createWorkEffortRequest" map-name="parameters" to-map-name="connectMap"/>
|
|
<call-service service-name="createWorkEffortRequest" in-map-name="connectMap"/>
|
|
</simple-method>
|
|
<simple-method method-name="setTaskStatusToComplete" short-description="Set the task status to complete, if resources assigned that status will also be set to complete">
|
|
<entity-one entity-name="WorkEffort" value-name="workEffort"/>
|
|
<if-empty field="workEffort">
|
|
<add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorTaskNotFound"/></add-error>
|
|
</if-empty>
|
|
<if-compare field="workEffort.currentStatusId" value="PTS_CREATED" operator="not-equals">
|
|
<add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorTaskStatusWrong"/></add-error>
|
|
</if-compare>
|
|
<check-errors/>
|
|
<entity-and entity-name="WorkEffortPartyAssignment" list-name="assigns" filter-by-date="true">
|
|
<field-map field-name="workEffortId" env-name="parameters.workEffortId"/>
|
|
</entity-and>
|
|
<!-- if all assigns are complete the task will be set to complete -->
|
|
<if-not-empty field="assigns">
|
|
<iterate entry-name="assign" list-name="assigns">
|
|
<set-service-fields service-name="updateTaskAssigment" map-name="assign" to-map-name="upd"/>
|
|
<set field="upd.statusId" value="PAS_COMPLETED"/>
|
|
<call-service service-name="updateTaskAssigment" in-map-name="upd"/>
|
|
</iterate>
|
|
<else>
|
|
<set-service-fields service-name="updateWorkEffort" map-name="parameters" to-map-name="upd"/>
|
|
<set field="upd.currentStatusId" value="PTS_COMPLETED"/>
|
|
<call-service service-name="updateWorkEffort" in-map-name="upd"/>
|
|
</else>
|
|
</if-not-empty>
|
|
</simple-method>
|
|
</simple-methods>
|