本文整理汇总了Java中org.camunda.bpm.engine.repository.DeploymentBuilder.addInputStream方法的典型用法代码示例。如果您正苦于以下问题:Java DeploymentBuilder.addInputStream方法的具体用法?Java DeploymentBuilder.addInputStream怎么用?Java DeploymentBuilder.addInputStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.repository.DeploymentBuilder
的用法示例。
在下文中一共展示了DeploymentBuilder.addInputStream方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deployTweakedModels
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入方法依赖的package包/类
public String deployTweakedModels() {
LOG.info("Starting deployment of tweaked models for demo data generation");
try {
DeploymentBuilder deploymentBuilder = engine.getRepositoryService().createDeployment();
for (Entry<String, String> model : tweakedModels.entrySet()) {
deploymentBuilder.addInputStream(model.getKey(), new ByteArrayInputStream(model.getValue().getBytes("UTF-8")));
}
Deployment deployment = deploymentBuilder.deploy();
if (simulatingProcessApplication != null) {
engine.getManagementService().registerProcessApplication(deployment.getId(), simulatingProcessApplication);
}
LOG.info("Deployed tweaked modes for demo data generation with deployment " + deployment.getId());
return deployment.getId();
} catch (Exception ex) {
throw new RuntimeException("Could not deploy tweaked process definition", ex);
}
}
开发者ID:camunda-consulting,项目名称:camunda-util-demo-data-generator,代码行数:18,代码来源:DemoModelInstrumentator.java
示例2: restoreOriginalModels
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入方法依赖的package包/类
public void restoreOriginalModels() {
LOG.info("Starting to restore models after demo data generation");
try {
DeploymentBuilder deploymentBuilder = engine.getRepositoryService().createDeployment();
for (Entry<String, String> model : originalModels.entrySet()) {
deploymentBuilder.addInputStream(model.getKey(), new ByteArrayInputStream(model.getValue().getBytes("UTF-8")));
}
Deployment deployment = deploymentBuilder.deploy();
if (originalProcessApplication != null) {
engine.getManagementService().registerProcessApplication(deployment.getId(), originalProcessApplication);
}
LOG.info("Restored original modes after demo data generation with deployment " + deployment.getId());
} catch (Exception ex) {
throw new RuntimeException("Could not restore original models", ex);
}
}
开发者ID:camunda-consulting,项目名称:camunda-util-demo-data-generator,代码行数:17,代码来源:DemoModelInstrumentator.java
示例3: deployProcessDefinitions
import org.camunda.bpm.engine.repository.DeploymentBuilder; //导入方法依赖的package包/类
@Override
public void deployProcessDefinitions(String bundleSymbolicName, List<URL> pathList) {
try {
LOGGER.log(Level.FINE,
"Found process in bundle " + bundleSymbolicName
+ " with paths: " + pathList);
if (engine == null) {
throw new IllegalStateException(
"Unable to find a ProcessEngine service");
}
RepositoryService service = engine.getRepositoryService();
DeploymentBuilder builder = service.createDeployment();
builder.name(bundleSymbolicName);
for (URL url : pathList) {
InputStream is = url.openStream();
if (is == null) {
throw new IOException("Error opening url: " + url);
}
try {
builder.addInputStream(getPath(url), is);
} finally {
is.close();
}
}
builder.enableDuplicateFiltering(true);
builder.deploy();
} catch (Exception e) {
LOGGER.log(Level.SEVERE, "Unable to deploy bundle", e);
}
}