Package org.jbpm.svc

Examples of org.jbpm.svc.Services


      executionContext.setEventSource(this);

      // TODO: Is it a valid condition that the jbpmContext is not there?
      JbpmContext jbpmContext = executionContext.getJbpmContext();
      if (jbpmContext != null) {
        Services services = jbpmContext.getServices();
        if (services != null) {
          EventService evService = (EventService) services.getService(EventService.SERVICE_NAME);
          if (evService != null) {
            evService.fireEvent(eventType, this, executionContext);
          }
        }
      }
View Full Code Here


    /* check whether the transaction is still active before scanning the exception handlers.
     * that way we can load the exception handlers lazily
     * see https://jira.jboss.org/jira/browse/JBPM-1775 */
    JbpmContext jbpmContext = executionContext.getJbpmContext();
    if (jbpmContext != null) {
      Services services = jbpmContext.getServices();
      if (services != null) {
        Service service = services.getPersistenceService();
        if (service instanceof DbPersistenceService) {
          DbPersistenceService persistenceService = (DbPersistenceService) service;
          return persistenceService.isTransactionActive() || persistenceService.getTransaction() == null;
        }
      }
View Full Code Here

      // make sure jobs for this process instance are canceled
      // after the process end updates are posted to the database
      JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
      if (jbpmContext != null)
      {
        Services services = jbpmContext.getServices();
        MessageService messageService = services.getMessageService();
        PersistenceService persistenceService = services.getPersistenceService();
        if (messageService != null
            && persistenceService != null
            && persistenceService.getJobSession().countDeletableJobsForProcessInstance(this) > 0)
        {
          CleanUpProcessJob job = new CleanUpProcessJob(rootToken);
View Full Code Here

      "</jbpm-configuration>"
    );
   
    JbpmContext jbpmContext = (JbpmContext) objectFactory.createObject("mycontext");
    assertNotNull(jbpmContext);
    Services services = jbpmContext.getServices();
    assertEquals(2, services.getServiceFactories().size());
    assertTrue(services.getServiceFactories().containsKey("myservice"));
    assertTrue(services.getServiceFactories().containsKey("mysecondservice"));
    assertSame(services.getServiceFactory("myservice"), services.getServiceFactory("mysecondservice"));
  }
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

        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

      "<jbpm-configuration>" +
      "  <jbpm-context name='a' />" +
      "</jbpm-configuration>"
    );
    assertNotNull(jbpmConfiguration);
    Services s = jbpmConfiguration.createJbpmContext("a").getServices();
    assertNotNull(s);
    Services s2 = jbpmConfiguration.createJbpmContext("a").getServices();
    assertNotNull(s2);
    assertNotSame(s, s2);
  }
View Full Code Here

     * @throws JMSException For errors during JMS delivery.
     */
    private void discard(final JbpmContext jbpmContext, final Message message)
        throws JMSException
    {
        final Services services = jbpmContext.getServices();
        final JmsMessageServiceFactory messageServiceFactory = (JmsMessageServiceFactory) services.getServiceFactory(Services.SERVICENAME_MESSAGE);
        final Destination destination = messageServiceFactory.getDLQDestination();

        final JmsMessageService messageService = (JmsMessageService)services.getMessageService();
        final Session session = messageService.getSession();
        final MessageProducer producer = session.createProducer(destination);
        try {
          producer.send(message);
        }
View Full Code Here

    {
        if (log.isDebugEnabled())
        {
            log.debug("sending result " + result + " to " + destination);
        }
        final Services services = jbpmContext.getServices();

        final JmsMessageService messageService = (JmsMessageService) services.getMessageService();
        final Session session = messageService.getSession();
        final MessageProducer producer = session.createProducer(destination);
        try
        {
          Message resultMessage = session.createObjectMessage(result);
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.