Package org.drools.definition.process

Examples of org.drools.definition.process.Process


    assertEquals( 2, pkgs.size() );  
   
    KnowledgePackage test1 = getKnowledgePackage(pkgs, "org.test1" );
    Collection<Process> processes = test1.getProcesses();   
    assertEquals( 1, processes.size() );
    Process process = getProcess( processes, "flow1" );
    assertEquals("flow1", process.getName() )
   
    KnowledgePackage test2 = getKnowledgePackage(pkgs, "org.test2" );
    processes = test2.getProcesses();   
    assertEquals( 1, processes.size() );
    process = getProcess( processes, "flow2" );
    assertEquals("flow2", process.getName() );   
           
  }
View Full Code Here


        assertEquals( 1,
                      flows.size() );

        assertTrue( flows.containsKey( "0" ) );

        Process p = (Process) flows.get( "0" );
        assertTrue( p instanceof WorkflowProcessImpl );

        //now serialization
        Package pkg2 = (Package) DroolsStreamUtils.streamIn( DroolsStreamUtils.streamOut( pkg ) );
        assertNotNull( pkg2 );
View Full Code Here

        assertEquals( 1,
                      flows.size() );

        assertTrue( flows.containsKey( "0" ) );

        Process p = (Process) flows.get( "0" );
        assertTrue( p instanceof WorkflowProcessImpl );

        //now serialization
        Package pkg2 = (Package) DroolsStreamUtils.streamIn( DroolsStreamUtils.streamOut( pkg ) );
        assertNotNull( pkg2 );
View Full Code Here

                            "false" );
    }

    public void testPackageRuleFlows() throws Exception {
        Package pkg = new Package( "boo" );
        Process rf = new MockRuleFlow( "1" );
        pkg.addProcess( rf );
        assertTrue( pkg.getRuleFlows().containsKey( "1" ) );
        assertSame( rf,
                    pkg.getRuleFlows().get( "1" ) );

        Process rf2 = new MockRuleFlow( "2" );
        pkg.addProcess( rf2 );
        assertTrue( pkg.getRuleFlows().containsKey( "1" ) );
        assertSame( rf,
                    pkg.getRuleFlows().get( "1" ) );
        assertTrue( pkg.getRuleFlows().containsKey( "2" ) );
View Full Code Here

    if (processClass == null) {
      // nothing to compile.
      return;
    }

    final Process process = context.getProcess();
    final ProcessDescr processDescr = context.getProcessDescr();

    // The compilation result is for the entire rule, so difficult to
    // associate with any descr
    javaDialect.addClassCompileTask(context.getPkg().getName() + "."
View Full Code Here

    Association association = new Association();
    association.setId(attrs.getValue("id"));
    association.setSourceRef(attrs.getValue("sourceRef"));
    association.setTargetRef(attrs.getValue("targetRef"));
   
    Process parent = (Process) parser.getParent();
    Definitions definitions = (Definitions)
      parent.getMetaData().get("Definitions");
   
    // FIXME for now associations are stored under the definitions node
    // we will move them under process and subprocesses when it becomes possible ?
    List<Association> associations = definitions.getAssociations();
    if (associations == null) {
View Full Code Here

            return null;
        }
        processInstanceInfo.updateLastReadDate();
        processInstance = (org.jbpm.process.instance.ProcessInstance)
          processInstanceInfo.getProcessInstance(kruntime, this.kruntime.getEnvironment());
        Process process = kruntime.getKnowledgeBase().getProcess( processInstance.getProcessId() );
        if ( process == null ) {
            throw new IllegalArgumentException( "Could not find process " + processInstance.getProcessId() );
        }
        processInstance.setProcess( process );
        if ( processInstance.getKnowledgeRuntime() == null ) {
View Full Code Here

          kbuilder.add(ResourceFactory.newFileResource(subfile), ResourceType.BPMN2);
        }
        kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
      }
    }
    Process process = kbase.getProcess(processId);
    if (process == null) {
      return null;
    }

    DiagramInfo result = new DiagramInfo();
View Full Code Here

        try {
            kruntime.startOperation();
            if ( !kruntime.getActionQueue().isEmpty() ) {
              kruntime.executeQueuedActions();
            }
            final Process process = kruntime.getKnowledgeBase().getProcess( processId );
            if ( process == null ) {
                throw new IllegalArgumentException( "Unknown process ID: " + processId );
            }
            return startProcess( process, parameters );
        } finally {
View Full Code Here

        WorkflowProcessInstanceImpl processInstance = createProcessInstance();
        processInstance.setId(stream.readLong());
        String processId = stream.readUTF();
        processInstance.setProcessId(processId);
        Process process = ruleBase.getProcess(processId);
        if (ruleBase != null) {
            processInstance.setProcess(process);
        }
        processInstance.setState(stream.readInt());
        long nodeInstanceCounter = stream.readLong();
View Full Code Here

TOP

Related Classes of org.drools.definition.process.Process

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.