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

Nicolas Malin commented on OFBIZ-10553:
---------------------------------------

This issue contains two services that will migrate from minilang to entity-auto 
createQuoteWorkEffort et deleteQuoteWorkEffort.
But createQuoteWorkEffort isn't a crud service on entity QuoteWorkEffort 
because it's linked to a seca to call createWorkeffort before if a workEffortId 
isn't present in context.
{code|xml}
<eca service="createQuoteWorkEffort" event="in-validate">
   <condition field-name="workEffortId" operator="is-empty"/>
   <action service="createWorkEffort" mode="sync"/>
</eca>
{code}

I suggest to convert the service createQuoteWorkEffort has a real Crud service 
and create an other ensureWorkEffortAndCreateQuoteWorkEffort to simulate the 
attendee process. With this we have a coherent service naming and not surprise 
for developer :) .
To manage the service as createWorkEffort deprecated, I propose to define it 
twice 
{code}
     <service name="createQuoteWorkEffort" 
default-entity-name="QuoteWorkEffort" engine="entity-auto" invoke="create" 
auth="true">
        <deprecated use-instead="ensureWorkEffortAndCreateQuoteWorkEffort" 
since="Upcoming Release">
            use createQuoteWorkEffort to create a workeffort has been 
deprecated for best pratice naming reason, use 
ensureWorkEffortAndCreateQuoteWorkEffort instead.
            Now createQuoteWorkEffort work as a crud service on QuoteWorkEffort
        </deprecated>
    </service>
    <service name="createQuoteWorkEffort" default-entity-name="QuoteWorkEffort" 
engine="entity-auto" invoke="create" auth="true">
        <description>Create a new QuoteWorkEffort</description>
        <required-permissions join-type="AND">
            <check-permission permission="ORDERMGR" action="_CREATE"/>
        </required-permissions>
        <auto-attributes mode="IN" include="pk"/>
     </service>
{code}
First alert on deprecation and second ensure that the definition work fine.
In log we will have an alert on the deprecation and an alert on the duplicated 
definition during the deprecation time

> Convert QuoteServices.xml mini lang to groovy
> ---------------------------------------------
>
>                 Key: OFBIZ-10553
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10553
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: order
>    Affects Versions: Trunk
>            Reporter: Antoine Ouvrard
>            Assignee: Nicolas Malin
>            Priority: Minor
>         Attachments: OFBIZ-10553.patch
>
>
> This is an attempt to migrate QuoteServices.xml to groovy file version.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to