ImpactHandlers
Identifier:
ilog.rules.studio.model.impactHandlers
Since:
JRules 6.5
Description:
Allows plug-ins to specify impact handlers that compute the resource elements impacted by changes on a given resource.
This is used by services such as the build mechanism to determine wich resource element should be (re)compiled after a resource has changed.
Configuration Markup:
<!ELEMENT extension (impactHandler+)>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
- point - A fully qualified identifier of the target extension point.
- id - An optional identifier of the extension instance.
- name - An optional name of the extension instance.
<!ELEMENT impactHandler EMPTY>
<!ATTLIST impactHandler
id CDATA #REQUIRED
class CDATA #REQUIRED>
- id - ID of the impact handler.
- class - The fully-qualified name of a Java class that implements the ilog.rules.studio.model.builder.IlrImpactHandler interface.
This Java class must have a public default constructor.
Examples:
<extension point=
"ilog.rules.studio.model.impactHandlers"
>
<!-- Handler that analyzes and returns the impact of changes on rule package resources -->
<impactHandler
class=
"sample.RulePackageChangesImpactHandler"
id=
"sample.rulePackageImpactHandlerID"
/>
<!-- Handler that returns a set of ruleflows invalidated by a change on a resource (rules, functions, and any other resources) -->
<impactHandler
class=
"sample.InvalidatedRuleFlowsFinder"
id=
"sample.InvalidatedRuleFlowsFinder"
/>
</extension>
API Information:
There are many ways in which you can use impact handlers to perform impact analysis.
For example, you can return resource elements impacted by a given type of resource:
Set result = ...;
if ("brl".equals(resource.getFileExtension()) {
...
// Collects decision tables impacted by the action rule
set.add(decisionTables);
// Collects rules impacted by the action rule
set.add(rules);
// Collects ruleflows impacted by the action rule
set.add(rules);
}
return result;
You can also return only a specific type of artifact or handler:
Set result = ...;
Set ruleFlows = ...; // Computes or gets ruleflows that should be analyzed by the impact handler
for (Iterator it=ruleFlows.iterator();it.hasNext();) {
IlrRuleFlow ruleFlow = (IlrRuleFlow) it.next();
if (isImpactedBy(ruleFlow, resource)
result.add(ruleFlow);
}
return result;
Copyright © 1987-2008 ILOG S.A. All rights reserved.