當前位置: 首頁>>代碼示例>>Java>>正文


Java RuntimeEnvironment類代碼示例

本文整理匯總了Java中org.kie.api.runtime.manager.RuntimeEnvironment的典型用法代碼示例。如果您正苦於以下問題:Java RuntimeEnvironment類的具體用法?Java RuntimeEnvironment怎麽用?Java RuntimeEnvironment使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RuntimeEnvironment類屬於org.kie.api.runtime.manager包,在下文中一共展示了RuntimeEnvironment類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getRuntimeManager

import org.kie.api.runtime.manager.RuntimeEnvironment; //導入依賴的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: build

import org.kie.api.runtime.manager.RuntimeEnvironment; //導入依賴的package包/類
/**
 * Builds a RuntimeManager.
 * @param type type
 * @param identifier identifier
 * @return a RuntimeManager
 */
public RuntimeManager build(KnowledgeRuntimeManagerType type, String identifier) {
    final RuntimeManager runtimeManager;
    final RuntimeEnvironment runtimeEnvironment = _runtimeEnvironmentBuilder.build();
    final RemoteManifest remoteManifest = RemoteManifest.removeFromEnvironment(runtimeEnvironment.getEnvironment());
    if (remoteManifest != null) {
        runtimeManager = new RemoteRuntimeManager(remoteManifest.buildConfiguration(), identifier);
    } else {
        switch (type) {
            case SINGLETON:
                runtimeManager = _runtimeManagerFactory.newSingletonRuntimeManager(runtimeEnvironment, identifier);
                break;
            case PER_REQUEST:
                runtimeManager = _runtimeManagerFactory.newPerRequestRuntimeManager(runtimeEnvironment, identifier);
                break;
            case PER_PROCESS_INSTANCE:
                runtimeManager = _runtimeManagerFactory.newPerProcessInstanceRuntimeManager(runtimeEnvironment, identifier);
                break;
            default:
                runtimeManager = null;
                break;
        }
    }
    return runtimeManager;
}
 
開發者ID:jboss-switchyard,項目名稱:switchyard,代碼行數:31,代碼來源:RuntimeManagerBuilder.java

示例3: build

import org.kie.api.runtime.manager.RuntimeEnvironment; //導入依賴的package包/類
/** Builds a RuntimeManager.
 * 
 * @param type type
 * @param identifier identifier
 * @return a RuntimeManager */
public RuntimeManager build(KnowledgeRuntimeManagerType type, String identifier) {
    final RuntimeManager runtimeManager;
    final RuntimeEnvironment runtimeEnvironment = _runtimeEnvironmentBuilder.build();
    final RemoteManifest remoteManifest = RemoteManifest.removeFromEnvironment(runtimeEnvironment.getEnvironment());
    if (remoteManifest != null) {
        runtimeManager = new RemoteRuntimeManager(remoteManifest.buildConfiguration(), identifier);
    } else {
        switch (type) {
        case SINGLETON:
            runtimeManager = _runtimeManagerFactory.newSingletonRuntimeManager(runtimeEnvironment, identifier);
            break;
        case PER_REQUEST:
            runtimeManager = _runtimeManagerFactory.newPerRequestRuntimeManager(runtimeEnvironment, identifier);
            break;
        case PER_PROCESS_INSTANCE:
            runtimeManager = _runtimeManagerFactory.newPerProcessInstanceRuntimeManager(runtimeEnvironment, identifier);
            break;
        default:
            runtimeManager = null;
            break;
        }
    }
    return runtimeManager;
}
 
開發者ID:jboss-integration,項目名稱:fuse-bxms-integ,代碼行數:30,代碼來源:RuntimeManagerBuilder.java

示例4: createRuntimeManager

import org.kie.api.runtime.manager.RuntimeEnvironment; //導入依賴的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

示例5: main

import org.kie.api.runtime.manager.RuntimeEnvironment; //導入依賴的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

示例6: newPerRequestRuntimeManager

import org.kie.api.runtime.manager.RuntimeEnvironment; //導入依賴的package包/類
@Override
public RuntimeManager newPerRequestRuntimeManager(RuntimeEnvironment environment, String identifier) {
    SessionFactory factory = getSessionFactory(environment);
    TaskServiceFactory taskServiceFactory = getTaskServiceFactory(environment);

    RuntimeManager manager = new KnowledgePerRequestRuntimeManager(environment, factory, taskServiceFactory, identifier);
    initTimerService(environment, manager);
    ((AbstractRuntimeManager)manager).init();
    return manager;
}
 
開發者ID:jboss-integration,項目名稱:fuse-bxms-integ,代碼行數:11,代碼來源:KnowledgeRuntimeManagerFactoryImpl.java

示例7: KnowledgePerRequestRuntimeManager

import org.kie.api.runtime.manager.RuntimeEnvironment; //導入依賴的package包/類
public KnowledgePerRequestRuntimeManager(RuntimeEnvironment environment, SessionFactory factory, TaskServiceFactory taskServiceFactory, String identifier) {
    super(environment, factory, taskServiceFactory, identifier);
}
 
開發者ID:jboss-integration,項目名稱:fuse-bxms-integ,代碼行數:4,代碼來源:KnowledgePerRequestRuntimeManager.java

示例8: PatchedLocalTaskServiceFactory

import org.kie.api.runtime.manager.RuntimeEnvironment; //導入依賴的package包/類
/** Creates a new PatchedLocalTaskServiceFactory.
 * 
 * @param runtimeEnvironment the RuntimeEnvironment */
public PatchedLocalTaskServiceFactory(RuntimeEnvironment runtimeEnvironment) {
    super(runtimeEnvironment);
}
 
開發者ID:jboss-integration,項目名稱:fuse-bxms-integ,代碼行數:7,代碼來源:PatchedLocalTaskServiceFactory.java

示例9: PatchedLocalTaskServiceFactory

import org.kie.api.runtime.manager.RuntimeEnvironment; //導入依賴的package包/類
/**
 * Creates a new PatchedLocalTaskServiceFactory.
 * @param runtimeEnvironment the RuntimeEnvironment
 */
public PatchedLocalTaskServiceFactory(RuntimeEnvironment runtimeEnvironment) {
    super(runtimeEnvironment);
}
 
開發者ID:jboss-switchyard,項目名稱:switchyard,代碼行數:8,代碼來源:PatchedLocalTaskServiceFactory.java


注:本文中的org.kie.api.runtime.manager.RuntimeEnvironment類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。