Search in sources :

Example 1 with ActionRetractFact

use of org.drools.workbench.models.datamodel.rule.ActionRetractFact in project drools by kiegroup.

the class RuleTemplateModelXMLPersistenceTest method getComplexModel.

private TemplateModel getComplexModel() {
    final TemplateModel m = new TemplateModel();
    m.addAttribute(new RuleAttribute("no-loop", "true"));
    final FactPattern pat = new FactPattern("Person");
    pat.setBoundName("p1");
    final SingleFieldConstraint con = new SingleFieldConstraint();
    con.setFactType("Person");
    con.setFieldBinding("f1");
    con.setFieldName("age");
    con.setOperator("<");
    con.setValue("42");
    pat.addConstraint(con);
    m.addLhsItem(pat);
    final CompositeFactPattern comp = new CompositeFactPattern("not");
    comp.addFactPattern(new FactPattern("Cancel"));
    m.addLhsItem(comp);
    final ActionUpdateField set = new ActionUpdateField();
    set.setVariable("p1");
    set.addFieldValue(new ActionFieldValue("status", "rejected", DataType.TYPE_STRING));
    m.addRhsItem(set);
    final ActionRetractFact ret = new ActionRetractFact("p1");
    m.addRhsItem(ret);
    final DSLSentence sen = new DSLSentence();
    sen.setDefinition("Send an email to {administrator}");
    m.addRhsItem(sen);
    return m;
}
Also used : BaseSingleFieldConstraint(org.drools.workbench.models.datamodel.rule.BaseSingleFieldConstraint) SingleFieldConstraint(org.drools.workbench.models.datamodel.rule.SingleFieldConstraint) ActionRetractFact(org.drools.workbench.models.datamodel.rule.ActionRetractFact) ActionUpdateField(org.drools.workbench.models.datamodel.rule.ActionUpdateField) ActionFieldValue(org.drools.workbench.models.datamodel.rule.ActionFieldValue) RuleAttribute(org.drools.workbench.models.datamodel.rule.RuleAttribute) CompositeFactPattern(org.drools.workbench.models.datamodel.rule.CompositeFactPattern) FactPattern(org.drools.workbench.models.datamodel.rule.FactPattern) CompositeFactPattern(org.drools.workbench.models.datamodel.rule.CompositeFactPattern) TemplateModel(org.drools.workbench.models.guided.template.shared.TemplateModel) DSLSentence(org.drools.workbench.models.datamodel.rule.DSLSentence)

Example 2 with ActionRetractFact

use of org.drools.workbench.models.datamodel.rule.ActionRetractFact in project drools by kiegroup.

the class RuleModelTest method testRemoveItemRhs.

@Test
public void testRemoveItemRhs() {
    final RuleModel model = new RuleModel();
    model.rhs = new IAction[3];
    final ActionRetractFact r0 = new ActionRetractFact("x");
    final ActionRetractFact r1 = new ActionRetractFact("y");
    final ActionRetractFact r2 = new ActionRetractFact("z");
    model.rhs[0] = r0;
    model.rhs[1] = r1;
    model.rhs[2] = r2;
    model.removeRhsItem(1);
    assertEquals(2, model.rhs.length);
    assertEquals(r0, model.rhs[0]);
    assertEquals(r2, model.rhs[1]);
}
Also used : ActionRetractFact(org.drools.workbench.models.datamodel.rule.ActionRetractFact) RuleModel(org.drools.workbench.models.datamodel.rule.RuleModel) Test(org.junit.Test)

Example 3 with ActionRetractFact

use of org.drools.workbench.models.datamodel.rule.ActionRetractFact in project drools by kiegroup.

the class RuleModelDRLPersistenceImpl method parseRhs.

private void parseRhs(final RuleModel m, final String rhs, final boolean isJavaDialect, final Map<String, String> boundParams, final ExpandedDRLInfo expandedDRLInfo, final PackageDataModelOracle dmo, final Collection<RuleModelIActionPersistenceExtension> extensions) throws RuleModelDRLPersistenceException {
    PortableWorkDefinition pwd = null;
    Map<String, List<String>> setStatements = new HashMap<String, List<String>>();
    Map<String, Integer> setStatementsPosition = new HashMap<String, Integer>();
    Map<String, String> factsType = new HashMap<String, String>();
    String modifiedVariable = null;
    String modifiers = null;
    int lineCounter = -1;
    String[] lines = rhs.split("\n");
    for (String line : lines) {
        lineCounter++;
        line = line.trim();
        List<RuleModelIActionPersistenceExtension> matchingExtensions = getMatchingExtensionsForLine(line, extensions);
        if (matchingExtensions.isEmpty()) {
        // Continue with hardcoded parsers
        } else if (matchingExtensions.size() > 1) {
            throw new RuleModelDRLPersistenceException("Ambiguous RuleModelIActionPersistenceExtension implementations (" + matchingExtensions + ") found for line " + line);
        } else {
            unmarshalUsingExtension(m, matchingExtensions.get(0), line);
            continue;
        }
        if (expandedDRLInfo.hasDsl) {
            String dslLine = expandedDRLInfo.dslStatementsInRhs.get(lineCounter);
            while (dslLine != null) {
                List<RuleModelIActionPersistenceExtension> matchingExtensionsDslLine = getMatchingExtensionsForLine(dslLine, extensions);
                if (matchingExtensionsDslLine.isEmpty()) {
                    m.addRhsItem(toDSLSentence(expandedDRLInfo.rhsDslPatterns, dslLine));
                } else if (matchingExtensionsDslLine.size() > 1) {
                    throw new RuleModelDRLPersistenceException("Ambiguous RuleModelIActionPersistenceExtension implementations (" + matchingExtensionsDslLine + ") found for line " + line);
                } else {
                    unmarshalUsingExtension(m, matchingExtensionsDslLine.get(0), dslLine);
                }
                dslLine = expandedDRLInfo.dslStatementsInRhs.get(++lineCounter);
            }
        }
        if (modifiedVariable != null) {
            int modifyBlockEnd = line.lastIndexOf('}');
            if (modifiers == null) {
                modifiers = modifyBlockEnd > 0 ? line.substring(line.indexOf('{') + 1, modifyBlockEnd).trim() : line.substring(line.indexOf('{') + 1).trim();
            } else if (modifyBlockEnd != 0) {
                modifiers += modifyBlockEnd > 0 ? line.substring(0, modifyBlockEnd).trim() : line;
            }
            if (modifyBlockEnd >= 0) {
                ActionUpdateField action = new ActionUpdateField();
                action.setVariable(modifiedVariable);
                m.addRhsItem(action);
                addModifiersToAction(modifiers, action, modifiedVariable, boundParams, dmo, m, isJavaDialect);
                modifiedVariable = null;
                modifiers = null;
            }
        } else if (line.startsWith("insertLogical")) {
            String fact = unwrapParenthesis(line);
            String type = getStatementType(fact, factsType);
            if (type != null) {
                boundParams.put(fact, type);
                ActionInsertLogicalFact action = new ActionInsertLogicalFact(type);
                m.addRhsItem(action);
                if (factsType.containsKey(fact)) {
                    action.setBoundName(fact);
                    addSettersToAction(setStatements, fact, action, boundParams, dmo, m, isJavaDialect);
                }
            }
        } else if (line.startsWith("insert")) {
            String fact = unwrapParenthesis(line);
            String type = getStatementType(fact, factsType);
            if (type != null) {
                boundParams.put(fact, type);
                ActionInsertFact action = new ActionInsertFact(type);
                m.addRhsItem(action);
                if (factsType.containsKey(fact)) {
                    action.setBoundName(fact);
                    addSettersToAction(setStatements, fact, action, boundParams, dmo, m, isJavaDialect);
                }
            }
        } else if (line.startsWith("update")) {
            String variable = unwrapParenthesis(line);
            ActionUpdateField action = new ActionUpdateField();
            action.setVariable(variable);
            m.addRhsItem(action);
            addSettersToAction(setStatements, variable, action, boundParams, dmo, m, isJavaDialect);
        } else if (line.startsWith("modify")) {
            int modifyBlockEnd = line.lastIndexOf('}');
            if (modifyBlockEnd > 0) {
                String variable = line.substring(line.indexOf('(') + 1, line.indexOf(')')).trim();
                ActionUpdateField action = new ActionUpdateField();
                action.setVariable(variable);
                m.addRhsItem(action);
                addModifiersToAction(line.substring(line.indexOf('{') + 1, modifyBlockEnd).trim(), action, variable, boundParams, dmo, m, isJavaDialect);
            } else {
                modifiedVariable = line.substring(line.indexOf('(') + 1, line.indexOf(')')).trim();
                int modifyBlockStart = line.indexOf('{');
                if (modifyBlockStart > 0) {
                    modifiers = line.substring(modifyBlockStart + 1).trim();
                }
            }
        } else if (line.startsWith("retract") || line.startsWith("delete")) {
            String variable = unwrapParenthesis(line);
            m.addRhsItem(new ActionRetractFact(variable));
        } else if (line.startsWith("org.drools.core.process.instance.impl.WorkItemImpl wiWorkItem")) {
            ActionExecuteWorkItem awi = new ActionExecuteWorkItem();
            pwd = new PortableWorkDefinition();
            pwd.setName("WorkItem");
            awi.setWorkDefinition(pwd);
            m.addRhsItem(awi);
        } else if (line.startsWith("wiWorkItem.getParameters().put")) {
            String statement = line.substring("wiWorkItem.getParameters().put".length());
            statement = unwrapParenthesis(statement);
            int commaPos = statement.indexOf(',');
            String name = statement.substring(0, commaPos).trim();
            String value = statement.substring(commaPos + 1).trim();
            pwd.addParameter(buildPortableParameterDefinition(name, value, boundParams));
        } else if (line.startsWith("wim.internalExecuteWorkItem") || line.startsWith("wiWorkItem.setName")) {
        // ignore
        } else {
            int dotPos = line.indexOf('.');
            int argStart = line.indexOf('(');
            if (dotPos > 0 && argStart > dotPos) {
                String variable = line.substring(0, dotPos).trim();
                if (boundParams.containsKey(variable) || factsType.containsKey(variable) || expandedDRLInfo.hasGlobal(variable)) {
                    if (isJavaIdentifier(variable)) {
                        String methodName = line.substring(dotPos + 1, argStart).trim();
                        if (isJavaIdentifier(methodName)) {
                            if (getSettedField(m, methodName, boundParams.get(variable), dmo) != null) {
                                List<String> setters = setStatements.get(variable);
                                if (setters == null) {
                                    setters = new ArrayList<String>();
                                    setStatements.put(variable, setters);
                                }
                                if (!setStatementsPosition.containsKey(variable)) {
                                    setStatementsPosition.put(variable, lineCounter);
                                }
                                setters.add(line);
                            } else if (methodName.equals("add") && expandedDRLInfo.hasGlobal(variable)) {
                                String factName = line.substring(argStart + 1, line.lastIndexOf(')')).trim();
                                ActionGlobalCollectionAdd actionGlobalCollectionAdd = new ActionGlobalCollectionAdd();
                                actionGlobalCollectionAdd.setGlobalName(variable);
                                actionGlobalCollectionAdd.setFactName(factName);
                                m.addRhsItem(actionGlobalCollectionAdd);
                            } else {
                                m.addRhsItem(getActionCallMethod(m, isJavaDialect, boundParams, dmo, line, variable, methodName));
                            }
                            continue;
                        }
                    }
                }
            }
            int eqPos = line.indexOf('=');
            boolean addFreeFormLine = line.trim().length() > 0;
            if (eqPos > 0) {
                String field = line.substring(0, eqPos).trim();
                if ("java.text.SimpleDateFormat sdf".equals(field) || "org.drools.core.process.instance.WorkItemManager wim".equals(field)) {
                    addFreeFormLine = false;
                }
                String[] split = field.split(" ");
                if (split.length == 2) {
                    factsType.put(split[1], split[0]);
                    addFreeFormLine &= !isInsertedFact(lines, lineCounter, split[1]);
                }
            }
            if (addFreeFormLine) {
                FreeFormLine ffl = new FreeFormLine();
                ffl.setText(line);
                m.addRhsItem(ffl);
            }
        }
    }
    // variable they are modifying was recorded as Free Format DRL and hence the "sets" need to be Free Format DRL too.
    for (Map.Entry<String, List<String>> entry : setStatements.entrySet()) {
        if (boundParams.containsKey(entry.getKey())) {
            ActionSetField action = new ActionSetField(entry.getKey());
            addSettersToAction(entry.getValue(), action, entry.getKey(), boundParams, dmo, m, isJavaDialect);
            m.addRhsItem(action, setStatementsPosition.get(entry.getKey()));
        } else {
            FreeFormLine action = new FreeFormLine();
            StringBuilder sb = new StringBuilder();
            for (String setter : entry.getValue()) {
                sb.append(setter).append("\n");
            }
            action.setText(sb.toString());
            m.addRhsItem(action, setStatementsPosition.get(entry.getKey()));
        }
    }
    if (expandedDRLInfo.hasDsl) {
        String dslLine = expandedDRLInfo.dslStatementsInRhs.get(++lineCounter);
        while (dslLine != null) {
            m.addRhsItem(toDSLSentence(expandedDRLInfo.rhsDslPatterns, dslLine));
            dslLine = expandedDRLInfo.dslStatementsInRhs.get(++lineCounter);
        }
    }
}
Also used : HashMap(java.util.HashMap) ActionRetractFact(org.drools.workbench.models.datamodel.rule.ActionRetractFact) ActionUpdateField(org.drools.workbench.models.datamodel.rule.ActionUpdateField) PortableWorkDefinition(org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition) ArrayList(java.util.ArrayList) StringUtils.splitArgumentsList(org.drools.core.util.StringUtils.splitArgumentsList) List(java.util.List) ActionFieldList(org.drools.workbench.models.datamodel.rule.ActionFieldList) ActionExecuteWorkItem(org.drools.workbench.models.datamodel.rule.ActionExecuteWorkItem) RuleModelDRLPersistenceException(org.drools.workbench.models.commons.backend.rule.exception.RuleModelDRLPersistenceException) FieldConstraint(org.drools.workbench.models.datamodel.rule.FieldConstraint) ConnectiveConstraint(org.drools.workbench.models.datamodel.rule.ConnectiveConstraint) CompositeFieldConstraint(org.drools.workbench.models.datamodel.rule.CompositeFieldConstraint) SingleFieldConstraint(org.drools.workbench.models.datamodel.rule.SingleFieldConstraint) BaseSingleFieldConstraint(org.drools.workbench.models.datamodel.rule.BaseSingleFieldConstraint) FreeFormLine(org.drools.workbench.models.datamodel.rule.FreeFormLine) ActionSetField(org.drools.workbench.models.datamodel.rule.ActionSetField) ActionInsertFact(org.drools.workbench.models.datamodel.rule.ActionInsertFact) ActionGlobalCollectionAdd(org.drools.workbench.models.datamodel.rule.ActionGlobalCollectionAdd) Map(java.util.Map) HashMap(java.util.HashMap) ActionInsertLogicalFact(org.drools.workbench.models.datamodel.rule.ActionInsertLogicalFact)

Example 4 with ActionRetractFact

use of org.drools.workbench.models.datamodel.rule.ActionRetractFact in project drools by kiegroup.

the class RuleModelDRLPersistenceTest method getComplexModel.

private RuleModel getComplexModel(boolean useDsl) {
    final RuleModel m = new RuleModel();
    m.name = "Complex Rule";
    m.setPackageName("org.test");
    m.addAttribute(new RuleAttribute("no-loop", "true"));
    m.addAttribute(new RuleAttribute("salience", "-10"));
    m.addAttribute(new RuleAttribute("agenda-group", "aGroup"));
    final FactPattern pat = new FactPattern("Person");
    pat.setBoundName("p1");
    final SingleFieldConstraint con = new SingleFieldConstraint();
    con.setFieldBinding("f1");
    con.setFieldName("age");
    con.setOperator("<");
    con.setValue("42");
    pat.addConstraint(con);
    m.addLhsItem(pat);
    final CompositeFactPattern comp = new CompositeFactPattern("not");
    comp.addFactPattern(new FactPattern("Cancel"));
    m.addLhsItem(comp);
    final ActionUpdateField upd1 = new ActionUpdateField();
    upd1.setVariable("p1");
    upd1.addFieldValue(new ActionFieldValue("status", "rejected", DataType.TYPE_STRING));
    upd1.addFieldValue(new ActionFieldValue("name", "Fred", DataType.TYPE_STRING));
    m.addRhsItem(upd1);
    final ActionRetractFact ret = new ActionRetractFact("p1");
    m.addRhsItem(ret);
    if (useDsl) {
        final DSLSentence sen = new DSLSentence();
        sen.setDefinition("Send an email to {administrator}");
        m.addRhsItem(sen);
    }
    addModelField("org.test.Person", "this", "org.test.Person", DataType.TYPE_THIS);
    addModelField("org.test.Person", "age", Integer.class.getName(), DataType.TYPE_NUMERIC_INTEGER);
    addModelField("org.test.Person", "status", String.class.getName(), DataType.TYPE_STRING);
    return m;
}
Also used : SingleFieldConstraint(org.drools.workbench.models.datamodel.rule.SingleFieldConstraint) BaseSingleFieldConstraint(org.drools.workbench.models.datamodel.rule.BaseSingleFieldConstraint) ActionRetractFact(org.drools.workbench.models.datamodel.rule.ActionRetractFact) ActionUpdateField(org.drools.workbench.models.datamodel.rule.ActionUpdateField) ActionFieldValue(org.drools.workbench.models.datamodel.rule.ActionFieldValue) RuleAttribute(org.drools.workbench.models.datamodel.rule.RuleAttribute) FromEntryPointFactPattern(org.drools.workbench.models.datamodel.rule.FromEntryPointFactPattern) CompositeFactPattern(org.drools.workbench.models.datamodel.rule.CompositeFactPattern) FromCollectCompositeFactPattern(org.drools.workbench.models.datamodel.rule.FromCollectCompositeFactPattern) FactPattern(org.drools.workbench.models.datamodel.rule.FactPattern) FromAccumulateCompositeFactPattern(org.drools.workbench.models.datamodel.rule.FromAccumulateCompositeFactPattern) FromCompositeFactPattern(org.drools.workbench.models.datamodel.rule.FromCompositeFactPattern) CompositeFactPattern(org.drools.workbench.models.datamodel.rule.CompositeFactPattern) FromCollectCompositeFactPattern(org.drools.workbench.models.datamodel.rule.FromCollectCompositeFactPattern) FromAccumulateCompositeFactPattern(org.drools.workbench.models.datamodel.rule.FromAccumulateCompositeFactPattern) FromCompositeFactPattern(org.drools.workbench.models.datamodel.rule.FromCompositeFactPattern) RuleModel(org.drools.workbench.models.datamodel.rule.RuleModel) DSLSentence(org.drools.workbench.models.datamodel.rule.DSLSentence)

Example 5 with ActionRetractFact

use of org.drools.workbench.models.datamodel.rule.ActionRetractFact in project drools by kiegroup.

the class GuidedDecisionTreeModelUnmarshallingVisitor method visit.

private List<Node> visit(final IAction a, final List<TypeNode> types, final GuidedDecisionTree model, final PackageDataModelOracle dmo, final List<ParserMessage> messages) {
    final List<Node> nodes = new ArrayList<Node>();
    if (a instanceof ActionRetractFact) {
        final ActionRetractFact arf = (ActionRetractFact) a;
        final String binding = arf.getVariableName();
        for (TypeNode tn : types) {
            if (tn.isBound()) {
                if (tn.getBinding().equals(binding)) {
                    final ActionRetractNode arn = new ActionRetractNodeImpl(tn);
                    nodes.add(arn);
                    return nodes;
                }
            }
        }
        messages.add(new BindingNotFoundParserMessage(binding));
        return nodes;
    } else if (a instanceof ActionInsertLogicalFact) {
        final ActionInsertLogicalFact aif = (ActionInsertLogicalFact) a;
        final ActionInsertNode aun = new ActionInsertNodeImpl(aif.getFactType());
        aun.setLogicalInsertion(true);
        for (org.drools.workbench.models.datamodel.rule.ActionFieldValue afv : aif.getFieldValues()) {
            if (afv.getNature() != FieldNatureType.TYPE_LITERAL) {
                messages.add(new UnsupportedFieldNatureTypeParserMessage());
                return nodes;
            }
            final String fieldName = afv.getField();
            final Value value = getValue(aif.getFactType(), afv.getField(), model, dmo, messages, afv.getValue());
            if (value != null) {
                final ActionFieldValue _afv = new ActionFieldValueImpl(fieldName, value);
                aun.getFieldValues().add(_afv);
            }
        }
        nodes.add(aun);
        return nodes;
    } else if (a instanceof ActionInsertFact) {
        final ActionInsertFact aif = (ActionInsertFact) a;
        final ActionInsertNode aun = new ActionInsertNodeImpl(aif.getFactType());
        aun.setLogicalInsertion(false);
        for (org.drools.workbench.models.datamodel.rule.ActionFieldValue afv : aif.getFieldValues()) {
            if (afv.getNature() != FieldNatureType.TYPE_LITERAL) {
                messages.add(new UnsupportedFieldNatureTypeParserMessage());
                return nodes;
            }
            final String fieldName = afv.getField();
            final Value value = getValue(aif.getFactType(), afv.getField(), model, dmo, messages, afv.getValue());
            if (value != null) {
                final ActionFieldValue _afv = new ActionFieldValueImpl(fieldName, value);
                aun.getFieldValues().add(_afv);
            }
        }
        nodes.add(aun);
        return nodes;
    } else if (a instanceof ActionUpdateField) {
        final ActionUpdateField auf = (ActionUpdateField) a;
        final String binding = auf.getVariable();
        for (TypeNode tn : types) {
            if (tn.isBound()) {
                if (tn.getBinding().equals(binding)) {
                    final ActionUpdateNode aun = new ActionUpdateNodeImpl(tn);
                    aun.setModify(true);
                    for (org.drools.workbench.models.datamodel.rule.ActionFieldValue afv : auf.getFieldValues()) {
                        if (afv.getNature() != FieldNatureType.TYPE_LITERAL) {
                            messages.add(new UnsupportedFieldNatureTypeParserMessage());
                            return nodes;
                        }
                        final String fieldName = afv.getField();
                        final Value value = getValue(tn.getClassName(), afv.getField(), model, dmo, messages, afv.getValue());
                        if (value != null) {
                            final ActionFieldValue _afv = new ActionFieldValueImpl(fieldName, value);
                            aun.getFieldValues().add(_afv);
                        }
                    }
                    nodes.add(aun);
                    return nodes;
                }
            }
        }
        messages.add(new BindingNotFoundParserMessage(binding));
        return nodes;
    } else if (a instanceof ActionSetField) {
        final ActionSetField asf = (ActionSetField) a;
        final String binding = asf.getVariable();
        for (TypeNode tn : types) {
            if (tn.isBound()) {
                if (tn.getBinding().equals(binding)) {
                    final ActionUpdateNode aun = new ActionUpdateNodeImpl(tn);
                    for (org.drools.workbench.models.datamodel.rule.ActionFieldValue afv : asf.getFieldValues()) {
                        if (afv.getNature() != FieldNatureType.TYPE_LITERAL) {
                            messages.add(new UnsupportedFieldNatureTypeParserMessage());
                            return nodes;
                        }
                        final String fieldName = afv.getField();
                        final Value value = getValue(tn.getClassName(), afv.getField(), model, dmo, messages, afv.getValue());
                        if (value != null) {
                            final ActionFieldValue _afv = new ActionFieldValueImpl(fieldName, value);
                            aun.getFieldValues().add(_afv);
                        }
                    }
                    nodes.add(aun);
                    return nodes;
                }
            }
        }
        messages.add(new BindingNotFoundParserMessage(binding));
        return nodes;
    } else {
        messages.add(new UnsupportedIActionParserMessage());
        return nodes;
    }
}
Also used : ActionInsertNode(org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionInsertNode) ActionRetractNode(org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionRetractNode) TypeNode(org.drools.workbench.models.guided.dtree.shared.model.nodes.TypeNode) Node(org.drools.workbench.models.guided.dtree.shared.model.nodes.Node) ActionUpdateNode(org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionUpdateNode) ActionInsertNode(org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionInsertNode) ConstraintNode(org.drools.workbench.models.guided.dtree.shared.model.nodes.ConstraintNode) ArrayList(java.util.ArrayList) ActionRetractNodeImpl(org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionRetractNodeImpl) ActionInsertNodeImpl(org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionInsertNodeImpl) ActionRetractFact(org.drools.workbench.models.datamodel.rule.ActionRetractFact) ActionUpdateField(org.drools.workbench.models.datamodel.rule.ActionUpdateField) BindingNotFoundParserMessage(org.drools.workbench.models.guided.dtree.shared.model.parser.messages.BindingNotFoundParserMessage) ActionFieldValue(org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionFieldValue) ActionRetractNode(org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionRetractNode) ActionSetField(org.drools.workbench.models.datamodel.rule.ActionSetField) UnsupportedFieldNatureTypeParserMessage(org.drools.workbench.models.guided.dtree.shared.model.parser.messages.UnsupportedFieldNatureTypeParserMessage) ActionInsertFact(org.drools.workbench.models.datamodel.rule.ActionInsertFact) ActionUpdateNode(org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionUpdateNode) ShortValue(org.drools.workbench.models.guided.dtree.shared.model.values.impl.ShortValue) StringValue(org.drools.workbench.models.guided.dtree.shared.model.values.impl.StringValue) FloatValue(org.drools.workbench.models.guided.dtree.shared.model.values.impl.FloatValue) BigDecimalValue(org.drools.workbench.models.guided.dtree.shared.model.values.impl.BigDecimalValue) ByteValue(org.drools.workbench.models.guided.dtree.shared.model.values.impl.ByteValue) Value(org.drools.workbench.models.guided.dtree.shared.model.values.Value) DoubleValue(org.drools.workbench.models.guided.dtree.shared.model.values.impl.DoubleValue) IntegerValue(org.drools.workbench.models.guided.dtree.shared.model.values.impl.IntegerValue) DateValue(org.drools.workbench.models.guided.dtree.shared.model.values.impl.DateValue) BooleanValue(org.drools.workbench.models.guided.dtree.shared.model.values.impl.BooleanValue) BigIntegerValue(org.drools.workbench.models.guided.dtree.shared.model.values.impl.BigIntegerValue) LongValue(org.drools.workbench.models.guided.dtree.shared.model.values.impl.LongValue) ActionFieldValue(org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionFieldValue) EnumValue(org.drools.workbench.models.guided.dtree.shared.model.values.impl.EnumValue) ActionUpdateNodeImpl(org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionUpdateNodeImpl) TypeNode(org.drools.workbench.models.guided.dtree.shared.model.nodes.TypeNode) ActionFieldValueImpl(org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionFieldValueImpl) UnsupportedIActionParserMessage(org.drools.workbench.models.guided.dtree.shared.model.parser.messages.UnsupportedIActionParserMessage) ActionInsertLogicalFact(org.drools.workbench.models.datamodel.rule.ActionInsertLogicalFact)

Aggregations

ActionRetractFact (org.drools.workbench.models.datamodel.rule.ActionRetractFact)17 Test (org.junit.Test)8 IAction (org.drools.workbench.models.datamodel.rule.IAction)7 ActionSetField (org.drools.workbench.models.datamodel.rule.ActionSetField)6 CompositeFactPattern (org.drools.workbench.models.datamodel.rule.CompositeFactPattern)6 FactPattern (org.drools.workbench.models.datamodel.rule.FactPattern)6 RuleModel (org.drools.workbench.models.datamodel.rule.RuleModel)6 ArrayList (java.util.ArrayList)5 ActionInsertFact (org.drools.workbench.models.datamodel.rule.ActionInsertFact)5 ActionUpdateField (org.drools.workbench.models.datamodel.rule.ActionUpdateField)5 SingleFieldConstraint (org.drools.workbench.models.datamodel.rule.SingleFieldConstraint)5 BaseSingleFieldConstraint (org.drools.workbench.models.datamodel.rule.BaseSingleFieldConstraint)4 FreeFormLine (org.drools.workbench.models.datamodel.rule.FreeFormLine)4 FromCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromCompositeFactPattern)4 IPattern (org.drools.workbench.models.datamodel.rule.IPattern)4 ActionGlobalCollectionAdd (org.drools.workbench.models.datamodel.rule.ActionGlobalCollectionAdd)3 DSLSentence (org.drools.workbench.models.datamodel.rule.DSLSentence)3 FromAccumulateCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromAccumulateCompositeFactPattern)3 FromCollectCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromCollectCompositeFactPattern)3 RuleAttribute (org.drools.workbench.models.datamodel.rule.RuleAttribute)3