Examples of ProcessInstance


Examples of org.jbpm.process.instance.ProcessInstance

        collection.add("one");
        collection.add("two");
        collection.add("three");
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("collection", collection);
        ProcessInstance processInstance = ( ProcessInstance )
            workingMemory.startProcess("org.drools.ForEach", params);
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
        processInstance.signalEvent("MyEvent", null);
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
        assertEquals(3, myList.size());
    }
View Full Code Here

Examples of org.kie.api.runtime.process.ProcessInstance

        kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );

        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
        setExec( ksession );

        ProcessInstance processInstance = ksession.startProcess( "org.drools.core.event" );
        assertEquals( ProcessInstance.STATE_ACTIVE,
                      processInstance.getState() );

        execContent( "testProcessInstanceSignalEvent.in.1" );

        assertEquals( ProcessInstance.STATE_COMPLETED,
                      processInstance.getState() );
        assertEquals( "MyValue",
                      ((VariableScopeInstance) ((org.jbpm.process.instance.ProcessInstance) processInstance).getContextInstance( VariableScope.VARIABLE_SCOPE )).getVariable( "MyVar" ) );
    }
View Full Code Here

Examples of org.kie.runtime.process.ProcessInstance

        if (data != null) {
            for (Object o: data) {
                ksession.insert(o);
            }
        }
        ProcessInstance processInstance = (ProcessInstance) ksession.createProcessInstance(processId, parameters);
        if ( this.outIdentifier != null ) {
            ((ExecutionResultImpl) ((KnowledgeCommandContext) context).getExecutionResults()).getResults().put(this.outIdentifier,
                                                                                                               processInstance.getId());
        }
        return processInstance;
    }
View Full Code Here

Examples of org.openbravo.model.ad.process.ProcessInstance

      Map<String, String> parameters) {

    final boolean currentAdminMode = OBContext.getOBContext().setInAdministratorMode(true);
    try {
      // Create the pInstance
      final ProcessInstance pInstance = OBProvider.getInstance().get(ProcessInstance.class);
      // sets its process
      pInstance.setProcess(process);
      // must be set to true
      pInstance.setActive(true);
      if (recordID != null) {
        pInstance.setRecordID(recordID);
      } else {
        pInstance.setRecordID("0");
      }

      // get the user from the context
      pInstance.setUserContact(OBContext.getOBContext().getUser());

      // now create the parameters and set their values
      if (parameters != null) {
        int index = 0;
        for (String key : parameters.keySet()) {
          index++;
          final String value = parameters.get(key);
          final Parameter parameter = OBProvider.getInstance().get(Parameter.class);
          parameter.setSequenceNumber(index + "");
          parameter.setParameterName(key);
          parameter.setString(value);

          // set both sides of the bidirectional association
          pInstance.getADParameterList().add(parameter);
          parameter.setProcessInstance(pInstance);
        }
      }

      // persist to the db
      OBDal.getInstance().save(pInstance);

      // flush, this gives pInstance an ID
      OBDal.getInstance().flush();

      // call the SP
      try {
        // first get a connection
        final Connection connection = OBDal.getInstance().getConnection();
        // connection.createStatement().execute("CALL M_InOut_Create0(?)");

        final Properties obProps = OBPropertiesProvider.getInstance().getOpenbravoProperties();
        final PreparedStatement ps;
        if (obProps.getProperty("bbdd.rdbms") != null
            && obProps.getProperty("bbdd.rdbms").equals("POSTGRE")) {
          ps = connection.prepareStatement("SELECT * FROM " + process.getProcedure() + "(?)");
        } else {
          ps = connection.prepareStatement(" CALL " + process.getProcedure() + "(?)");
        }

        ps.setString(1, pInstance.getId());
        ps.execute();
      } catch (Exception e) {
        throw new IllegalStateException(e);
      }

View Full Code Here

Examples of org.uengine.kernel.ProcessInstance

  }
 
  public HashMap getProcessVariable(String instanceId, ProcessManagerRemote pm) {
    HashMap processVariableMap = null;
    ProcessInstance instance = null;

    try {
      instance = pm.getProcessInstance(instanceId);
      ProcessVariable[] processVariables = instance.getProcessDefinition().getProcessVariables();
     
      processVariableMap = new HashMap();
     
      if (processVariables != null) {
        for (int i = 0; i < processVariables.length; i++) {
View Full Code Here

Examples of pl.net.bluesoft.rnd.processtool.model.ProcessInstance

    }

  public String internalInvoke(final TaskWatch watch) {
    ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
    ProcessInstanceDAO dao = ctx.getProcessInstanceDAO();
    ProcessInstance pi = dao.getProcessInstance(Long.parseLong(processInstanceId));
    if (pi.getInternalId() == null) {
        pi.setInternalId(context.getScopeInstance().getExecution().getProcessInstance().getId());
        dao.saveProcessInstance(pi);
    }

    final ProcessToolProcessStep stepInstance = ctx.getRegistry().getStep(stepName);
    if (stepInstance == null) {
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.