[jira] [Commented] (OFBIZ-9523) Improve groovy DSL : runService call makeValidContext

2017-07-31 Thread Jacques Le Roux (JIRA)

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

Jacques Le Roux commented on OFBIZ-9523:


But (for now?) the autocompletion is not as convenient as what we had with 
minilang, and that counts for adoption.

Like trying to autocomplete "run service:",  maybe I miss something?


> Improve groovy DSL : runService call makeValidContext
> -
>
> Key: OFBIZ-9523
> URL: https://issues.apache.org/jira/browse/OFBIZ-9523
> Project: OFBiz
>  Issue Type: Improvement
>  Components: framework
>Affects Versions: Trunk
>Reporter: Nicolas Malin
>Assignee: Nicolas Malin
> Fix For: Upcoming Release
>
> Attachments: OFBIZ-9523.patch
>
>
> When you call run service with groovy, you need to be sure that all parametes 
> are good for the service call.
> I propose to simplify this dsl with an automatic parameters check  so you can 
> call directly like that
> {code}
> run service : createProduct, with: context
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (OFBIZ-9523) Improve groovy DSL : runService call makeValidContext

2017-07-31 Thread Jacques Le Roux (JIRA)

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

Jacques Le Roux commented on OFBIZ-9523:


Mmm, after reviewing the "Groovy DSL for OFBiz business logic" page and the 
link to GroovyBaseScript.groovy I think it's only a matter of presentation and 
adding some subtleties if nothing has changed since.

> Improve groovy DSL : runService call makeValidContext
> -
>
> Key: OFBIZ-9523
> URL: https://issues.apache.org/jira/browse/OFBIZ-9523
> Project: OFBiz
>  Issue Type: Improvement
>  Components: framework
>Affects Versions: Trunk
>Reporter: Nicolas Malin
>Assignee: Nicolas Malin
> Fix For: Upcoming Release
>
> Attachments: OFBIZ-9523.patch
>
>
> When you call run service with groovy, you need to be sure that all parametes 
> are good for the service call.
> I propose to simplify this dsl with an automatic parameters check  so you can 
> call directly like that
> {code}
> run service : createProduct, with: context
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (OFBIZ-9523) Improve groovy DSL : runService call makeValidContext

2017-07-31 Thread Jacques Le Roux (JIRA)

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

Jacques Le Roux commented on OFBIZ-9523:


Thanks Nicolas,

I actually did not follow recent changes on Groovy DSL and did not know this 
new syntax. 

One thing which begins to worry me, if we want to switch from minilang to 
Groovy DSL, is the lack of API documentation in wiki, like we have for 
minilang. I don't think a wiki page with examples will fly... BTW what about 
OfbizDslDescriptorForEclipse.dsld? 
http://svn.apache.org/viewvc?view=revision=1643183

> Improve groovy DSL : runService call makeValidContext
> -
>
> Key: OFBIZ-9523
> URL: https://issues.apache.org/jira/browse/OFBIZ-9523
> Project: OFBiz
>  Issue Type: Improvement
>  Components: framework
>Affects Versions: Trunk
>Reporter: Nicolas Malin
>Assignee: Nicolas Malin
> Fix For: Upcoming Release
>
> Attachments: OFBIZ-9523.patch
>
>
> When you call run service with groovy, you need to be sure that all parametes 
> are good for the service call.
> I propose to simplify this dsl with an automatic parameters check  so you can 
> call directly like that
> {code}
> run service : createProduct, with: context
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (OFBIZ-9523) Improve groovy DSL : runService call makeValidContext

2017-07-31 Thread Nicolas Malin (JIRA)

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

Nicolas Malin commented on OFBIZ-9523:
--

Hi Jacques,
It's right :)
If you apply this diff on the current RateService.groovy
{code}
Index: applications/accounting/groovyScripts/rate/RateServices.groovy
@@ -104,7 +104,7 @@
 }
 }
 if (parameters.rateAmount) {
-result = run service: 'updateRateAmount', with: parameters
+result = run service: 'updateRateAmount', with: context
 if (ServiceUtil.isError(result)) return result
 }
 return success()
@@ -119,7 +119,7 @@
 lookedUpValue.store()
 
 //expire related rate amount
-result = run service: 'expireRateAmount', with: parameters
+result = run service: 'expireRateAmount', with: context
 if (ServiceUtil.isError(result)) return result
 }
{code}
and run
{code}
./gradlew 'ofbiz --test component=accounting --test suitename=ratetests '
{code}
This works also.

I will update the wiki page with example


> Improve groovy DSL : runService call makeValidContext
> -
>
> Key: OFBIZ-9523
> URL: https://issues.apache.org/jira/browse/OFBIZ-9523
> Project: OFBiz
>  Issue Type: Improvement
>  Components: framework
>Affects Versions: Trunk
>Reporter: Nicolas Malin
>Assignee: Nicolas Malin
> Fix For: Upcoming Release
>
> Attachments: OFBIZ-9523.patch
>
>
> When you call run service with groovy, you need to be sure that all parametes 
> are good for the service call.
> I propose to simplify this dsl with an automatic parameters check  so you can 
> call directly like that
> {code}
> run service : createProduct, with: context
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (OFBIZ-9523) Improve groovy DSL : runService call makeValidContext

2017-07-30 Thread Jacques Le Roux (JIRA)

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

Jacques Le Roux commented on OFBIZ-9523:


Hi Nicolas,

I guess the right syntax is not
bq. run service : createProduct, with: context
? :)
Anyway more on that later at "Groovy DSL for OFBiz business logic" wiki page...


> Improve groovy DSL : runService call makeValidContext
> -
>
> Key: OFBIZ-9523
> URL: https://issues.apache.org/jira/browse/OFBIZ-9523
> Project: OFBiz
>  Issue Type: Improvement
>  Components: framework
>Affects Versions: Trunk
>Reporter: Nicolas Malin
>Assignee: Nicolas Malin
> Fix For: Upcoming Release
>
> Attachments: OFBIZ-9523.patch
>
>
> When you call run service with groovy, you need to be sure that all parametes 
> are good for the service call.
> I propose to simplify this dsl with an automatic parameters check  so you can 
> call directly like that
> {code}
> run service : createProduct, with: context
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (OFBIZ-9523) Improve groovy DSL : runService call makeValidContext

2017-07-24 Thread Nicolas Malin (JIRA)

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

Nicolas Malin commented on OFBIZ-9523:
--

:) yes nice catch,
I commit this on trunk at 1802798

Thanks Jacopo

> Improve groovy DSL : runService call makeValidContext
> -
>
> Key: OFBIZ-9523
> URL: https://issues.apache.org/jira/browse/OFBIZ-9523
> Project: OFBiz
>  Issue Type: Improvement
>  Components: framework
>Affects Versions: Trunk
>Reporter: Nicolas Malin
>Assignee: Nicolas Malin
> Attachments: OFBIZ-9523.patch
>
>
> When you call run service with groovy, you need to be sure that all parametes 
> are good for the service call.
> I propose to simplify this dsl with an automatic parameters check  so you can 
> call directly like that
> {code}
> run service : createProduct, with: context
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (OFBIZ-9523) Improve groovy DSL : runService call makeValidContext

2017-07-23 Thread Jacopo Cappellato (JIRA)

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

Jacopo Cappellato commented on OFBIZ-9523:
--

Thank you Nicolas, it looks really good to me!
One minor detail: when we call runSync we can probably reuse the local variable 
"dispatcher" rather then calling again binding.getVariable(...).

> Improve groovy DSL : runService call makeValidContext
> -
>
> Key: OFBIZ-9523
> URL: https://issues.apache.org/jira/browse/OFBIZ-9523
> Project: OFBiz
>  Issue Type: Improvement
>  Components: framework
>Affects Versions: Trunk
> Environment: When you call run service with groovy, you need to be 
> sure that all parametes are good for the service call.
> I propose to simplify this dsl with an automatic parameters check  so you can 
> call directly like that
> {code}
> run service : createProduct, with: context
> {code}
>Reporter: Nicolas Malin
>Assignee: Nicolas Malin
> Attachments: OFBIZ-9523.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)