Package org.uengine.processmanager

Examples of org.uengine.processmanager.ProcessManagerFactoryBean


    if(request != null && isHtmlSave){
      request.setAttribute("mappingResult", valueMap);
      request.setAttribute("instance", instance);
      request.setAttribute("formActivity", this);
      request.setAttribute("loggedRoleMapping", instance.getProcessTransactionContext().getProcessManager().getGenericContext().get(HumanActivity.GENERICCONTEXT_CURR_LOGGED_ROLEMAPPING));
      request.setAttribute("pm", (new ProcessManagerFactoryBean()).getProcessManagerForReadOnly());
       
      final StringWriter sw = new StringWriter();
      ServletContext servletContext = servlet.getServletContext();

      boolean isJBoss = "JBOSS".equals(GlobalContext.getPropertyString("was.type", "TOMCAT"));
View Full Code Here


 
  public void setInitializeProc(HttpServletRequest request) throws Exception {
    ProcessDefinitionRemote pdr = null;

    // useBean
    ProcessManagerFactoryBean processManagerFactory = new ProcessManagerFactoryBean();

    pm = processManagerFactory.getProcessManager();

    instanceId = decode(request.getParameter("instanceId"));
    processDefinition = decode(request.getParameter("processDefinition"));
    tracingTag = request.getParameter("tracingTag");
View Full Code Here

                  e5.printStackTrace();
                }
               
              final boolean isRetrying = (retCnt > 0 && retCnt < maxRetry-1);
             
              ProcessManagerFactoryBean pmfb = new ProcessManagerFactoryBean();
              ProcessManagerRemote pm = null;
              ProcessInstance instance = null;
 
              try{
               
                if(act.isQueuingEnabled()){
                  pm = pmfb.getProcessManager();
                  instance = pm.getProcessInstance(instanceId);
                }else{
                  instance = finalInstance;
                }
               
                long timeInMillis_start = System.currentTimeMillis();
               
                System.out.println("- [uEngine] Start Executing Activity: " + act.getName() + " (" + act.getTracingTag() + ")");
               
               
                instance.execute(act.getTracingTag());
               
                long elapsedTime = (System.currentTimeMillis() - timeInMillis_start);
               
                PrintStream logWriter = (elapsedTime < ERROR_LEVEL_TIMEINMS ? System.out : System.err);
               
                logWriter.println("- [uEngine] End Executing Activity: " + act.getName() + " (" + act.getTracingTag() + ") - Elapsed Time : " + elapsedTime);
               
                if(pm!=null)
                  pm.applyChanges();
               
                success = true;
               
              }catch(Exception e){
 
                if(instance instanceof SimulatorProcessInstance){
                  try {
                    act.fireFault(instance, e);
                  } catch (Exception e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                 
                }else{
                  UEngineException ue = null;
                  if(!(e instanceof UEngineException)){
                    ByteArrayOutputStream bao = new ByteArrayOutputStream();
                    e.printStackTrace(new PrintStream(bao));
                    try{     
                      ue = new UEngineException("uEngine Exception: " + e + "("+e.getMessage()+")", e);
                      ue.setDetails(bao.toString());
                    }catch(Exception e3){
                      e3.printStackTrace();
                    }
                 
                  }else
                    ue = (UEngineException)e;
                 
                  if(GlobalContext.useEJB)
                    WorkProcessorBean.fireFault(instance, act.getTracingTag(), ue);
                  else{
                   
                    final UEngineException finalUE = ue;
                   
                    /**
                     * run it after roll-back the main transaction to prevent that the fault marking job
                     * would be rolled back as well.
                     */
                    instance.getProcessTransactionContext().addTransactionListener(new TransactionListener(){
 
                      public void beforeCommit(TransactionContext tx) throws Exception {
                        // TODO Auto-generated method stub
                       
                      }
 
                      public void beforeRollback(TransactionContext tx) throws Exception {
                        // TODO Auto-generated method stub
                       
                      }
 
                      public void afterCommit(TransactionContext tx) throws Exception {
                        afterRollback(tx);
                       
                      }
 
                      public void afterRollback(TransactionContext tx) throws Exception {
                       
                        Thread faultMarker = new Thread(){
 
                          public void run() {
                            ProcessManagerFactoryBean pmfb = new ProcessManagerFactoryBean();
                            ProcessManagerRemote pm = null;
                            ProcessInstance instanceForFaultMarking = null;
         
                            try{
                              pm = pmfb.getProcessManager();
                              instanceForFaultMarking = pm.getProcessInstance(instanceId);
                              try{
                                //String oldStatus = act.getStatus(instanceForFaultMarking);
                               
                                act.fireFault(instanceForFaultMarking, finalUE);
View Full Code Here

          ProcessManagerRemote pm = null;
          try{
            if(ptc.getProcessManager()!=null)
              pm = ptc.getProcessManager();
            else
              pm = (new ProcessManagerFactoryBean()).getProcessManagerForReadOnly();
     
            String versionId = pm.getProcessDefinitionProductionVersion(spAct.getDefinitionIdOnly());   
            ProcessDefinition spDef = ProcessDefinitionFactory.getInstance(ptc).getDefinition(versionId);
           
            if(spDef.isInitiateByFirstWorkitem()){
View Full Code Here

 
  public void execute(JobExecutionContext context) {
   
//    System.out.println("scheduler WaitJob execute() start...");
   
    ProcessManagerFactoryBean pmfb = new ProcessManagerFactoryBean();
   
    Calendar now = Calendar.getInstance();
   
    List<SchedulerItem> schedulerItems = this.getAllSchedule();
   
    for (final SchedulerItem item : schedulerItems) {
     
      ProcessManagerRemote pm = null;
      ProcessInstance instance = null;
     
      try {
        pm = pmfb.getProcessManager();
        try {
          instance = pm.getProcessInstance(item.getInstanceId());
        } catch (Exception e) {
        }
       
View Full Code Here

    out.flush();
    out.close();
  }
 
  private String getDefinitionVersionResource(String defVerId) {
    ProcessManagerFactoryBean processManagerFactory = new ProcessManagerFactoryBean();
    ProcessManagerRemote pm = null;
    String content = null;
   
    try {
      pm = processManagerFactory.getProcessManagerForReadOnly();
      content = pm.getResource(defVerId);
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      try {
View Full Code Here

    ProcessManagerRemote pm = null;

    if(instance!=null)
      pm = instance.getProcessTransactionContext().getProcessManager();
    else
      pm = (new ProcessManagerFactoryBean()).getProcessManagerForReadOnly();

    return getDefinitionVersionId(instance, pm, definitionId, versionSelectionOption, definition);
  }
View Full Code Here

    System.out.println(adacMsg);
   
    String status = null;
    List<TaskInfo> taskInfoList = null;
   
    ProcessManagerFactoryBean pmfb = new ProcessManagerFactoryBean();
    ProcessManagerRemote pm = null;
    try {
      pm = pmfb.getProcessManager();
     
      ProcessManagerService pms = new ProcessManagerService(pm, null);
      pms.approvalDraftActivityComplete(adacMsg);
      pm.applyChanges();
     
View Full Code Here

    System.out.println(psMsg);
   
    String status = null;
    List<TaskInfo> taskInfoList = null;
   
    ProcessManagerFactoryBean pmfb = new ProcessManagerFactoryBean();
    ProcessManagerRemote pm = null;
    try {
      pm = pmfb.getProcessManager();
     
      ProcessManagerService pms = new ProcessManagerService(pm, null);
      pms.processStop(psMsg);
      pm.applyChanges();
     
View Full Code Here

    System.out.println(acMsg);
   
    String status = null;
    List<TaskInfo> taskInfoList = null;
   
    ProcessManagerFactoryBean pmfb = new ProcessManagerFactoryBean();
    ProcessManagerRemote pm = null;
    try {
      pm = pmfb.getProcessManager();
     
      ProcessManagerService pms = new ProcessManagerService(pm, null);
      pms.activityComplete(acMsg);
      pm.applyChanges();
     
View Full Code Here

TOP

Related Classes of org.uengine.processmanager.ProcessManagerFactoryBean

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.