Examples of RuleSetNode


Examples of com.bazaarvoice.jless.ast.node.RuleSetNode

        private void surroundPropertyGroups() {
            while (!_propertyGroups.empty()) {
                PropertyGroup group = _propertyGroups.pop();

                // Construct a simple rule set using the parent's selector
                RuleSetNode propertyRuleSet = new RuleSetNode();
                propertyRuleSet.addChild(NodeTreeUtils.filterLineBreaks(_parentSelectorGroup.clone()));

                // Move all the properties into this new rule set
                List<Node> propertyNodes = new ArrayList<Node>(_parentScope.getChildren().subList(group.getStart(), group.getEnd() + 1));
                propertyRuleSet.addChild(new ScopeNode(propertyNodes));

                // Insert the property rule set
                _parentScope.addChild(group.getStart(), propertyRuleSet);
            }
        }
View Full Code Here

Examples of com.bazaarvoice.jless.ast.node.RuleSetNode

    Rule RuleSet() {
        return Sequence(
                FirstOf(
                        // Standard CSS rule set
                        Sequence(
                                SelectorGroup(), push(new RuleSetNode(pop())),
                                '{',
                                Scope(), peek(1).addChild(pop()), Ws0()
                        ),
                        // Mixin rule set, with possible arguments
                        Sequence(
                                ClassSelectorGroup(), push(new RuleSetNode(pop())), Ws0(),
                                Parameters(), Ws0(),
                                '{',
                                Scope(), peek(1).addChild(pop()), peek(1).addChild(pop()), Ws0()
                        )
                ),
View Full Code Here

Examples of com.bazaarvoice.jless.ast.node.RuleSetNode

            if (!(node instanceof ScopeNode)) {
                continue;
            }

            ScopeNode scope = (ScopeNode) node;
            RuleSetNode ruleSet = scope.getRuleSet(name);

            if (ruleSet == null) {
                continue;
            }
View Full Code Here

Examples of com.bazaarvoice.jless.ast.node.RuleSetNode

            List<RuleSetNode> nestedRuleSets = NodeTreeUtils.getAndRemoveChildren(mediaScopeNode, RuleSetNode.class);

            // if scope node for media query has anything more but whitespaces and rule sets than wrap it with rule set with the same selector group as outer rule set has
            if (mediaScopeNode.getChildren().size() > NodeTreeUtils.getChildren(mediaScopeNode, WhiteSpaceCollectionNode.class).size()) {
                RuleSetNode newRuleSetNode = new RuleSetNode();
                ScopeNode newScopeNode = new ScopeNode();
                newRuleSetNode.addChild(selectorGroupNode.clone());
                newRuleSetNode.addChild(newScopeNode);

                NodeTreeUtils.moveChildren(mediaScopeNode, newScopeNode);

                mediaScopeNode.clearChildren();
                mediaScopeNode.addChild(newRuleSetNode);
View Full Code Here

Examples of org.drools.ruleflow.core.RuleSetNode

                                                                        rule0,
                                                                        null );

        // nodes
        final StartNode start = new StartNodeImpl();
        final RuleSetNode ruleSet0 = new RuleSetNodeImpl();
        ruleSet0.setRuleFlowGroup( "rule-flow-group-0" );
        final RuleSetNode ruleSet1 = new RuleSetNodeImpl();
        ruleSet1.setRuleFlowGroup( "rule-flow-group-1" );
        final RuleSetNode ruleSet2 = new RuleSetNodeImpl();
        ruleSet2.setRuleFlowGroup( "rule-flow-group-2" );
        final RuleSetNode ruleSet3 = new RuleSetNodeImpl();
        ruleSet3.setRuleFlowGroup( "rule-flow-group-3" );
        final Split split = new SplitImpl();
        split.setType( Split.TYPE_AND );
        final Join join = new JoinImpl();
        join.setType( Join.TYPE_AND );
        final EndNode end = new EndNodeImpl();
View Full Code Here

Examples of org.drools.ruleflow.core.RuleSetNode

                                                                        rule0,
                                                                        null );

        // nodes
        final StartNode start = new StartNodeImpl();
        final RuleSetNode ruleSet0 = new RuleSetNodeImpl();
        ruleSet0.setRuleFlowGroup( "rule-flow-group-0" );
        final RuleSetNode ruleSet1 = new RuleSetNodeImpl();
        ruleSet1.setRuleFlowGroup( "rule-flow-group-1" );
        final RuleSetNode ruleSet2 = new RuleSetNodeImpl();
        ruleSet2.setRuleFlowGroup( "rule-flow-group-2" );
        final RuleSetNode ruleSet3 = new RuleSetNodeImpl();
        ruleSet3.setRuleFlowGroup( "rule-flow-group-3" );
        final Split split = new SplitImpl();
        split.setType( Split.TYPE_XOR );
        final Join join = new JoinImpl();
        join.setType( Join.TYPE_XOR );
        final EndNode end = new EndNodeImpl();
View Full Code Here

Examples of org.drools.ruleflow.core.RuleSetNode

                endNodeFound = true;
                if ( endNode.getFrom() == null ) {
                    errors.add( new RuleFlowProcessValidationErrorImpl( RuleFlowProcessValidationError.END_NODE_HAS_NO_INCOMING_CONNECTIONS ) );
                }
            } else if ( node instanceof RuleSetNode ) {
                final RuleSetNode ruleSetNode = (RuleSetNode) node;
                if ( ruleSetNode.getFrom() == null ) {
                    errors.add( new RuleFlowProcessValidationErrorImpl( RuleFlowProcessValidationError.RULE_SET_NODE_WITHOUT_INCOMING_CONNECTIONS, "name = " + ruleSetNode.getName() ) );
                }

                if ( ruleSetNode.getTo() == null ) {
                    errors.add( new RuleFlowProcessValidationErrorImpl( RuleFlowProcessValidationError.RULE_SET_NODE_WITHOUT_OUTGOING_CONNECTIONS, "name = " + ruleSetNode.getName() ) );
                }
                final String ruleFlowGroup = ruleSetNode.getRuleFlowGroup();
                if ( ruleFlowGroup == null || "".equals( ruleFlowGroup ) ) {
                    errors.add( new RuleFlowProcessValidationErrorImpl( RuleFlowProcessValidationError.RULE_SET_NODE_WITHOUT_RULE_SET_GROUP, "name = " + ruleSetNode.getName() ) );
                }
            } else if ( node instanceof Split ) {
                final Split split = (Split) node;
                if ( split.getType() == Split.TYPE_UNDEFINED ) {
                    errors.add( new RuleFlowProcessValidationErrorImpl( RuleFlowProcessValidationError.SPLIT_WITHOUT_TYPE, "name = " + split.getName() ) );
View Full Code Here

Examples of org.drools.ruleflow.core.RuleSetNode

                                                                        rule0,
                                                                        null );

        // nodes
        final StartNode start = new StartNodeImpl();
        final RuleSetNode ruleSet0 = new RuleSetNodeImpl();
        ruleSet0.setRuleFlowGroup( "rule-flow-group-0" );
        final RuleSetNode ruleSet1 = new RuleSetNodeImpl();
        ruleSet1.setRuleFlowGroup( "rule-flow-group-1" );
        final RuleSetNode ruleSet2 = new RuleSetNodeImpl();
        ruleSet2.setRuleFlowGroup( "rule-flow-group-2" );
        final RuleSetNode ruleSet3 = new RuleSetNodeImpl();
        ruleSet3.setRuleFlowGroup( "rule-flow-group-3" );
        final Split split = new SplitImpl();
        split.setType( Split.TYPE_AND );
        final Join join = new JoinImpl();
        join.setType( Join.TYPE_AND );
        final EndNode end = new EndNodeImpl();
View Full Code Here

Examples of org.drools.ruleflow.core.RuleSetNode

                                                                        rule0,
                                                                        null );

        // nodes
        final StartNode start = new StartNodeImpl();
        final RuleSetNode ruleSet0 = new RuleSetNodeImpl();
        ruleSet0.setRuleFlowGroup( "rule-flow-group-0" );
        final RuleSetNode ruleSet1 = new RuleSetNodeImpl();
        ruleSet1.setRuleFlowGroup( "rule-flow-group-1" );
        final RuleSetNode ruleSet2 = new RuleSetNodeImpl();
        ruleSet2.setRuleFlowGroup( "rule-flow-group-2" );
        final RuleSetNode ruleSet3 = new RuleSetNodeImpl();
        ruleSet3.setRuleFlowGroup( "rule-flow-group-3" );
        final Split split = new SplitImpl();
        split.setType( Split.TYPE_XOR );
        final Join join = new JoinImpl();
        join.setType( Join.TYPE_XOR );
        final EndNode end = new EndNodeImpl();
View Full Code Here

Examples of org.drools.workflow.core.node.RuleSetNode

                                                                        null );

        // nodes
        final StartNode start = new StartNode();
        start.setId(1);
        final RuleSetNode ruleSet0 = new RuleSetNode();
        ruleSet0.setRuleFlowGroup( "rule-flow-group-0" );
        ruleSet0.setId(2);
        final RuleSetNode ruleSet1 = new RuleSetNode();
        ruleSet1.setRuleFlowGroup( "rule-flow-group-1" );
        ruleSet1.setId(3);
        final RuleSetNode ruleSet2 = new RuleSetNode();
        ruleSet2.setRuleFlowGroup( "rule-flow-group-2" );
        ruleSet2.setId(4);
        final RuleSetNode ruleSet3 = new RuleSetNode();
        ruleSet3.setRuleFlowGroup( "rule-flow-group-3" );
        ruleSet3.setId(5);
        final Split split = new Split();
        split.setType( Split.TYPE_AND );
        split.setId(6);
        final Join join = new Join();
        join.setType( Join.TYPE_AND );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.