本文整理汇总了Java中org.camunda.bpm.engine.repository.ProcessDefinition.getKey方法的典型用法代码示例。如果您正苦于以下问题:Java ProcessDefinition.getKey方法的具体用法?Java ProcessDefinition.getKey怎么用?Java ProcessDefinition.getKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.repository.ProcessDefinition
的用法示例。
在下文中一共展示了ProcessDefinition.getKey方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: notify
import org.camunda.bpm.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
@Override
public void notify(DelegateExecution execution) throws Exception {
if (coverageTestRunState == null) {
logger.warning("Coverage execution listener in use but no coverage run state assigned!");
return;
}
final RepositoryService repositoryService = execution.getProcessEngineServices().getRepositoryService();
// Get the process definition in order to obtain the key
final ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(
execution.getProcessDefinitionId()).singleResult();
final String transitionId = execution.getCurrentTransitionId();
// Record sequence flow coverage
final CoveredSequenceFlow coveredSequenceFlow = new CoveredSequenceFlow(processDefinition.getKey(),
transitionId);
coverageTestRunState.addCoveredElement(coveredSequenceFlow);
// Record possible event coverage
handleEvent(transitionId, processDefinition, repositoryService);
}
开发者ID:camunda,项目名称:camunda-bpm-process-test-coverage,代码行数:26,代码来源:PathCoverageExecutionListener.java
示例2: printProcessDefinition
import org.camunda.bpm.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
public void printProcessDefinition(String deploymentId) {
String[] header = new String[]{"ID", "KEY", "NAME", "DEPLOYMENT", "CATEGORY"};
List<ProcessDefinition> processes = engine.getRepositoryService().createProcessDefinitionQuery().deploymentId(deploymentId).list();
String[][] data = new String[processes.size()][header.length];
int i = 0;
for (ProcessDefinition process : processes) {
data[i++] = new String[]{
process.getId(),
process.getKey(),
process.getName(),
process.getDeploymentId(),
process.getCategory()
};
}
ASCIITable.getInstance().printTable(header, data);
}
示例3: fromProcessDefinition
import org.camunda.bpm.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
public static ProcessDefinitionDto fromProcessDefinition(ProcessDefinition definition) {
ProcessDefinitionDto dto = new ProcessDefinitionDto();
dto.id = definition.getId();
dto.key = definition.getKey();
dto.category = definition.getCategory();
dto.description = definition.getDescription();
dto.name = definition.getName();
dto.version = definition.getVersion();
dto.resource = definition.getResourceName();
dto.deploymentId = definition.getDeploymentId();
dto.diagram = definition.getDiagramResourceName();
dto.suspended = definition.isSuspended();
dto.tenantId = definition.getTenantId();
dto.versionTag = definition.getVersionTag();
dto.historyTimeToLive = definition.getHistoryTimeToLive();
return dto;
}
示例4: fromProcessDefinition
import org.camunda.bpm.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
public static HalProcessDefinition fromProcessDefinition(ProcessDefinition processDefinition, ProcessEngine processEngine) {
HalProcessDefinition halProcDef = new HalProcessDefinition();
halProcDef.id = processDefinition.getId();
halProcDef.key = processDefinition.getKey();
halProcDef.category = processDefinition.getCategory();
halProcDef.description = processDefinition.getDescription();
halProcDef.name = processDefinition.getName();
halProcDef.version = processDefinition.getVersion();
halProcDef.resource = processDefinition.getResourceName();
halProcDef.deploymentId = processDefinition.getDeploymentId();
halProcDef.diagram = processDefinition.getDiagramResourceName();
halProcDef.suspended = processDefinition.isSuspended();
halProcDef.contextPath = ApplicationContextPathUtil.getApplicationPathForDeployment(processEngine, processDefinition.getDeploymentId());
halProcDef.linker.createLink(REL_SELF, processDefinition.getId());
halProcDef.linker.createLink(REL_DEPLOYMENT, processDefinition.getDeploymentId());
halProcDef.linker.createLink(REL_DEPLOYMENT_RESOURCE, processDefinition.getDeploymentId(), processDefinition.getResourceName());
return halProcDef;
}
示例5: addEventToCoverage
import org.camunda.bpm.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
private void addEventToCoverage(ProcessDefinition processDefinition, FlowNode node) {
if (node instanceof IntermediateThrowEvent) {
final CoveredFlowNode coveredElement = new CoveredFlowNode(processDefinition.getKey(), node.getId());
// We consider entered throw elements as also ended
coveredElement.setEnded(true);
coverageTestRunState.addCoveredElement(coveredElement);
}
}
开发者ID:camunda,项目名称:camunda-bpm-process-test-coverage,代码行数:12,代码来源:PathCoverageExecutionListener.java
示例6: doAuthCheck
import org.camunda.bpm.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
protected void doAuthCheck(CommandContext commandContext) {
// since a report does only make sense in context of historic
// data, the authorization check will be performed here
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
if (processDefinitionIdIn == null && processDefinitionKeyIn == null) {
checker.checkReadHistoryAnyProcessDefinition();
} else {
List<String> processDefinitionKeys = new ArrayList<String>();
if (processDefinitionKeyIn != null) {
processDefinitionKeys.addAll(Arrays.asList(processDefinitionKeyIn));
}
if (processDefinitionIdIn != null) {
for (String processDefinitionId : processDefinitionIdIn) {
ProcessDefinition processDefinition = commandContext.getProcessDefinitionManager()
.findLatestProcessDefinitionById(processDefinitionId);
if (processDefinition != null && processDefinition.getKey() != null) {
processDefinitionKeys.add(processDefinition.getKey());
}
}
}
if (!processDefinitionKeys.isEmpty()) {
for (String processDefinitionKey : processDefinitionKeys) {
checker.checkReadHistoryProcessDefinition(processDefinitionKey);
}
}
}
}
}
示例7: addJobDeclarationToProcessDefinition
import org.camunda.bpm.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
protected void addJobDeclarationToProcessDefinition(JobDeclaration<?, ?> jobDeclaration, ProcessDefinition processDefinition) {
String key = processDefinition.getKey();
List<JobDeclaration<?, ?>> containingJobDeclarations = jobDeclarations.get(key);
if (containingJobDeclarations == null) {
containingJobDeclarations = new ArrayList<JobDeclaration<?, ?>>();
jobDeclarations.put(key, containingJobDeclarations);
}
containingJobDeclarations.add(jobDeclaration);
}
示例8: createCoveredFlowNode
import org.camunda.bpm.engine.repository.ProcessDefinition; //导入方法依赖的package包/类
private CoveredFlowNode createCoveredFlowNode(DelegateExecution execution) {
// Get the process definition in order to obtain the key
final RepositoryService repositoryService = execution.getProcessEngineServices().getRepositoryService();
final ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(
execution.getProcessDefinitionId()).singleResult();
final String currentActivityId = execution.getCurrentActivityId();
final CoveredFlowNode coveredFlowNode = new CoveredFlowNode(processDefinition.getKey(), currentActivityId);
return coveredFlowNode;
}
开发者ID:camunda,项目名称:camunda-bpm-process-test-coverage,代码行数:14,代码来源:IntermediateEventExecutionListener.java