Package org.jbpm.svc

Examples of org.jbpm.svc.Services


  }
 
  public void createSchema(String jbpmContextName) {
    JbpmContext jbpmContext = createJbpmContext(jbpmContextName);
    try {
      Services services = jbpmContext.getServices();
      DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) services.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
      persistenceServiceFactory.createSchema();
    } finally {
      jbpmContext.close();
    }
  }
View Full Code Here


  }
 
  public void dropSchema(String jbpmContextName) {
    JbpmContext jbpmContext = createJbpmContext(jbpmContextName);
    try {
      Services services = jbpmContext.getServices();
      DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) services.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
      persistenceServiceFactory.dropSchema();
    } finally {
      jbpmContext.close();
    }
  }
View Full Code Here

        Object saveOperation = saveOperationObjectInfos[i].createObject(objectFactory);
        saveOperations.add(saveOperation);
      }
    }

    Services services = new Services(serviceFactories, serviceNames, saveOperations);
   
    if (log.isDebugEnabled()) log.debug("creating jbpm context with service factories '"+serviceFactories.keySet()+"'");
    return new JbpmContext(services, objectFactory);
  }
View Full Code Here

   * @throws JbpmException if no matching jBPM context service is found.
   */
  private JcrService findService() {
    String serviceName = null;
    JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
    Services services = jbpmContext.getServices();

    // if there is a service called jcr
    if (services.hasService("jcr")) {
      // use that one
      serviceName = "jcr";

    } else { // otherwise
      // start matching the JCR workspace name with the jbpm service names
      Iterator serviceNames = services.getServiceFactories().keySet().iterator();
      while (serviceNames.hasNext()) {
        String candidate = (String) serviceNames.next();
        if (candidate.startsWith(workspace)) {
          if (candidate.length()==workspace.length()) {
            if (serviceName==null) {
              serviceName = candidate;
            }
          } else if (candidate.endsWith(workspace)) {
            serviceName = candidate;
          }
        }
      }
    }
   
    if (serviceName==null) {
      throw new JbpmException("couldn't find service for JCR repository '"+repository+"', workspace '"+workspace+"'");
    }
   
    return (JcrService) services.getService(serviceName);
  }
View Full Code Here

  public DbPersistenceService(DbPersistenceServiceFactory persistenceServiceFactory) {
    this(persistenceServiceFactory, getCurrentServices());
  }

  static Services getCurrentServices() {
    Services services = null;
    JbpmContext currentJbpmContext = JbpmContext.getCurrentJbpmContext();
    if (currentJbpmContext!=null) {
      services = currentJbpmContext.getServices();
    }
    return services;
View Full Code Here

  }
 
  public void createSchema(String jbpmContextName) {
    JbpmContext jbpmContext = createJbpmContext(jbpmContextName);
    try {
      Services services = jbpmContext.getServices();
      DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) services.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
      persistenceServiceFactory.createSchema();
    } finally {
      jbpmContext.close();
    }
  }
View Full Code Here

  }
 
  public void dropSchema(String jbpmContextName) {
    JbpmContext jbpmContext = createJbpmContext(jbpmContextName);
    try {
      Services services = jbpmContext.getServices();
      DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) services.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
      persistenceServiceFactory.dropSchema();
    } finally {
      jbpmContext.close();
    }
  }
View Full Code Here

  public DbPersistenceService(DbPersistenceServiceFactory persistenceServiceFactory) {
    this(persistenceServiceFactory, getCurrentServices());
  }

  static Services getCurrentServices() {
    Services services = null;
    JbpmContext currentJbpmContext = JbpmContext.getCurrentJbpmContext();
    if (currentJbpmContext!=null) {
      services = currentJbpmContext.getServices();
    }
    return services;
View Full Code Here

TOP

Related Classes of org.jbpm.svc.Services

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.