Index Changes

Difference between version and version     

Back to Fuji EIPCBR, or Fuji EIPCBR Info


At line 24 changed 1 line.
[when [ value | condition-identifier inline-rules-definition] to route-name ]*
[when [ value | condition-identifier inline-rules-definition] to [route-name | service-name] ]*
At line 40 changed 2 lines.
\\
There exists one configuration parameter: firstMatch. Default value is true. If set to false, the condition based rule matching will only trigger if a single rule is found to match. Otherwise if multiple rules match, or no rules match, the else clause will be selected.
\\ \\
There exists one configuration parameter: {{{match=first|last|unique}}}. Default value is {{{first}}}. In this case the first condition based rule that matches will trigger. If set to {{{last}}}, the last condition based rule that matches will trigger. If set to {{{unique}}}, the condition based rule matching will trigger only if a single rule is found to match. Otherwise, if multiple rules match, or no rules match, the else clause will be selected.
At line 47 added 1 line.
email "exception-service"
At line 53 changed 1 line.
else to "other-transaction"
else to "exception-service"
At line 59 added 1 line.
email "other-service"
At line 62 changed 1 line.
when "false" to "other-transaction
when "false" to "other-service"
At line 97 changed 1 line.
!! Dynamic updates
! Additional functionality
One feature that is more useful in this context is the group support in Regex. If a Regex group is detected, the filter selects the [Group(1) | http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html] value as its result. This allows extracting a value to be used as a when expression test.
Sample IFL:
{{{
select header ("nm.attachment=MyAttachment,exp=(\w/\w);.*")
when "text/xml" to "xml-reader"
when "application/octet-stream" to "binary-reader"
else "unsupported-attachment-type"
}}}
If the attachment content type is "text/xml;ISO-8859-1", "text/xml" is returned.
Another useful feature is a new property that controls the selection policy. By default, the selection policy is first match. Also, rules can be grouped and ordered within groups to control the evaluation order. The selection policy can be changed to either last match or unique match. When last match is used, the last matching rule triggers, or the else if there is no match. When unique match is used, a rule triggers only if it is the only rule that matches. In the case of multiple matches, the else clause will be selected if it exists. Otherwise, an error is returned.
Example of match property:
{{{
select any ("match=unique") do
when xpath "/Value=5" to "service-a"
when xpath "/Time=now" to "service=b"
else to "service-c"
end
}}}
If Value==5 and Time==now then the else clause will be triggered.
If, in the above case, match is set to first then "service-a" would be invoked, and if match is set to last then "service-b" would be invoked.
! Dynamic update examples
At line 104 changed 2 lines.
#when xpath ("/Trade/Type='CASH'") to "route-cash"
#when xpath ("/Trade/Amount>600000") to "route-big"
when xpath ("/Trade/Type='CASH'") to "route-cash"
when xpath ("/Trade/Amount>600000") to "route-big"
At line 265 changed 1 line.
Where '{name}' is the named ruleset as defined in the IFL. If the named rule set has a default value it will be located in the cbr/{name}/-default-.yml. The default value comes from any condition based when clauses present in the IFL source. Additional rules can be added dynamically. The priority for the default rule group is 10.0.
Where '{name}' is the named ruleset as defined in the IFL. If the named rule set has a default value it will be located in the cbr/{name}/-default-.yml. The default value comes from any condition based when clauses present in the IFL source. Additional rules can be added dynamically. The priority for the default rule group is 100.0.
At line 268 removed 12 lines.
One feature that is more useful in this context is the group support in Regex. If a Regex group is detected, the filter selects the [Group(1) | http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html] value as its result. This allows extracting a value to be used as a when expression test.
! Example
{{{
select header ("nm.attachment=MyAttachment,exp=(\w/\w);.*")
when "text/xml" to "xml-reader"
when "application/octet-stream" to "binary-reader"
else "unsupported-attachment-type"
If the attachment content type is "text/xml;ISO-8859-1", "text/xml" is returned.
}}}

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This page (revision-31) was last changed on 03-Nov-09 23:12 PM, -0800 by MarkWhite