finalize to convert BudgetRole service to entity-auto relative to OFBIZ-5900
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1650977 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/applications/accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml b/applications/accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml
index a8f71de..8485b82 100644
--- a/applications/accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml
+++ b/applications/accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml
@@ -68,19 +68,5 @@
</if-not-empty>
</simple-method>
- <simple-method method-name="createBudgetRole" short-description="Create a Budget Role">
- <entity-one value-field="partyRole" entity-name="PartyRole"/>
- <if-empty field="partyRole">
- <set field="createPartyRole.partyId" from-field="parameters.partyId"/>
- <set field="createPartyRole.roleTypeId" from-field="parameters.roleTypeId"/>
- <call-service service-name="createPartyRole" in-map-name="createPartyRole"/>
- <check-errors/>
- </if-empty>
- <make-value value-field="newEntity" entity-name="BudgetRole"/>
- <set-nonpk-fields map="parameters" value-field="newEntity"/>
- <set-pk-fields map="parameters" value-field="newEntity"/>
- <create-value value-field="newEntity"/>
- </simple-method>
-
</simple-methods>
diff --git a/applications/accounting/servicedef/secas.xml b/applications/accounting/servicedef/secas.xml
index 634b52a..14bf860 100644
--- a/applications/accounting/servicedef/secas.xml
+++ b/applications/accounting/servicedef/secas.xml
@@ -104,6 +104,11 @@
<action service="sendOrderPayRetryNotification" mode="async" persist="true"/>
</eca>
+ <!-- budget role ecas -->
+ <eca service="createBudgetRole" event="invoke">
+ <action service="ensurePartyRole" mode="sync" run-as-user="system"/>
+ </eca>
+
<!-- financial account role ecas -->
<eca service="createFinAccountRole" event="invoke">
<action service="ensurePartyRole" mode="sync" run-as-user="system"/>
@@ -128,7 +133,7 @@
<condition field-name="replenishPaymentId" operator="is-not-empty"/>
<action service="finAccountReplenish" mode="sync" run-as-user="system"/>
</eca>
-
+
<eca service="createFinAccountTrans" event="commit">
<condition field-name="glAccountId" operator="is-not-empty"/>
<action service="postFinAccountTransToGl" mode="sync"/>
diff --git a/applications/accounting/servicedef/services_budget.xml b/applications/accounting/servicedef/services_budget.xml
index cbe7c7e..f7266b8 100644
--- a/applications/accounting/servicedef/services_budget.xml
+++ b/applications/accounting/servicedef/services_budget.xml
@@ -60,8 +60,7 @@
<auto-attributes mode="IN" include="pk" optional="false"/>
</service>
- <service name="createBudgetRole" default-entity-name="BudgetRole" engine="simple"
- location="component://accounting/script/org/ofbiz/accounting/budget/BudgetServices.xml" invoke="createBudgetRole">
+ <service name="createBudgetRole" default-entity-name="BudgetRole" engine="entity-auto" invoke="create" auth="true">
<description>Create a new Budget Role Record</description>
<auto-attributes mode="IN" include="pk" optional="false"/>
<auto-attributes mode="IN" include="nonpk" optional="true"/>