本文整理汇总了Java中org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer类的典型用法代码示例。如果您正苦于以下问题:Java BpmnDeployer类的具体用法?Java BpmnDeployer怎么用?Java BpmnDeployer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BpmnDeployer类属于org.camunda.bpm.engine.impl.bpmn.deployer包,在下文中一共展示了BpmnDeployer类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findResources
import org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer; //导入依赖的package包/类
@Override
public Map<String, byte[]> findResources(ClassLoader classLoader, String paResourceRootPath, URL metaFileUrl, String[] additionalResourceSuffixes) {
final Map<String, byte[]> resourceMap = new HashMap<String, byte[]>();
List<String> suffixes = Arrays.asList(BpmnDeployer.BPMN_RESOURCE_SUFFIXES);
if (additionalResourceSuffixes != null) {
suffixes.addAll(Arrays.asList(additionalResourceSuffixes));
}
if (paResourceRootPath != null && !paResourceRootPath.startsWith("pa:")) {
// 1. CASE: paResourceRootPath specified AND it is a "classpath:" resource
// root
String strippedPath = paResourceRootPath.replace("classpath:", "");
scanPathInBundle(suffixes, resourceMap, strippedPath);
} else if (paResourceRootPath == null) {
// 3. CASE: paResourceRootPath not specified
scanPathInBundle(suffixes, resourceMap, "/");
} else {
// 2nd. CASE: paResourceRootPath is PA-local
//FIXME fix this by using BundleWiring.listResources() when moving to OSGi 4.3
throw new ProcessEngineException("PA-loca resourceRootPaths are not supported in an OSGi-environment");
}
return resourceMap;
}
示例2: getDefaultDeployers
import org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer; //导入依赖的package包/类
protected Collection<? extends Deployer> getDefaultDeployers() {
List<Deployer> defaultDeployers = new ArrayList<Deployer>();
BpmnDeployer bpmnDeployer = getBpmnDeployer();
defaultDeployers.add(bpmnDeployer);
if (isCmmnEnabled()) {
CmmnDeployer cmmnDeployer = getCmmnDeployer();
defaultDeployers.add(cmmnDeployer);
}
if (isDmnEnabled()) {
DecisionRequirementsDefinitionDeployer decisionRequirementsDefinitionDeployer = getDecisionRequirementsDefinitionDeployer();
DecisionDefinitionDeployer decisionDefinitionDeployer = getDecisionDefinitionDeployer();
// the DecisionRequirementsDefinition cacheDeployer must be before the DecisionDefinitionDeployer
defaultDeployers.add(decisionRequirementsDefinitionDeployer);
defaultDeployers.add(decisionDefinitionDeployer);
}
return defaultDeployers;
}
示例3: getBpmnDeployer
import org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer; //导入依赖的package包/类
protected BpmnDeployer getBpmnDeployer() {
BpmnDeployer bpmnDeployer = new BpmnDeployer();
bpmnDeployer.setExpressionManager(expressionManager);
bpmnDeployer.setIdGenerator(idGenerator);
if (bpmnParseFactory == null) {
bpmnParseFactory = new DefaultBpmnParseFactory();
}
BpmnParser bpmnParser = new BpmnParser(expressionManager, bpmnParseFactory);
if (preParseListeners != null) {
bpmnParser.getParseListeners().addAll(preParseListeners);
}
bpmnParser.getParseListeners().addAll(getDefaultBPMNParseListeners());
if (postParseListeners != null) {
bpmnParser.getParseListeners().addAll(postParseListeners);
}
bpmnDeployer.setBpmnParser(bpmnParser);
return bpmnDeployer;
}
示例4: addSubscriptionsFromPreviousVersion
import org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer; //导入依赖的package包/类
protected void addSubscriptionsFromPreviousVersion(ProcessDefinitionEntity processDefinition) {
//we don't want to take the process definition from deployment cache, as it can have inconsistent value in "deleted" flag
//instead we take it from DbEntityCache (or the database)
String previousProcessDefinitionId = processDefinition.getPreviousProcessDefinitionId();
if (previousProcessDefinitionId != null) {
ProcessDefinitionEntity previousDefinition = findLatestProcessDefinitionById(previousProcessDefinitionId);
//if not deleted, than add event subscriptions
if (previousDefinition != null && !previousDefinition.isDeleted()) {
ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
DeploymentCache deploymentCache = configuration.getDeploymentCache();
previousDefinition = deploymentCache.resolveProcessDefinition(previousDefinition);
List<Deployer> deployers = configuration.getDeployers();
for (Deployer deployer : deployers) {
if (deployer instanceof BpmnDeployer) {
((BpmnDeployer) deployer).addEventSubscriptions(previousDefinition);
}
}
}
}
}
示例5: getBpmnProcessDefinitionResource
import org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer; //导入依赖的package包/类
/**
* get a resource location by convention based on a class (type) and a
* relative resource name. The return value will be the full classpath
* location of the type, plus a suffix built from the name parameter:
* <code>BpmnDeployer.BPMN_RESOURCE_SUFFIXES</code>.
* The first resource matching a suffix will be returned.
*/
public static String getBpmnProcessDefinitionResource(Class< ? > type, String name) {
for (String suffix : RESOURCE_SUFFIXES) {
String resource = createResourceName(type, name, suffix);
InputStream inputStream = ReflectUtil.getResourceAsStream(resource);
if (inputStream == null) {
continue;
} else {
return resource;
}
}
return createResourceName(type, name, BpmnDeployer.BPMN_RESOURCE_SUFFIXES[0]);
}
示例6: isDiagram
import org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer; //导入依赖的package包/类
public static boolean isDiagram(String fileName, String modelFileName) {
// process resources
boolean isBpmnDiagram = checkDiagram(fileName, modelFileName, BpmnDeployer.DIAGRAM_SUFFIXES, BpmnDeployer.BPMN_RESOURCE_SUFFIXES);
// case resources
boolean isCmmnDiagram = checkDiagram(fileName, modelFileName, CmmnDeployer.DIAGRAM_SUFFIXES, CmmnDeployer.CMMN_RESOURCE_SUFFIXES);
// decision resources
boolean isDmnDiagram = checkDiagram(fileName, modelFileName, DecisionDefinitionDeployer.DIAGRAM_SUFFIXES, DecisionDefinitionDeployer.DMN_RESOURCE_SUFFIXES);
return isBpmnDiagram || isCmmnDiagram || isDmnDiagram;
}
示例7: isBpmnResource
import org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer; //导入依赖的package包/类
protected boolean isBpmnResource(ResourceEntity resourceEntity) {
return StringUtil.hasAnySuffix(resourceEntity.getName(), BpmnDeployer.BPMN_RESOURCE_SUFFIXES);
}
示例8: isDeployable
import org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer; //导入依赖的package包/类
public static boolean isDeployable(String filename) {
return hasSuffix(filename, BpmnDeployer.BPMN_RESOURCE_SUFFIXES)
|| hasSuffix(filename, CmmnDeployer.CMMN_RESOURCE_SUFFIXES)
|| hasSuffix(filename, DecisionDefinitionDeployer.DMN_RESOURCE_SUFFIXES);
}
示例9: deployProcessString
import org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer; //导入依赖的package包/类
private String deployProcessString(String processString) {
String resourceName = "xmlString." + BpmnDeployer.BPMN_RESOURCE_SUFFIXES[0];
return repositoryService.createDeployment().addString(resourceName, processString).deploy().getId();
}
示例10: addModelInstance
import org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer; //导入依赖的package包/类
public DeploymentBuilder addModelInstance(String resourceName, BpmnModelInstance modelInstance) {
ensureNotNull("modelInstance", modelInstance);
validateResouceName(resourceName, BpmnDeployer.BPMN_RESOURCE_SUFFIXES);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Bpmn.writeModelToStream(outputStream, modelInstance);
return addBytes(resourceName, outputStream.toByteArray());
}