Examples of RuleManager


Examples of org.jivesoftware.openfire.plugin.rules.RuleManager

    public Object getResult() {
        return null;
    }

    public void run() {
       RuleManager ruleManager = new RuleManagerProxy();
       ruleManager.rulesUpdated();
    }
View Full Code Here

Examples of org.openengsb.core.workflow.api.RuleManager

        assertThat(logService.isWasCalled(), is(true));
    }

    private void addHelloWorldRule() throws Exception {
        RuleManager ruleManager = getOsgiService(RuleManager.class);
        ruleManager.addImport("org.openengsb.domain.example.ExampleDomain");

        ruleManager.addGlobal("org.openengsb.domain.example.ExampleDomain", "example");

        RuleBaseElementId id = new RuleBaseElementId(RuleBaseElementType.Rule, "hello1");
        String rule = readRule();
        ruleManager.add(id, rule);
    }
View Full Code Here

Examples of org.openengsb.core.workflow.api.RuleManager

        properties.put("domain", "example");
        properties.put("connector", "example");
        properties.put("location.foo", "example2");
        getBundleContext().registerService(ExampleDomain.class.getName(), exampleMock, properties);

        RuleManager ruleManager = getOsgiService(RuleManager.class);

        ruleManager.addImport(ExampleDomain.class.getName());
        ruleManager.addImport(LogEvent.class.getName());
        ruleManager.addImport(TransformationEngine.class.getName());
        ruleManager.addImport(ModelUtils.class.getName());
        ruleManager.addImport(ExampleResponseModel.class.getName());
        ruleManager.addImport(ExampleRequestModel.class.getName());
        ruleManager.addImport(ModelDescription.class.getName());
        ruleManager.addImport(OpenEngSBModelEntry.class.getName());

        ruleManager.addGlobal(ExampleDomain.class.getName(), "example2");
        ruleManager.addGlobal(TransformationEngine.class.getName(), "ekbTransformationService");

        String sourceDescription = "ModelDescription source = new ModelDescription(\"%s\", \"%s\");";
        String targetDescription = "ModelDescription target = new ModelDescription(\"%s\", \"%s\");";
        sourceDescription =
            String.format(sourceDescription, ExampleResponseModel.class.getName(), exampleDomainVersion.toString());
        targetDescription =
            String.format(targetDescription, ExampleRequestModel.class.getName(), exampleDomainVersion.toString());

        ruleManager.add(
            new RuleBaseElementId(RuleBaseElementType.Rule, "example"),
            ""
                    + "when\n"
                    + "  event : LogEvent()\n"
                    + "then\n"
View Full Code Here

Examples of org.openengsb.core.workflow.api.RuleManager

    }
   
    private void waitForRequiredTasks() throws Exception {
        authenticationContext = getOsgiService(AuthenticationContext.class);
        waitForUserDataInitializer();
        RuleManager rm = getOsgiService(RuleManager.class);
        int count = 0;
        while (rm.getGlobalType("auditing") == null) {
            LOGGER.warn("waiting for auditing to finish init");
            waitasec();
            if (count++ > 100) {
                throw new IllegalStateException("auditing-config did not finish in time");
            }
        }
        count = 0;
        while (!rm.listImports().contains(OsgiHelper.class.getName())) {
            LOGGER.warn("waiting for auditing to finish init");
            waitasec();
            if (count++ > 100) {
                throw new IllegalStateException("auditing-config did not finish in time");
            }
        }
        count = 0;
        while (rm.get(new RuleBaseElementId(RuleBaseElementType.Process, "humantask")) == null) {
            LOGGER.warn("waiting for taskboxConfig to finish init");
            waitasec();
            if (count++ > 100) {
                throw new IllegalStateException("taskbox-config did not finish in time");
            }
View Full Code Here

Examples of org.openengsb.core.workflow.api.RuleManager

                exampleMock, properties);
    }

    @Test
    public void testCreateRuleAndTriggerDomain_shouldTriggerDomain() throws Exception {
        RuleManager ruleManager = getOsgiService(RuleManager.class);

        ruleManager.addImport(ExampleDomain.class.getName());
        ruleManager.addImport(LogEvent.class.getName());

        ruleManager.addGlobal(ExampleDomain.class.getName(), "example2");

        ruleManager.add(new RuleBaseElementId(RuleBaseElementType.Rule, "example-trigger"), ""
                + "when\n"
                + "    l : LogEvent()\n"
                + "then\n"
                + "    example2.doSomethingWithMessage(\"42\");\n"
        );
View Full Code Here

Examples of org.openengsb.core.workflow.api.RuleManager

        assertThat(exampleMock.wasCalled, is(true));
    }

    @Test
    public void testCreateAndTriggerResponseRule_shouldCallOrigin() throws Exception {
        RuleManager ruleManager = getOsgiService(RuleManager.class);

        ruleManager.addImport(ExampleDomain.class.getName());
        ruleManager.addImport(LogEvent.class.getName());

        ruleManager.addGlobal(ExampleDomain.class.getName(), "example2");

        ruleManager.add(new RuleBaseElementId(RuleBaseElementType.Rule, "example-response"), ""
                + "when\n"
                + "    l : LogEvent()\n"
                + "then\n"
                + "   ExampleDomain origin = (ExampleDomain) OsgiHelper.getResponseProxy(l, ExampleDomain.class);"
                + "   origin.doSomethingWithMessage(\"42\");"
View Full Code Here

Examples of org.pdf4j.saxon.trans.RuleManager

            }
        }

        allocateSlots(exp);
        if (match != null) {
            RuleManager mgr = getPrincipalStylesheet().getRuleManager();
            for (int i=0; i<modeNames.length; i++) {
                StructuredQName nc = modeNames[i];
                Mode mode = mgr.getMode(nc, true);
                if (prioritySpecified) {
                    mgr.setHandler(match, compiledTemplate, mode, getPrecedence(), priority);
                } else {
                    mgr.setHandler(match, compiledTemplate, mode, getPrecedence());
                }
            }

            allocatePatternSlots(match, getSlotManager());
        }
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.