2011/6/2 ChrisMu <christopher.mullard@credit-suisse.com>
Yes I've RTFM :)Can't see much about header text though other than saying it's in the template
From: Wolfgang Laun-2 [via Drools] [mailto:[hidden email]]Sent: 01 June 2011 17:31
To: Mullard, Christopher
Subject: Re: [rules-users] Smart TemplatesYou just add it to the template file as "header text".
Have you read the documentation on templates? Which version?
-W
2011/6/1 ChrisMu <[hidden email]>
Ok, thanks, but how do I do that in a template?
In the Drools Expert manual, search for
From: Wolfgang Laun-2 [via Drools] [mailto:[hidden email]]
Sent: 01 June 2011 15:46
To: Mullard, Christopher
Subject: Re: [rules-users] Smart Templates
"And, finally, here is an example of Import, Variables and Functions."
The figure below shows cells from a spreadsheet.
-W
2011/6/1 ChrisMu <[hidden email]>
Sorry - you're losing me - could you give an example please?
Thanks
From: Wolfgang Laun-2 [via Drools] [mailto:[hidden email]]Sent: 01 June 2011 15:25
To: Mullard, Christopher
Subject: Re: [rules-users] Smart TemplatesIt's just like a Java static method. Call JAva code if you don't want to put it all into DRL function, or import from Java in the first place. Both "import" and "function" can be used in spreadsheets.
-W2011/6/1 ChrisMu <[hidden email]>
Agreed, but this was just an example - if the function required something more complicated - say a DB lookup, could it be done?
If there are just 2 types (IRDELTA, COMLEASEDELTA) you can add a function that computes this from the 3-letter name.
From: Wolfgang Laun-2 [via Drools] [mailto:[hidden email]]
Sent: 01 June 2011 12:40
To: Mullard, Christopher
Subject: Re: [rules-users] Smart Templates
-W
2011/6/1 ChrisMu <[hidden email]>
Possibly. Let me try again with what I'm trying to achieve.Given this excerpt from a decision table:Basically I want to be able to specify a template that says 'If Arg0 is a currency, output RiskType IRDELTA (and currency), if Arg0 is a commodity (begins with 'X') then output RiskType COMLEASEDELTA (and commodity).When fed with data, this would generate the rules:when Arg0 = USD, output RiskType IRDELTA, USDwhen Arg0 = GBP, output RiskType IRDELTA, GBPetcwhen Arg0 = XAU, output RiskType COMLEASEDELTA, XAUetcIn this way theRiskType name is inferred from the data when the rules are generated. It can be done by explicitly stating all possible combinations as in the decision table above but that gets tedious quickly. I wanted to have a more general template that could generate all the specific rules instances.Does that make more sense?ThanksChrisI don't want to confuse you, but have you considered not using templates at all? If you can generate N rules from N objects containing different literals for matching a fact or for updating a fact field, then you can achieve the same thing with a single rule and additional facts containing those literal values.
From: Wolfgang Laun-2 [via Drools] [mailto:[hidden email]]
Sent: 01 June 2011 11:21
To: Mullard, Christopher
Subject: Re: [rules-users] Smart Templates
rule "one 4 all"
when
  Service( $name: name, $value: value )
  $sb: ServiceBean( name == $name, value == $value )
then
  # RiskType ... is what?
  ...$value..., ...$sb.getType()...
end
-W
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
If you reply to this email, your message will be added to the discussion below:http://drools.46999.n3.nabble.com/Smart-Templates-tp3006479p3010097.htmlTo unsubscribe from Smart Templates, click here.
==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================
View this message in context: RE: [rules-users] Smart Templates
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
If you reply to this email, your message will be added to the discussion below:http://drools.46999.n3.nabble.com/Smart-Templates-tp3006479p3010275.htmlTo unsubscribe from Smart Templates, click here.
==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================
View this message in context: RE: [rules-users] Smart Templates
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
http://drools.46999.n3.nabble.com/Smart-Templates-tp3006479p3010989.htmlIf you reply to this email, your message will be added to the discussion below:To unsubscribe from Smart Templates, click here.
==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================
View this message in context: RE: [rules-users] Smart Templates
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
If you reply to this email, your message will be added to the discussion below:http://drools.46999.n3.nabble.com/Smart-Templates-tp3006479p3011098.htmlTo unsubscribe from Smart Templates, click here.
==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================
View this message in context: RE: [rules-users] Smart Templates
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
http://drools.46999.n3.nabble.com/Smart-Templates-tp3006479p3011587.htmlIf you reply to this email, your message will be added to the discussion below:To unsubscribe from Smart Templates, click here.==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================
View this message in context: RE: [rules-users] Smart Templates
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