当前位置: 首页>>代码示例>>Java>>正文


Java RuntimeManagerFactory类代码示例

本文整理汇总了Java中org.kie.api.runtime.manager.RuntimeManagerFactory的典型用法代码示例。如果您正苦于以下问题:Java RuntimeManagerFactory类的具体用法?Java RuntimeManagerFactory怎么用?Java RuntimeManagerFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RuntimeManagerFactory类属于org.kie.api.runtime.manager包,在下文中一共展示了RuntimeManagerFactory类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRuntimeManager

import org.kie.api.runtime.manager.RuntimeManagerFactory; //导入依赖的package包/类
/**
 * 
 * Create the runtime manager for the process in the classpath
 * 
 * @return
 */
public static RuntimeManager getRuntimeManager() {
	setupPoolingDataSource();
	EntityManagerFactory emf = Persistence
			.createEntityManagerFactory("org.jbpm.persistence.jpa");
	RuntimeEnvironment env = RuntimeEnvironmentBuilder.Factory
			.get()
			.newDefaultBuilder()
			.entityManagerFactory(emf)
			.addAsset(
					ResourceFactory
							.newClassPathResource("helloProcess.bpmn2"),
					ResourceType.BPMN2).get();
	RuntimeManager manager = RuntimeManagerFactory.Factory.get()
			.newSingletonRuntimeManager(env);
	return manager;
}
 
开发者ID:jesuino,项目名称:bpms6-examples,代码行数:23,代码来源:Util.java

示例2: createRuntimeManager

import org.kie.api.runtime.manager.RuntimeManagerFactory; //导入依赖的package包/类
private RuntimeManager createRuntimeManager(KieBase kbase) {
	RuntimeEnvironmentBuilder builder = RuntimeEnvironmentBuilder.Factory
			.get().newDefaultBuilder().entityManagerFactory(emf)
			.knowledgeBase(kbase);
	RuntimeEnvironment env = builder.get();
	RuntimeManagerFactory man = RuntimeManagerFactory.Factory.get();
	RuntimeManager m = man.newPerRequestRuntimeManager(env, DEPLOYMENT_ID);
	return m;
}
 
开发者ID:jesuino,项目名称:bpms6-examples,代码行数:10,代码来源:ProcessBean.java

示例3: main

import org.kie.api.runtime.manager.RuntimeManagerFactory; //导入依赖的package包/类
public static void main(String[] args) throws InterruptedException {
	
	// no delay to call the executor and not using JMS
	System.setProperty("org.kie.executor.jms", "false");
	System.setProperty("org.kie.executor.initial.delay", "1");
	
	JBPMHelper.startH2Server();
	JBPMHelper.setupDataSource();
	
	// This entity manager factory contains Executor entities
	EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.persistence.with.executor");
	ExecutorService executorService = ExecutorServiceFactory.newExecutorService();
	
	// initialize the executor service - it is important or it won't work
	executorService.init();
	
	
	RuntimeEnvironment env = RuntimeEnvironmentBuilder.Factory
			.get()
			.newEmptyBuilder()
			// remember to register the executor service
			.addEnvironmentEntry("ExecutorService", executorService) 
			.entityManagerFactory(emf)
			.addAsset(
					KieServices.Factory.get().getResources()
							.newClassPathResource("org.jbpm.async_test.v1.0.bpmn2"),
					ResourceType.BPMN2).get();
	

	RuntimeManager runtimeManager = RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(env);
	RuntimeEngine engine = runtimeManager.getRuntimeEngine(EmptyContext.get());
	KieSession kieSession = engine.getKieSession();
	
	// registering the WIH for the Service task
	kieSession.getWorkItemManager().registerWorkItemHandler("Service Task", new ServiceTaskHandler());

	kieSession.startProcess("test.async_test");

	runtimeManager.disposeRuntimeEngine(engine);
}
 
开发者ID:jesuino,项目名称:bpms6-examples,代码行数:41,代码来源:TestExecutor.java

示例4: RuntimeManagerBuilder

import org.kie.api.runtime.manager.RuntimeManagerFactory; //导入依赖的package包/类
/** Creates a RuntimeManagerBuilder.
 * 
 * @param classLoader classLoader
 * @param serviceDomain serviceDomain
 * @param implementationModel implementationModel */
public RuntimeManagerBuilder(ClassLoader classLoader, ServiceDomain serviceDomain, KnowledgeComponentImplementationModel implementationModel) {
    super(classLoader, serviceDomain);
    _runtimeManagerFactory = RuntimeManagerFactory.Factory.get(classLoader);
    _runtimeEnvironmentBuilder = new RuntimeEnvironmentBuilder(getClassLoader(), serviceDomain, implementationModel);
}
 
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:11,代码来源:RuntimeManagerBuilder.java

示例5: runtimeManagerFactoryAvailableTest

import org.kie.api.runtime.manager.RuntimeManagerFactory; //导入依赖的package包/类
@Test
public void runtimeManagerFactoryAvailableTest() throws Exception {
    final RuntimeManagerFactory runtimeManagerFactory = RuntimeManagerFactory.Factory.get();
    assertNotNull(runtimeManagerFactory);
}
 
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:6,代码来源:WorkItemFeatureInstallTest.java

示例6: RuntimeManagerBuilder

import org.kie.api.runtime.manager.RuntimeManagerFactory; //导入依赖的package包/类
/**
 * Creates a RuntimeManagerBuilder.
 * @param classLoader classLoader
 * @param serviceDomain serviceDomain
 * @param implementationModel implementationModel
 */
public RuntimeManagerBuilder(ClassLoader classLoader, ServiceDomain serviceDomain, KnowledgeComponentImplementationModel implementationModel) {
    super(classLoader, serviceDomain);
    _runtimeManagerFactory = RuntimeManagerFactory.Factory.get();
    _runtimeEnvironmentBuilder = new RuntimeEnvironmentBuilder(getClassLoader(), serviceDomain, implementationModel);
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:12,代码来源:RuntimeManagerBuilder.java


注:本文中的org.kie.api.runtime.manager.RuntimeManagerFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。