On 6 May 2011 04:09, boy18nj <boy18nj@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@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users