Re: svn commit: r1866559 - /ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/engine/EntityAutoEngine.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1866559 - /ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/engine/EntityAutoEngine.java

Mathieu Lirzin
Hello Nico,

[hidden email] writes:

> URL: http://svn.apache.org/viewvc?rev=1866559&view=rev
> Log:
> Improved: Manage itemStatusId and oldItemStatusId on entity-auto engine
> (OFBIZ-11183)
> Currently the entity auto engine manage the status change operation on an Entity
> during an update, with analyse the field statusId as new status and compare with current
> value through StatusValidChange system. If the change is validated, the previous status
> is returned in oldStatusId service parameter.
>
> Service definition example :
>     <service name=updateRequirement default-entity-name=Requirement engine=entity-auto invoke=update auth=true>
>         <description>Update an existing requirement</description>
>         <auto-attributes include=pk mode=IN optional=false/>
>         <auto-attributes include=nonpk mode=IN optional=true/>
>         <attribute name=oldStatusId type=String mode=OUT optional=true/>
>     </service>
>
> I extend this process to an other standard status field: itemStatusId and oldItemStatusId, often present on item element
>     <service name=updatePicklistItem default-entity-name=PicklistItem engine=entity-auto invoke=update auth=true>
>         <description>Update PicklistItem</description>
>         <auto-attributes include=pk mode=IN optional=false/>
>         <auto-attributes include=nonpk mode=IN optional=true/>
>         <attribute name=oldItemStatusId type=String mode=OUT optional=true/>
>     </service>
>
> To realize this, I convert all call on statusId and oldStatusId raw naming by a dynamic resolution field name resolution.
> Like this the logical for statusId or itemStatusId are exactly the same

The oldStatusId/itemStatusId/oldItemStatusId thing sounds like an
advanced feature of the “entity-auto” engine that would be nice to
document somewhere in order to let others know that it exists.

Maybe you could write some line the “Developer manual” about that? :-)

Thanks,

--
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37