Search in sources :

Example 6 with IFactPattern

use of org.drools.workbench.models.datamodel.rule.IFactPattern in project drools-wb by kiegroup.

the class BRLConditionColumnSynchronizer method doDelete.

private void doDelete(final BRLConditionVariableColumn column) {
    final int iFirstColumnIndex = model.getExpandedColumns().indexOf(column);
    synchroniseDeleteColumn(iFirstColumnIndex);
    final BRLConditionColumn brlColumn = model.getBRLColumn(column);
    brlColumn.getChildColumns().remove(column);
    for (IPattern iPattern : brlColumn.getDefinition()) {
        if (iPattern instanceof FactPattern) {
            removePattern(column, (FactPattern) iPattern);
        } else if (iPattern instanceof CompositeFactPattern) {
            for (IFactPattern childPattern : ((CompositeFactPattern) iPattern).getPatterns()) {
                if (childPattern instanceof FactPattern) {
                    removePattern(column, (FactPattern) childPattern);
                }
            }
        }
    }
}
Also used : BRLConditionColumn(org.drools.workbench.models.guided.dtable.shared.model.BRLConditionColumn) IPattern(org.drools.workbench.models.datamodel.rule.IPattern) IFactPattern(org.drools.workbench.models.datamodel.rule.IFactPattern) FactPattern(org.drools.workbench.models.datamodel.rule.FactPattern) CompositeFactPattern(org.drools.workbench.models.datamodel.rule.CompositeFactPattern) CompositeFactPattern(org.drools.workbench.models.datamodel.rule.CompositeFactPattern) CompositeFieldConstraint(org.drools.workbench.models.datamodel.rule.CompositeFieldConstraint) SingleFieldConstraint(org.drools.workbench.models.datamodel.rule.SingleFieldConstraint) FieldConstraint(org.drools.workbench.models.datamodel.rule.FieldConstraint) IFactPattern(org.drools.workbench.models.datamodel.rule.IFactPattern)

Example 7 with IFactPattern

use of org.drools.workbench.models.datamodel.rule.IFactPattern in project drools-wb by kiegroup.

the class GuidedRuleTemplateIndexVisitor method visitCompositeFactPattern.

private void visitCompositeFactPattern(final CompositeFactPattern pattern) {
    String fullyQualifiedClassName = getFullyQualifiedClassName(pattern.getType());
    addResourceReference(fullyQualifiedClassName, ResourceType.JAVA);
    if (pattern.getPatterns() != null) {
        for (IFactPattern fp : pattern.getPatterns()) {
            visit(fp);
        }
    }
}
Also used : IFactPattern(org.drools.workbench.models.datamodel.rule.IFactPattern)

Example 8 with IFactPattern

use of org.drools.workbench.models.datamodel.rule.IFactPattern in project drools-wb by kiegroup.

the class RuleModelCloneVisitor method visitCompositeFactPattern.

private CompositeFactPattern visitCompositeFactPattern(CompositeFactPattern pattern) {
    CompositeFactPattern clone = new CompositeFactPattern();
    clone.setType(pattern.getType());
    if (pattern.getPatterns() != null) {
        for (IFactPattern fp : pattern.getPatterns()) {
            clone.addFactPattern((IFactPattern) visit(fp));
        }
    }
    return clone;
}
Also used : FromAccumulateCompositeFactPattern(org.drools.workbench.models.datamodel.rule.FromAccumulateCompositeFactPattern) CompositeFactPattern(org.drools.workbench.models.datamodel.rule.CompositeFactPattern) FromCompositeFactPattern(org.drools.workbench.models.datamodel.rule.FromCompositeFactPattern) FromCollectCompositeFactPattern(org.drools.workbench.models.datamodel.rule.FromCollectCompositeFactPattern) IFactPattern(org.drools.workbench.models.datamodel.rule.IFactPattern)

Aggregations

IFactPattern (org.drools.workbench.models.datamodel.rule.IFactPattern)8 CompositeFactPattern (org.drools.workbench.models.datamodel.rule.CompositeFactPattern)4 CompositeFieldConstraint (org.drools.workbench.models.datamodel.rule.CompositeFieldConstraint)3 FieldConstraint (org.drools.workbench.models.datamodel.rule.FieldConstraint)3 FromAccumulateCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromAccumulateCompositeFactPattern)3 FromCollectCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromCollectCompositeFactPattern)3 FromCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromCompositeFactPattern)3 SingleFieldConstraint (org.drools.workbench.models.datamodel.rule.SingleFieldConstraint)3 LHSGeneratorContextFactory (org.drools.workbench.models.commons.backend.rule.context.LHSGeneratorContextFactory)2 RHSGeneratorContextFactory (org.drools.workbench.models.commons.backend.rule.context.RHSGeneratorContextFactory)2 BaseSingleFieldConstraint (org.drools.workbench.models.datamodel.rule.BaseSingleFieldConstraint)2 FactPattern (org.drools.workbench.models.datamodel.rule.FactPattern)2 Command (com.google.gwt.user.client.Command)1 HTML (com.google.gwt.user.client.ui.HTML)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 AccumulateDescr (org.drools.compiler.lang.descr.AccumulateDescr)1 CollectDescr (org.drools.compiler.lang.descr.CollectDescr)1 EntryPointDescr (org.drools.compiler.lang.descr.EntryPointDescr)1 ExistsDescr (org.drools.compiler.lang.descr.ExistsDescr)1