Package org.drools.xml

Examples of org.drools.xml.SemanticModules


     *            A resource with the type set to ChangeSet
     * @return A ChangeSet that can be processed by this Agent.
     */
    public ChangeSet getChangeSet(Resource resource) {
        if ( this.semanticModules == null ) {
            this.semanticModules = new SemanticModules();
            this.semanticModules.addSemanticModule( new ChangeSetSemanticModule() );
        }

        XmlChangeSetReader reader = new XmlChangeSetReader( this.semanticModules,
                                                            null,
View Full Code Here


    public static Map<String, String[]> extract(String json) throws Exception {
        Map<String, String[]> result = null;
        String xml = BPMN2ProcessHandler.serialize( "http://localhost:8080/designer/bpmn2_0serialization",
                                                    json );
        Reader isr = new StringReader( xml );
        SemanticModules semanticModules = new SemanticModules();
        semanticModules.addSemanticModule( new BPMNSemanticModule() );
        semanticModules.addSemanticModule( new BPMNDISemanticModule() );
        XmlProcessReader xmlReader = new XmlProcessReader( semanticModules,
                                                           getClassLoader() );
        RuleFlowProcess process = (RuleFlowProcess) xmlReader.read( isr );
        if ( process == null ) {
            throw new IllegalArgumentException( "Could not read process" );
View Full Code Here

    public static String inject(String json,
                                Map<String, String> constraints) throws Exception {
        String xml = BPMN2ProcessHandler.serialize( "http://localhost:8080/designer/bpmn2_0serialization",
                                                    json );
        Reader isr = new StringReader( xml );
        SemanticModules semanticModules = new SemanticModules();
        semanticModules.addSemanticModule( new BPMNSemanticModule() );
        semanticModules.addSemanticModule( new BPMNDISemanticModule() );
        XmlProcessReader xmlReader = new XmlProcessReader( semanticModules,
                                                           getClassLoader() );
        RuleFlowProcess process = (RuleFlowProcess) xmlReader.read( isr );
        isr.close();
        if ( process == null ) {
View Full Code Here

        }
        return this.semanticModules;
    }

    public void initSemanticModules() {
        this.semanticModules = new SemanticModules();

        this.semanticModules.addSemanticModule( new ProcessSemanticModule() );
        this.semanticModules.addSemanticModule( new RulesSemanticModule() );
        this.semanticModules.addSemanticModule( new ChangeSetSemanticModule() );
View Full Code Here

    protected void createModel(InputStream is) {
        try
        {
            InputStreamReader isr = new InputStreamReader(is);
            PackageBuilderConfiguration configuration = new PackageBuilderConfiguration();
            SemanticModules modules = configuration.getSemanticModules();
            modules.addSemanticModule(new ProcessSemanticModule());
            XmlProcessReader xmlReader = new XmlProcessReader( modules, Thread.currentThread().getContextClassLoader() );

            //Migrate v4 ruleflows to v5
            Reader reader = null;
            try
View Full Code Here

   
    protected void createModel(InputStream is) {
        try
        {
            InputStreamReader isr = new InputStreamReader(is, "UTF-8");
            SemanticModules semanticModules = new SemanticModules();
            semanticModules.addSemanticModule(new BPMNSemanticModule());
          semanticModules.addSemanticModule(new BPMNExtensionsSemanticModule());
            semanticModules.addSemanticModule(new BPMNDISemanticModule());
            XmlProcessReader xmlReader = new XmlProcessReader(semanticModules, Thread.currentThread().getContextClassLoader());

            try
            {
                List<Process> processes = xmlReader.read(isr);
View Full Code Here

                    JavaDialectConfiguration javaConf = (JavaDialectConfiguration) configuration.getDialectConfiguration( "java" );
                    javaConf.setJavaLanguageLevel( level );
                }
                configuration.getClassLoader().addClassLoader( newLoader );
               
                SemanticModules modules = configuration.getSemanticModules();
                modules.addSemanticModule( new BPMNSemanticModule() );
                modules.addSemanticModule( new BPMNDISemanticModule() );
                modules.addSemanticModule( new BPMNExtensionsSemanticModule() );
                modules.addSemanticModule( new ProcessSemanticModule() );
               
                XmlProcessReader xmlReader = new XmlProcessReader( modules, Thread.currentThread().getContextClassLoader() );
                List<org.kie.definition.process.Process> processes =
                    (List<org.kie.definition.process.Process>) xmlReader.read( new StringReader( input ) );
                if (processes != null) {
View Full Code Here

    public void convertToBPMN2() {
        try {
            InputStreamReader isr = new InputStreamReader(((File) file).getContents());
            PackageBuilderConfiguration configuration = new PackageBuilderConfiguration();
            SemanticModules modules = configuration.getSemanticModules();
            modules.addSemanticModule(new ProcessSemanticModule());
            XmlProcessReader xmlReader = new XmlProcessReader( modules, Thread.currentThread().getContextClassLoader() );
            String xml = RuleFlowMigrator.convertReaderToString(isr);
            Reader reader = new StringReader(xml);
            List<Process> processes = xmlReader.read(reader);
            if (processes != null && processes.size() == 1) {
View Full Code Here

     *            A resource with the type set to ChangeSet
     * @return A ChangeSet that can be processed by this Agent.
     */
    public ChangeSet getChangeSet(Resource resource) {
        if ( this.semanticModules == null ) {
            this.semanticModules = new SemanticModules();
            this.semanticModules.addSemanticModule( new ChangeSetSemanticModule() );
        }

        XmlChangeSetReader reader = new XmlChangeSetReader( this.semanticModules,
                                                            null,
View Full Code Here

     *            A resource with the type set to ChangeSet
     * @return A ChangeSet that can be processed by this Agent.
     */
    public ChangeSet getChangeSet(Resource resource) {
        if ( this.semanticModules == null ) {
            this.semanticModules = new SemanticModules();
            this.semanticModules.addSemanticModule( new ChangeSetSemanticModule() );
        }

        XmlChangeSetReader reader = new XmlChangeSetReader( this.semanticModules );
        if ( resource instanceof ClassPathResource ) {
View Full Code Here

TOP

Related Classes of org.drools.xml.SemanticModules

Copyright © 2018 www.massapicom. 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.