Package org.uengine.processmanager

Examples of org.uengine.processmanager.ProcessManagerBean


   public void onMessage (Message omessage)
   {
    String tracingTag = null;
    ProcessInstance instance = null;
   
    ProcessManagerBean pmb = null;
    try{
      ObjectMessage message = (ObjectMessage)omessage;     
      FaultParameter faultParameter = (FaultParameter)message.getObject();
           
      String instanceId = faultParameter.getInstanceId();
      tracingTag = faultParameter.getTracingTag();
      UEngineException fault = faultParameter.getFault();
     
      pmb = new ProcessManagerBean();
      pmb.setSessionContext(null);
     
      try{
        instance = pmb.getProcessInstance(instanceId);
      }catch(Exception e){
        throw new UEngineException("Fault has been occurred during a new instance initiates.", fault);
      }
System.out.println("FaultProcessorBean::onMessage: fault is " + fault + "\n detail is " + fault.getDetails());
      //TODO: because of Oracle's max size of varchar
      fault.setDetails(null);
      //
     
      instance.fireFault(tracingTag, fault);
      pmb.applyChanges();

    }catch(Exception e){
      if(pmb!=null)
        try {
          pmb.cancelChanges();
        } catch (RemoteException e1) {
        }
       
      throw new EJBException(e);   
    }finally{
      try {
        pmb.remove();
      } catch (RemoteException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (RemoveException e) {
        // TODO Auto-generated catch block
View Full Code Here


    }   
  }
 
  private void checkOkToCloseConnection() throws Exception{
    if(getConnectionFactory() instanceof ProcessTransactionContext){
      ProcessManagerBean pm = ((ProcessTransactionContext)getConnectionFactory()).getProcessManager();
      if(!pm.isManagedTransaction()) throw new UEngineException("This thread tries to close any of connection in uEngine-managed transaction.");
    }
  }
View Full Code Here

  
   public void onMessage (Message omessage)
   {
    ProcessInstance instance = null;
   
    ProcessManagerBean pmb = new ProcessManagerBean();
    pmb.setSessionContext(null);

    try
    {        
      System.out.println ("MessageProcessor::onMessage() called..");
     
      MapMessage message = (MapMessage)omessage;
      String instanceId = message.getString("instance");
      String msg = message.getString("message");
      String str_payload = message.getString("payload");
     
      ByteArrayInputStream bis = new ByteArrayInputStream(str_payload.getBytes("ISO-8859-1"));
      Object payload = GlobalContext.deserialize(bis, String.class);
     
     
      instance = pmb.getProcessInstance(instanceId);

      if(instance.isRunning("")){ // if STOP signaled, don't execute anymore.
        //review: message would effect only one instance. it is not common in BPEL
        instance.getProcessDefinition().fireMessage(msg, instance, payload);
        pmb.applyChanges();
      }
     
    }
    catch(Throwable e)
    {
System.out.println("MessageProcessorBean::onMessage(): fail to process message. Reason:[" + e.getMessage() + "]. try to redeliver... ");
      //e.printStackTrace();
      try {
        pmb.cancelChanges();
      } catch (RemoteException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
      }
     
      ejbContext.setRollbackOnly();
    }finally{
      try {
        pmb.remove();
      } catch (RemoteException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (RemoveException e) {
        // TODO Auto-generated catch block
View Full Code Here

        int segmentIndex = activity.getTracingTag().indexOf("_");
        if(segmentIndex == -1){

          String spDefId = subProcessActivity.getDefinitionIdOnly();
          ProcessManagerBean processManager = instance.getProcessTransactionContext().getProcessManager();       
          String spVersionId = processManager.getProcessDefinitionProductionVersion(spDefId);
       
          ProcessDefinition spDef = ProcessDefinitionFactory.getInstance(instance.getProcessTransactionContext()).getDefinition(spVersionId);
         
          Vector scopeActitivies = new Vector();
          Vector firstLevelChild = spDef.getChildActivities();
View Full Code Here

        return null;
   

  public String getDefinitionVersionId(ProcessInstance instance)
      throws Exception {
    ProcessManagerRemote pm = new ProcessManagerBean();

    String versionId = null;
    String definitionId = null;

    String[] defIdAndVersionId = ProcessDefinition
        .splitDefinitionAndVersionId(getDefinitionId());
    definitionId = defIdAndVersionId[0];
    versionId = defIdAndVersionId[1];

    try {
      versionId = pm.getProcessDefinitionProductionVersion(definitionId);
    } catch (Exception e) {
      e.printStackTrace();

      try {
        versionId = pm.getFirstProductionVersionId(definitionId);
      } catch (Exception ex) {
        ex.printStackTrace();
        versionId = pm
            .getProcessDefinitionProductionVersion(definitionId);
      }
    }

    return versionId;
View Full Code Here

TOP

Related Classes of org.uengine.processmanager.ProcessManagerBean

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.