Package org.jbpm

Examples of org.jbpm.JbpmException


  LocalTimerService localTimerService;
 
  public EjbSchedulerService() {
    JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
    if (jbpmContext==null) {
      throw new JbpmException("instantiation of the EjbSchedulerService requires a current JbpmContext");
    }
    this.jobSession = jbpmContext.getJobSession();
   
    try {
      Context initial = new InitialContext();
      LocalTimerServiceHome localTimerServiceHome = (LocalTimerServiceHome) initial.lookup("java:comp/env/ejb/LocalTimerServiceBean");
      localTimerService = localTimerServiceHome.create();
    } catch (Exception e) {
      JbpmException jbpmException = new JbpmException("ejb local timer lookup problem", e);
      log.error(e);
      throw jbpmException;
    }
  }
View Full Code Here


  public void close() {
    try {
      log.debug("removing the timer service session bean");
      localTimerService.remove();
    } catch (Exception e) {
      JbpmException jbpmException = new JbpmException("ejb local timer service close problem", e);
      log.error(e);
      throw jbpmException;
    }
  }
View Full Code Here

    } catch (Exception e) {
      e.printStackTrace();
      // TODO verify that such a message gets redirected to the dead letter queue
      // or something similar without retrying.
      throw new JbpmException("job listener bean only can handle messages with a long-property jobId that refers to a Job in the JBPM_JOB tables.");
    }
    return command;
  }
View Full Code Here

    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    try {
      log.debug("executing " + command);
      result = command.execute(jbpmContext);
    } catch (Exception e) {
      throw new JbpmException("couldn't execute "+command, e);
    } finally {
      jbpmContext.close();
    }
    return result;
  }
View Full Code Here

          localCommandService.remove();
        }
      } catch (Exception e) {
        e.printStackTrace();
        // TODO add a retry mechanism or verify how this can be configured in the MDB itself
        throw new JbpmException("command "+command+" couldn't be executed", e);
      }
    }
  }
View Full Code Here

        }
      } catch (Exception e) {
        e.printStackTrace();
        // TODO verify that such a message gets redirected to the dead letter queue
        // or something similar without retrying.
        throw new JbpmException("command listener bean only can handle object messages with Command's as the object.");
      }
    } else {
      log.warn("ignoring message '"+message+"' cause it's not an ObjectMessage ("+message.getClass().getName()+")");
    }
    return command;
View Full Code Here

      {
        field.set(command, lastResult);
      }
      catch (Exception e)
      {
        throw new JbpmException("couldn't propagate composite command context", e);
      }
    }
  }
View Full Code Here

  // behaviour ////////////////////////////////////////////////////////////////

  public void execute(ExecutionContext executionContext) {
    if ( (nodes==null)
         || (nodes.size()==0) ) {
      throw new JbpmException("transition enters superstate +"+this+"' and it there is no first child-node to delegate to");
    }
    Node startNode = nodes.get(0);
    startNode.enter(executionContext);
  }
View Full Code Here

          }
        }
      }
      if (firstException != null) {
        throw firstException instanceof JbpmException ? (JbpmException) firstException
            : new JbpmException("problem closing services", firstException);
      }
    }
  }
View Full Code Here

    if ((condition != null) && (isConditionEnforced))
    {
      Object result = JbpmExpressionEvaluator.evaluate(condition, executionContext);
      if (result == null)
      {
        throw new JbpmException("transition condition " + condition + " evaluated to null");
      }
      else if (!(result instanceof Boolean))
      {
        throw new JbpmException("transition condition " + condition + " evaluated to non-boolean: " + result.getClass().getName());
      }
      else if (!((Boolean)result).booleanValue())
      {
        throw new JbpmException("transition condition " + condition + " evaluated to 'false'");
      }
    }

    // start the transition log
    TransitionLog transitionLog = new TransitionLog(this, executionContext.getTransitionSource());
View Full Code Here

TOP

Related Classes of org.jbpm.JbpmException

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.