The exception handler and the automatic exception handling are ruleset properties in the rule project info.
You can modify then with the API as illustrated in this method
private void updateProject(IlrSession dataProvider, IlrBaseline baseline, String useAEH, String exceptionHandlerClass) throws IlrApplicationException {
IlrProjectInfo info = baseline.getProjectInfo();
IlrCommitableObject co = new IlrCommitableObject((IlrElementHandle)info);
co.setRootDetails((IlrElementDetails)info);
IlrBrmPackage brm = dataProvider.getBrmPackage();
List<IlrRulesetProperty> properties = info.getRulesetProperties();
// delete existing properties
for (IlrRulesetProperty ilrRulesetProperty : properties) {
if (ilrRulesetProperty.getKey().equals("AutomaticExceptionHandler"))
co.addDeletedElement(brm.getProjectInfo_RulesetProperties(), (IlrElementDetails)ilrRulesetProperty);
if (ilrRulesetProperty.getKey().equals("CustomExceptionHandler"))
co.addDeletedElement(brm.getProjectInfo_RulesetProperties(), (IlrElementDetails)ilrRulesetProperty);
}
// add automatic exception handling
if ("true".equals(useAEH)) {
IlrRulesetProperty aProp = (IlrRulesetProperty)((IlrSessionEx)dataProvider).createElementDetails(brm.getRulesetProperty());
aProp.setRawValue((EStructuralFeature)brm.getRulesetProperty_Key(), "AutomaticExceptionHandler");
aProp.setRawValue((EStructuralFeature)brm.getRulesetProperty_Value(), "true");
co.addModifiedElement(brm.getProjectInfo_RulesetProperties(), (IlrElementDetails)aProp);
}
// add a custom exception handler
if (exceptionHandlerClass != null) {
IlrRulesetProperty aProp = (IlrRulesetProperty)((IlrSessionEx)dataProvider).createElementDetails(brm.getRulesetProperty());
aProp.setRawValue((EStructuralFeature)brm.getRulesetProperty_Key(), "CustomExceptionHandler");
aProp.setRawValue((EStructuralFeature)brm.getRulesetProperty_Value(), exceptionHandlerClass);
co.addModifiedElement(brm.getProjectInfo_RulesetProperties(), (IlrElementDetails)aProp);
}
// save in the repository
dataProvider.commit(co);
}
Hope this helps------------------------------
Alain Robert
------------------------------