本文整理汇总了Java中org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration.buildProcessEngine方法的典型用法代码示例。如果您正苦于以下问题:Java StandaloneInMemProcessEngineConfiguration.buildProcessEngine方法的具体用法?Java StandaloneInMemProcessEngineConfiguration.buildProcessEngine怎么用?Java StandaloneInMemProcessEngineConfiguration.buildProcessEngine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration
的用法示例。
在下文中一共展示了StandaloneInMemProcessEngineConfiguration.buildProcessEngine方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration; //导入方法依赖的package包/类
public static void init() throws SQLException {
Bus.register(new OrderCamunda());
// Configure Camunda engine (in this case using in memory H2)
StandaloneInMemProcessEngineConfiguration conf = new StandaloneInMemProcessEngineConfiguration();
conf.setJobExecutorActivate(true);
conf.setHistoryLevel(HistoryLevel.HISTORY_LEVEL_FULL);
conf.setJdbcUsername("sa");
conf.setJdbcPassword("sa");
camunda = conf.buildProcessEngine();
// and start H2 database server to allow inspection from the outside
Server.createTcpServer(new String[] { "-tcpPort", "8092", "-tcpAllowOthers" }).start();
// Define flow
BpmnModelInstance flow = extendedFlowOfActivities();
// Deploy finished flow to Camunda
camunda.getRepositoryService().createDeployment() //
.addModelInstance("order.bpmn", flow) //
.deploy();
// Only for demo: write flow to file, so we can open it in modeler
Bpmn.writeModelToFile(new File("order.bpmn"), flow);
}
示例2: main
import org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration; //导入方法依赖的package包/类
public static void main(String[] args) {
// start process engine
StandaloneInMemProcessEngineConfiguration processEngineConfiguration = new StandaloneInMemProcessEngineConfiguration();
processEngineConfiguration.setProcessEngineName(ProcessEngines.NAME_DEFAULT);
// add plugins
List<ProcessEnginePlugin> processEnginePlugins = processEngineConfiguration.getProcessEnginePlugins();
processEnginePlugins.add(new DebuggerPlugin());
processEnginePlugins.add(new SpinProcessEnginePlugin());
processEnginePlugins.add(new ConnectProcessEnginePlugin());
processEngineConfiguration.buildProcessEngine();
DebugSessionFactory.getInstance().setSuspend(false);
// start debug server
DebugWebsocket debugWebsocket = null;
try {
// configure & start the server
debugWebsocket = new DebugWebsocketConfiguration()
.port(9090)
.startServer();
// block
debugWebsocket.waitForShutdown();
} finally {
if(debugWebsocket != null) {
debugWebsocket.shutdown();
}
}
}
示例3: createProcessEngineImpl
import org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration; //导入方法依赖的package包/类
protected static ProcessEngineImpl createProcessEngineImpl(boolean dmnEnabled) {
StandaloneInMemProcessEngineConfiguration config =
(StandaloneInMemProcessEngineConfiguration) new CustomStandaloneInMemProcessEngineConfiguration()
.setProcessEngineName("database-dmn-test-engine")
.setDatabaseSchemaUpdate("false")
.setHistory(ProcessEngineConfiguration.HISTORY_FULL)
.setJdbcUrl("jdbc:h2:mem:DatabaseDmnTest");
config.setDmnEnabled(dmnEnabled);
return (ProcessEngineImpl) config.buildProcessEngine();
}
示例4: testCreateConfigurationWithMismatchtingSchemaAndPrefix
import org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration; //导入方法依赖的package包/类
public void testCreateConfigurationWithMismatchtingSchemaAndPrefix() {
try {
StandaloneInMemProcessEngineConfiguration configuration = new StandaloneInMemProcessEngineConfiguration();
configuration.setDatabaseSchema("foo");
configuration.setDatabaseTablePrefix("bar");
configuration.buildProcessEngine();
fail("Should throw exception");
} catch (ProcessEngineException e) {
// as expected
assertTrue(e.getMessage().contains("When setting a schema the prefix has to be schema + '.'"));
}
}
示例5: testCreateConfigurationWithMissingDotInSchemaAndPrefix
import org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration; //导入方法依赖的package包/类
public void testCreateConfigurationWithMissingDotInSchemaAndPrefix() {
try {
StandaloneInMemProcessEngineConfiguration configuration = new StandaloneInMemProcessEngineConfiguration();
configuration.setDatabaseSchema("foo");
configuration.setDatabaseTablePrefix("foo");
configuration.buildProcessEngine();
fail("Should throw exception");
} catch (ProcessEngineException e) {
// as expected
assertTrue(e.getMessage().contains("When setting a schema the prefix has to be schema + '.'"));
}
}
示例6: startUpEngineAndInit
import org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration; //导入方法依赖的package包/类
public static ProcessEngine startUpEngineAndInit() {
Server h2Server = null;
StandaloneInMemProcessEngineConfiguration config = new StandaloneInMemProcessEngineConfiguration();
config.setHistoryLevel(HistoryLevel.HISTORY_LEVEL_FULL);
config.setJdbcUsername("sa");
config.setJdbcPassword("sa");
// if the DB was already started (by another engine in another Microservice)
// connect to this DB instead of starting an own one
if (isH2DbAlreadyRunning()) {
config.setJdbcUrl(h2DbJdbcUrl);
config.setDatabaseSchemaUpdate("false");
} else {
// use in memory DB, but expose as server
config.setJdbcUrl(h2DbServerJdbcUrl);
h2Server = startH2Server();
}
ProcessEngine engine = config.buildProcessEngine();
// create Demo users and add enterprise license (if existent in file
// ~/.camunda/build.properties)
LicenseHelper.setLicense(engine);
UserGenerator.createDefaultUsers(engine);
final Server h2 = h2Server;
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
try {
engine.close();
if (h2!=null) {
h2.stop();
}
} catch (Exception e) {
throw new RuntimeException("Could not disconnect: " + e.getMessage(), e);
}
}
});
return engine;
}
示例7: createProcessEngine
import org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration; //导入方法依赖的package包/类
private ProcessEngine createProcessEngine(String name) {
StandaloneInMemProcessEngineConfiguration processEngineConfiguration = new StandaloneInMemProcessEngineConfiguration();
processEngineConfiguration.setProcessEngineName(name);
processEngineConfiguration.setJdbcUrl(String.format("jdbc:h2:mem:%s", name));
return processEngineConfiguration.buildProcessEngine();
}