Search in sources :

Example 1 with ConsequenceAction

use of org.drools.impact.analysis.model.right.ConsequenceAction in project drools by kiegroup.

the class ModelToGraphConverter method parseGraphAnalysis.

private void parseGraphAnalysis(AnalysisModel model, GraphAnalysis graphAnalysis) {
    for (Package pkg : model.getPackages()) {
        String pkgName = pkg.getName();
        List<Rule> rules = pkg.getRules();
        for (Rule rule : rules) {
            String ruleName = rule.getName();
            RightHandSide rhs = rule.getRhs();
            List<ConsequenceAction> actions = rhs.getActions();
            for (ConsequenceAction action : actions) {
                switch(action.getType()) {
                    case INSERT:
                        processInsert(graphAnalysis, pkgName, ruleName, (InsertAction) action);
                        break;
                    case DELETE:
                        processDelete(graphAnalysis, pkgName, ruleName, action);
                        break;
                    case MODIFY:
                        processModify(graphAnalysis, pkgName, ruleName, (ModifyAction) action);
                        break;
                }
            }
        }
    }
}
Also used : ConsequenceAction(org.drools.impact.analysis.model.right.ConsequenceAction) Package(org.drools.impact.analysis.model.Package) Rule(org.drools.impact.analysis.model.Rule) RightHandSide(org.drools.impact.analysis.model.right.RightHandSide)

Aggregations

Package (org.drools.impact.analysis.model.Package)1 Rule (org.drools.impact.analysis.model.Rule)1 ConsequenceAction (org.drools.impact.analysis.model.right.ConsequenceAction)1 RightHandSide (org.drools.impact.analysis.model.right.RightHandSide)1