⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 executionserviceremotetest.java

📁 一个java工作流引擎
💻 JAVA
字号:
package org.jbpm.ejb;

import java.util.*;
import javax.naming.*;
import org.jbpm.model.definition.*;
import org.jbpm.model.execution.*;
import org.jbpm.model.log.*;
import junit.framework.*;

public class ExecutionServiceRemoteTest extends TestCase {
  
  public void testGet() throws Exception {
    Properties properties = new Properties();
    properties.put( Context.INITIAL_CONTEXT_FACTORY ,"org.jnp.interfaces.NamingContextFactory");
    properties.put( Context.PROVIDER_URL,"localhost:1100");
    properties.put( Context.URL_PKG_PREFIXES,"jboss.naming:org.jnp.interfaces");
    
    for ( int i = 0; i < 50; i++ ) {
      JbpmEjbServiceLocator jbpmEjbServiceLocator = new JbpmEjbServiceLocator( properties );
      ExecutionServiceRemote executionServiceRemote = null;
      executionServiceRemote = jbpmEjbServiceLocator.getExecutionServiceRemote();
      Definition definition = executionServiceRemote.getLatestDefinition( "the state process" );
      assertNotNull( "did you forget to deploy the process definition with 'ant deploy.process.archives' ?", definition );
      InvocationLog invocationLog = executionServiceRemote.startProcessInstance( "remote app-client test runner", definition.getId(), null, null );
      ProcessInstance instance = invocationLog.getProcessInstance();
      executionServiceRemote.endOfState( "testrunner", instance.getRoot().getId(), null, null );
      jbpmEjbServiceLocator.release( executionServiceRemote );
    }
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -