[ https://issues.apache.org/jira/browse/OFBIZ-10024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Deepak Dixit closed OFBIZ-10024. -------------------------------- Resolution: Not A Problem > INOUT entity-auto engine parameter not seen in SECA > ---------------------------------------------------- > > Key: OFBIZ-10024 > URL: https://issues.apache.org/jira/browse/OFBIZ-10024 > Project: OFBiz > Issue Type: Bug > Reporter: Jacques Le Roux > Assignee: Jacques Le Roux > Priority: Major > > At the bottom of OFBIZ-9985 I mentionned an issue I crossed when using an > INOUT parameter with entity-auto engine and triggering an SECA. > Here it is: > Hi Dennis, > No there is no problems with entity-auto as is, ie as it's used so far, in > other words no known bugs. The problem I crossed is something "special" (or > new). > Using entity-auto, I wanted to mimic the current createBudget Minilang > implementation which also calls createBudgetStatus. So I thought that by > trigerring createBudgetStatus with a SECA it would be OK. > Here is the patch: > {code} > Index: secas.xml > =================================================================== > --- secas.xml (revision 1815825) > +++ secas.xml (working copy) > @@ -99,7 +99,13 @@ > <action service="sendOrderPayRetryNotification" mode="async" > persist="true"/> > </eca> > - <!-- budget role ecas --> > + <!-- Budget ecas --> > + <eca service="createBudget" event="invoke"> > + <set field-name="budgetId" env-name="budgetId"/> > + <set field-name="statusId" value="BG_CREATED"/> > + <action service="createBudgetStatus" mode="sync" > run-as-user="system"/> > + </eca> > + > <eca service="createBudgetRole" event="invoke"> > <action service="ensurePartyRole" mode="sync" run-as-user="system"/> > </eca> > Index: services_budget.xml > =================================================================== > --- services_budget.xml (revision 1815825) > +++ services_budget.xml (working copy) > @@ -25,8 +25,7 @@ > <version>1.0</version> > <!-- Budget --> > - <service name="createBudget" default-entity-name="Budget" engine="simple" > - > location="component://accounting/minilang/budget/BudgetServices.xml" > invoke="createBudget" auth="true"> > + <service name="createBudget" default-entity-name="Budget" > engine="entity-auto" invoke="create" auth="true"> > <description>Create a Budget</description> > <auto-attributes include="pk" mode="INOUT" optional="true"/> > <auto-attributes include="nonpk" mode="IN" optional="true"/> > {code} > And here is the error > {code} > 2017-11-21 15:00:47,649 |jsse-nio-8443-exec-1 |ServiceDispatcher > |E| Incoming context (in runSync : createBudgetStatus) does not match > expected requirements > org.apache.ofbiz.service.ServiceValidationException: Le param�tre requis > suivant manque : [createBudgetStatus.budgetId] > at > org.apache.ofbiz.service.ModelService.validate(ModelService.java:565) > ~[ofbiz.jar:?] > at > org.apache.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:379) > [ofbiz.jar:?] > at > org.apache.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:229) > [ofbiz.jar:?] > at > org.apache.ofbiz.service.GenericDispatcherFactory$GenericDispatcher.runSync(GenericDispatcherFactory.java:88) > [ofbiz.jar:?] > at > org.apache.ofbiz.service.eca.ServiceEcaAction.runAction(ServiceEcaAction.java:128) > [ofbiz.jar:?] > at > org.apache.ofbiz.service.eca.ServiceEcaRule.eval(ServiceEcaRule.java:160) > [ofbiz.jar:?] > at > org.apache.ofbiz.service.eca.ServiceEcaUtil.evalRules(ServiceEcaUtil.java:195) > [ofbiz.jar:?] > at > org.apache.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:387) > [ofbiz.jar:?] > at > org.apache.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:229) > [ofbiz.jar:?] > at > org.apache.ofbiz.service.GenericDispatcherFactory$GenericDispatcher.runSync(GenericDispatcherFactory.java:88) > [ofbiz.jar:?] > at > org.apache.ofbiz.webapp.event.CoreEvents.scheduleService(CoreEvents.java:316) > [ofbiz.jar:?] > {code} > I did not check the relation between the entity-auto and SECA code yet, but > at the moment {{<auto-attributes include="pk" mode="INOUT" > optional="true"/>}} does not pass a budgetId in the SECA environement so the > SECA fails. > BTW the service-eca.xsd seriously lacks documentation. I have created > OFBIZ-9994 for that -- This message was sent by Atlassian JIRA (v7.6.3#76005)