[DISCUSSION] The Simple Map Processor Mini-Language

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

[DISCUSSION] The Simple Map Processor Mini-Language

Jacques Le Roux
Administrator
Hi,

I recently see some activity to replace the minilang by Groovy and that's great.

There is though a question I asked 2 times[1][2] without any answers. It's about the Simple Map Processor Mini-Language:

https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=50233697#Mini-LanguageGuide(Version1-Deprecated)-TheSimpleMapProcessorMini-Language

Shall we keep it as is or replace it, and then by what? Is there already a plan for that? I saw none I'm not wrong.

[1] http://markmail.org/message/z63ff7s7hgm4rb3e
[2] https://s.apache.org/Nm9B

Jacques


Reply | Threaded
Open this post in threaded view
|

Re: [DISCUSSION] The Simple Map Processor Mini-Language

Rishi Solanki
Jacques,
As far as I remember when you raised this in past, and no proposal on how
to replace it.
As simple map processor is used for mapping and validation, So I think we
should take a pause on it and let the remaining minilang to groovy complete.

From my side having simple map processor in minilang (we could also use
XML) should be fine for now. And we can discuss/think/propose on the
alternative ways of doing the same once solution is in place and we agree,
then we can decide weather to remove old way or keep it.

I see similar approach in other projects and they keep supporting both ways
to invoke validation methods for a while.

Best,


Rishi Solanki
Sr Manager, Enterprise Software Development
HotWax Systems Pvt. Ltd.
Direct: +91-9893287847
http://www.hotwaxsystems.com
www.hotwax.co

On Wed, Feb 7, 2018 at 2:57 AM, Jacques Le Roux <
[hidden email]> wrote:

> Hi,
>
> I recently see some activity to replace the minilang by Groovy and that's
> great.
>
> There is though a question I asked 2 times[1][2] without any answers. It's
> about the Simple Map Processor Mini-Language:
>
> https://cwiki.apache.org/confluence/pages/viewpage.action?
> pageId=50233697#Mini-LanguageGuide(Version1-Deprecated)-TheS
> impleMapProcessorMini-Language
>
> Shall we keep it as is or replace it, and then by what? Is there already a
> plan for that? I saw none I'm not wrong.
>
> [1] http://markmail.org/message/z63ff7s7hgm4rb3e
> [2] https://s.apache.org/Nm9B
>
> Jacques
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [DISCUSSION] The Simple Map Processor Mini-Language

taher
I propose a feature freeze on anything related to minilang. Let's just fix
bugs and try to slowly move out.

On Feb 7, 2018 11:36 AM, "Rishi Solanki" <[hidden email]> wrote:

> Jacques,
> As far as I remember when you raised this in past, and no proposal on how
> to replace it.
> As simple map processor is used for mapping and validation, So I think we
> should take a pause on it and let the remaining minilang to groovy
> complete.
>
> From my side having simple map processor in minilang (we could also use
> XML) should be fine for now. And we can discuss/think/propose on the
> alternative ways of doing the same once solution is in place and we agree,
> then we can decide weather to remove old way or keep it.
>
> I see similar approach in other projects and they keep supporting both ways
> to invoke validation methods for a while.
>
> Best,
>
>
> Rishi Solanki
> Sr Manager, Enterprise Software Development
> HotWax Systems Pvt. Ltd.
> Direct: +91-9893287847
> http://www.hotwaxsystems.com
> www.hotwax.co
>
> On Wed, Feb 7, 2018 at 2:57 AM, Jacques Le Roux <
> [hidden email]> wrote:
>
> > Hi,
> >
> > I recently see some activity to replace the minilang by Groovy and that's
> > great.
> >
> > There is though a question I asked 2 times[1][2] without any answers.
> It's
> > about the Simple Map Processor Mini-Language:
> >
> > https://cwiki.apache.org/confluence/pages/viewpage.action?
> > pageId=50233697#Mini-LanguageGuide(Version1-Deprecated)-TheS
> > impleMapProcessorMini-Language
> >
> > Shall we keep it as is or replace it, and then by what? Is there already
> a
> > plan for that? I saw none I'm not wrong.
> >
> > [1] http://markmail.org/message/z63ff7s7hgm4rb3e
> > [2] https://s.apache.org/Nm9B
> >
> > Jacques
> >
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: [DISCUSSION] The Simple Map Processor Mini-Language

Nicolas Malin-2
In reply to this post by Rishi Solanki
Hello,

They was no problem with map processor, we can convert it to a service
call with the same result.
Example currently on party we have :
   <simple-method short-description="Create Contact"
method-name="createContact">...
       <call-map-processor processor-name="person"
in-map-name="parameters" out-map-name="personCtx"
xml-resource="component://party/minilang/party/PartyMapProcs.xml"/>
       <call-service service-name="createPerson" in-map-name="personCtx">
and
     <simple-map-processor name="person">
         <process field="firstName">
             <copy/>
             <not-empty>
                 <fail-property resource="PartyUiLabels"
property="PartyFirstNameMissing"/>
             </not-empty>
         </process>
         <process field="lastName">
             <copy/>
             <not-empty>
                 <fail-property resource="PartyUiLabels"
property="PartyLastNameMissingError"/>
             </not-empty>
         </process>
     </simple-map-processor>

We can convert it to :
     <service name="processMapInterface" ...>
         <attribute name="inputMap" type="java.util.Map" mode="IN"/>
         <attribute name="outputMap" type="java.util.Map" mode="OUT"/>

     </service>
     <service name="processMapPerson" engine="simple" auth="false"
              location="groovy://pathTo/PartyProcessMap.groovy"
invoke="person">
         <implements service="processMapInterface"/>
     </service>

groovy map processor:
     def person {
         Map result = success()
         Map outputMap = [:]
         if (! inputMap) return error(label from: 'PartyUiLabels' text:
'PartyValuesMissingError')
         if (inputMap.lastName) outputMap.lastName = inputMap.lastName
         else return error(label from: 'PartyUiLabels' text:
'PartyLastNameMissingError')
         result.outputMap = outputMap
         return result
     }

groovy origin service:
     Map personCtxResult = run service: 'processMapPerson' with:
[inputMap: parameters]
     run service: 'createPerson' with: personCtxResult.outMap

But if the code is too long we can simplify by DSL (as draft idea):
groovy map processor:
     def person {
         map name: person
         map copy: lastName failed: label('PartyUiLabels',
'PartyLastNameMissingError')
         map copy: firstName to: name
         person.toName = "${lastName}. ${firstName}."
         return map close
     }

groovy origin service:
     Map personCtx = map process: processMapPerson with: parameters
     run service: 'createPerson' with: persontCtx

Nicolas

On 07/02/2018 09:35, Rishi Solanki wrote:

> Jacques,
> As far as I remember when you raised this in past, and no proposal on how
> to replace it.
> As simple map processor is used for mapping and validation, So I think we
> should take a pause on it and let the remaining minilang to groovy complete.
>
> >From my side having simple map processor in minilang (we could also use
> XML) should be fine for now. And we can discuss/think/propose on the
> alternative ways of doing the same once solution is in place and we agree,
> then we can decide weather to remove old way or keep it.
>
> I see similar approach in other projects and they keep supporting both ways
> to invoke validation methods for a while.
>
> Best,
>
>
> Rishi Solanki
> Sr Manager, Enterprise Software Development
> HotWax Systems Pvt. Ltd.
> Direct: +91-9893287847
> http://www.hotwaxsystems.com
> www.hotwax.co
>
> On Wed, Feb 7, 2018 at 2:57 AM, Jacques Le Roux <
> [hidden email]> wrote:
>
>> Hi,
>>
>> I recently see some activity to replace the minilang by Groovy and that's
>> great.
>>
>> There is though a question I asked 2 times[1][2] without any answers. It's
>> about the Simple Map Processor Mini-Language:
>>
>> https://cwiki.apache.org/confluence/pages/viewpage.action?
>> pageId=50233697#Mini-LanguageGuide(Version1-Deprecated)-TheS
>> impleMapProcessorMini-Language
>>
>> Shall we keep it as is or replace it, and then by what? Is there already a
>> plan for that? I saw none I'm not wrong.
>>
>> [1] http://markmail.org/message/z63ff7s7hgm4rb3e
>> [2] https://s.apache.org/Nm9B
>>
>> Jacques
>>
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: [DISCUSSION] The Simple Map Processor Mini-Language

Michael Brohl-3
In reply to this post by taher
+1
Regards,
Michael



> Am 07.02.2018 um 10:13 schrieb Taher Alkhateeb <[hidden email]>:
>
> I propose a feature freeze on anything related to minilang. Let's just fix
> bugs and try to slowly move out.
>
>> On Feb 7, 2018 11:36 AM, "Rishi Solanki" <[hidden email]> wrote:
>>
>> Jacques,
>> As far as I remember when you raised this in past, and no proposal on how
>> to replace it.
>> As simple map processor is used for mapping and validation, So I think we
>> should take a pause on it and let the remaining minilang to groovy
>> complete.
>>
>> From my side having simple map processor in minilang (we could also use
>> XML) should be fine for now. And we can discuss/think/propose on the
>> alternative ways of doing the same once solution is in place and we agree,
>> then we can decide weather to remove old way or keep it.
>>
>> I see similar approach in other projects and they keep supporting both ways
>> to invoke validation methods for a while.
>>
>> Best,
>>
>>
>> Rishi Solanki
>> Sr Manager, Enterprise Software Development
>> HotWax Systems Pvt. Ltd.
>> Direct: +91-9893287847
>> http://www.hotwaxsystems.com
>> www.hotwax.co
>>
>> On Wed, Feb 7, 2018 at 2:57 AM, Jacques Le Roux <
>> [hidden email]> wrote:
>>
>>> Hi,
>>>
>>> I recently see some activity to replace the minilang by Groovy and that's
>>> great.
>>>
>>> There is though a question I asked 2 times[1][2] without any answers.
>> It's
>>> about the Simple Map Processor Mini-Language:
>>>
>>> https://cwiki.apache.org/confluence/pages/viewpage.action?
>>> pageId=50233697#Mini-LanguageGuide(Version1-Deprecated)-TheS
>>> impleMapProcessorMini-Language
>>>
>>> Shall we keep it as is or replace it, and then by what? Is there already
>> a
>>> plan for that? I saw none I'm not wrong.
>>>
>>> [1] http://markmail.org/message/z63ff7s7hgm4rb3e
>>> [2] https://s.apache.org/Nm9B
>>>
>>> Jacques
>>>
>>>
>>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: [DISCUSSION] The Simple Map Processor Mini-Language

Rishi Solanki
+1 Taher, I also proposed to take pause and go slow on conversion.


Thanks!

Rishi Solanki
Sr Manager, Enterprise Software Development
HotWax Systems Pvt. Ltd.
Direct: +91-9893287847
http://www.hotwaxsystems.com
www.hotwax.co

On Thu, Feb 8, 2018 at 12:40 AM, Michael Brohl <[hidden email]>
wrote:

> +1
> Regards,
> Michael
>
>
>
> > Am 07.02.2018 um 10:13 schrieb Taher Alkhateeb <
> [hidden email]>:
> >
> > I propose a feature freeze on anything related to minilang. Let's just
> fix
> > bugs and try to slowly move out.
> >
> >> On Feb 7, 2018 11:36 AM, "Rishi Solanki" <[hidden email]>
> wrote:
> >>
> >> Jacques,
> >> As far as I remember when you raised this in past, and no proposal on
> how
> >> to replace it.
> >> As simple map processor is used for mapping and validation, So I think
> we
> >> should take a pause on it and let the remaining minilang to groovy
> >> complete.
> >>
> >> From my side having simple map processor in minilang (we could also use
> >> XML) should be fine for now. And we can discuss/think/propose on the
> >> alternative ways of doing the same once solution is in place and we
> agree,
> >> then we can decide weather to remove old way or keep it.
> >>
> >> I see similar approach in other projects and they keep supporting both
> ways
> >> to invoke validation methods for a while.
> >>
> >> Best,
> >>
> >>
> >> Rishi Solanki
> >> Sr Manager, Enterprise Software Development
> >> HotWax Systems Pvt. Ltd.
> >> Direct: +91-9893287847
> >> http://www.hotwaxsystems.com
> >> www.hotwax.co
> >>
> >> On Wed, Feb 7, 2018 at 2:57 AM, Jacques Le Roux <
> >> [hidden email]> wrote:
> >>
> >>> Hi,
> >>>
> >>> I recently see some activity to replace the minilang by Groovy and
> that's
> >>> great.
> >>>
> >>> There is though a question I asked 2 times[1][2] without any answers.
> >> It's
> >>> about the Simple Map Processor Mini-Language:
> >>>
> >>> https://cwiki.apache.org/confluence/pages/viewpage.action?
> >>> pageId=50233697#Mini-LanguageGuide(Version1-Deprecated)-TheS
> >>> impleMapProcessorMini-Language
> >>>
> >>> Shall we keep it as is or replace it, and then by what? Is there
> already
> >> a
> >>> plan for that? I saw none I'm not wrong.
> >>>
> >>> [1] http://markmail.org/message/z63ff7s7hgm4rb3e
> >>> [2] https://s.apache.org/Nm9B
> >>>
> >>> Jacques
> >>>
> >>>
> >>>
> >>
>
>