Package org.jbpm

Examples of org.jbpm.JbpmConfiguration


  private File file = null;
  private String jbpmCfg = null;

  public void execute() throws BuildException {
    // get the JbpmSessionFactory
    JbpmConfiguration jbpmConfiguration = AntHelper.getJbpmConfiguration(jbpmCfg);
   
    // if attribute file is set, deploy that file file
    if (file==null) throw new BuildException("no file specified in the loadidentities task");

    log( "loading identities from "+file+" ..." );
    FileInputStream fileInputStream = null;
    try {
      fileInputStream = new FileInputStream(file);
    } catch (FileNotFoundException e) {
      throw new BuildException("identities file '"+file+"' not found");
    }
    Entity[] entities = IdentityXmlParser.parseEntitiesResource(fileInputStream);
   
    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    try {
      Session session = jbpmContext.getSession();
      for (int i=0; i<entities.length; i++) {
        session.save(entities[i]);
      }
View Full Code Here


public class ShutDownHsqldb extends Task {

  public void execute() throws BuildException {
    Connection connection = null;
    JbpmConfiguration jbpmConfiguration = AntHelper.getJbpmConfiguration(null);
    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    try {
      DbPersistenceServiceFactory dbPersistenceServiceFactory = (DbPersistenceServiceFactory) jbpmContext.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
      SessionFactoryImpl sessionFactory = (SessionFactoryImpl) dbPersistenceServiceFactory.getSessionFactory();
      ConnectionProvider connectionProvider = sessionFactory.getConnectionProvider();
      connection = connectionProvider.getConnection();
View Full Code Here

  List fileSets = new ArrayList();

  public void execute() throws BuildException {
    try {
      // get the JbpmConfiguration
      JbpmConfiguration jbpmConfiguration = AntHelper.getJbpmConfiguration(jbpmCfg);
     
      // if attribute process is set, deploy that process file
      if (process!=null) {
        log( "deploying par "+process.getAbsolutePath()+" ..." );
        deploy(process, jbpmConfiguration);
View Full Code Here

    }
    return configuration;
  }

  public static JbpmConfiguration getJbpmConfiguration(String jbpmCfg) {
    JbpmConfiguration jbpmConfiguration = (JbpmConfiguration) jbpmConfigurations.get(jbpmCfg);
    if (jbpmConfiguration==null) {
      if (jbpmCfg==null) {
        jbpmConfiguration = JbpmConfiguration.getInstance();

      } else {
View Full Code Here

    }
   
    // first see if the jbpm cfg is specified cause that implies a hibernate configuration
    if (jbpmCfg!=null) {
      log("using jbpm configuration "+jbpmCfg);
      JbpmConfiguration jbpmConfiguration = AntHelper.getJbpmConfiguration(jbpmCfg);
      JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
      try {
        DbPersistenceServiceFactory dbPersistenceServiceFactory = (DbPersistenceServiceFactory) jbpmConfiguration.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
        configuration = dbPersistenceServiceFactory.getConfiguration();
      } finally {
        jbpmContext.close();
      }
     
View Full Code Here

  public void init() throws ServletException {
    configurationName = getInitParameter("jbpm.configuration.resource", null);
  }
 
  public void destroy() {
    JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance(configurationName);
    jbpmConfiguration.close();
  }
View Full Code Here

 
  /* (non-Javadoc)
   * @see it.eng.spago.init.InitializerIFace#init(it.eng.spago.base.SourceBean)
   */
  public void init(SourceBean config) {
    JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
    DbPersistenceServiceFactory dbpsf = (DbPersistenceServiceFactory)jbpmConfiguration.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
    try{
      SessionFactory sessionFactHib = dbpsf.getSessionFactory();
      Session sessionHib = sessionFactHib.openSession();
      Query hibQuery = sessionHib.createQuery(" from ProcessDefinition");
      List hibList = hibQuery.list();     
    } catch (HibernateException he) {
      jbpmConfiguration.createSchema();
    }
  }
View Full Code Here

   */
  public String getPublisherName(RequestContainer requestContainer, ResponseContainer responseContainer) {
    JbpmContext jbpmContext = null;
    try {
      SourceBean request = requestContainer.getServiceRequest();
        JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
        jbpmContext = jbpmConfiguration.createJbpmContext();
        String activityKeyIdStr = (String) request.getAttribute("ActivityKey");
      long activityKeyId = Long.valueOf(activityKeyIdStr).longValue();
      TaskInstance taskInstance = jbpmContext.getTaskInstance(activityKeyId);
      if(taskInstance.getStart()==null) {
        taskInstance.start();
View Full Code Here

   */
  public void service(SourceBean request, SourceBean response) throws Exception {
      // This action handle both activity completion and activity reject
    JbpmContext jbpmContext = null;
    try{
      JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
        jbpmContext = jbpmConfiguration.createJbpmContext();
        String activityKeyIdStr = (String) request.getAttribute("ActivityKey");
      long activityKeyId = Long.valueOf(activityKeyIdStr).longValue();
      TaskInstance taskInstance = jbpmContext.getTaskInstance(activityKeyId);
      ContextInstance contextInstance = taskInstance.getContextInstance();
        ProcessInstance processInstance = contextInstance.getProcessInstance();
View Full Code Here

      SessionContainer session = getRequestContainer().getSessionContainer();
      SessionContainer permSession = session.getPermanentContainer();
      //ApplicationContainer application = ApplicationContainer.getInstance();
      IEngUserProfile userProfile = (IEngUserProfile)permSession.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
      //Getting Jbpm context
      JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
      jbpmContext = jbpmConfiguration.createJbpmContext();
      //Getting user roles
      Collection roles = null;

      roles = ((UserProfile)userProfile).getRolesForUse();
View Full Code Here

TOP

Related Classes of org.jbpm.JbpmConfiguration

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.