You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Bob Morley (JIRA)" <ji...@apache.org> on 2010/05/07 16:52:48 UTC

[jira] Commented: (OFBIZ-3765) Use CustumMethod for select order, quote and invoice hook to resolve id

    [ https://issues.apache.org/jira/browse/OFBIZ-3765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12865182#action_12865182 ] 

Bob Morley commented on OFBIZ-3765:
-----------------------------------

I like this concept a lot.  However, I wonder if it can be implemented by making use of the overriding nature of services rather than an entity model change?  Similar to what you have done, pull out the implementation into a "getNextInvoiceId", "getNextOrderId", and "getNextQuoteId" and have the create service invoke this regardless.  Then if you have your own custom implementation, you would just redefine the service definition in your hot-deploy component to point to your new implementation.  Services are (generally) in a global space so this overriding behaviour is based on the load sequence dictated by component type (framework, application, special purpose, hot-deploy) and from with-in there the ordering in the component-load.xml file (may have to double check that last statement).  :)

Would think that the "getNextInvoiceId" would use the acctg preferences to vector off to the "enforced" and "restart" service if you want to keep those two implementations separated (which is a good idea).

> Use CustumMethod for select order, quote and invoice hook to resolve id
> -----------------------------------------------------------------------
>
>                 Key: OFBIZ-3765
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-3765
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: accounting, order
>    Affects Versions: SVN trunk
>            Reporter: nicolas malin
>             Fix For: SVN trunk
>
>         Attachments: hookByPartyAcctgPreference.patch
>
>
> Currently the invoiceId resolve process is define on PartyAcctgPreference by a enumeration. The service getNextInvoiceId analyse enumeration to active code correponding to enumeration.
> I propose pass enumeration to CustumMethod that permit to add more easier a new resolve process. Just define a new CusthomMethod and associate to PartyAcctgPreference. It's possible to add this by hot-deploy compenents without change accounting code or add many unreadable function.
> The patch contains :
>  * Entity modiication : pass enumeration to deprecated and add custumMethod attribute/relation
>  * Add service enforced ans restart define previously by enumeration
>  * Implement getNextSeqId service by origin call service to permet analyse and resolve new id by all information present in context
>  * Add error message if PartyAcctgPreference not define.
>  * Apply on invoice, quote an order
> To test just ant clean-all && ant run-install and create quote, order and invoice
> Thanks to Leila Mekika for the help
> Nicolas

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.