[rules-users] Unable to create DSL properly?

Wolfgang Laun wolfgang.laun at gmail.com
Fri May 6 01:44:52 EDT 2011


On 6 May 2011 04:09, boy18nj <boy18nj at gmail.com> wrote:

> Thanks for reply.
>
> Your suggestion did not work me. If you look this provided example-
>
> -ticketing.dsl
> [condition][]There is a customer ticket with status of "{status}"=customer
> :
> Customer( )   ticket : Ticket( customer == customer, status == "{status}" )
> [condition][]There is a "{subscription}" customer with a ticket status of
> "{status}"=customer : Customer(subscription == "{subscription}") ticket :
> Ticket( customer == customer, status == "{status}")
> [consequence][]Log "{message}"=System.out.println("{message} ");
> [consequence][]Escalate the
> ticket=ticket.setStatus("Escalate");update(ticket);
> [consequence][]Send escalation email=sendEscalationEmail( customer, ticket
> );
>
>
> There are quotes everywhere. And you are suggesting me to remove. WOW!!!
>

Surely you know that in DRL and Java string literals must be surrounded by
quotes. I didn't tell you to omit them from everywhere.

As for a DSL, the author decides where there are quotes. You can define
  [when][]There is ""{blurb}""=...
or
  [when][]There is """{blurb}=...
or whatever.


> Please post the corrected code if possible for fire sprinkler example.
>
> [condition][]There is fire in "{room}"=Fire( {room} : room )
[condition][]"{sprinkler}" is in same "{room}" and sprinkler is
"{off}"={sprinkler}: Sprinkler( room == {room}, on == {off} )
[consequence][]Turn on the "{sprinkler}"=modify( {sprinkler} ){setOn(true)};


when
   There is fire in "$room"
   "$sprinkler" is in same "$room" and sprinkler is "false"
then
  Turn on the "$sprinkler"


--
> View this message in context:
> http://drools.46999.n3.nabble.com/Unable-to-create-DSL-properly-tp2901873p2906621.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110506/390de3d3/attachment.html 


More information about the rules-users mailing list