本文整理了Java中org.activiti.engine.runtime.Job.getProcessDefinitionId()
方法的一些代码示例,展示了Job.getProcessDefinitionId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.getProcessDefinitionId()
方法的具体详情如下:
包路径:org.activiti.engine.runtime.Job
类名称:Job
方法名:getProcessDefinitionId
[英]Returns the specific process definition on which the job was created
[中]返回创建作业的特定进程定义
代码示例来源:origin: Activiti/Activiti
event.setExecutionId(((Job) persistedObject).getExecutionId());
event.setProcessInstanceId(((Job) persistedObject).getProcessInstanceId());
event.setProcessDefinitionId(((Job) persistedObject).getProcessDefinitionId());
} else if (persistedObject instanceof DelegateExecution) {
event.setExecutionId(((DelegateExecution) persistedObject).getId());
代码示例来源:origin: org.activiti/activiti-explorer
public void buttonClick(ClickEvent event) {
if (isSuspendedProcessDefinition) {
ExplorerApp.get().getViewManager().showSuspendedProcessDefinitionsPage(job.getProcessDefinitionId());
} else {
ExplorerApp.get().getViewManager().showActiveProcessDefinitionsPage(job.getProcessDefinitionId());
}
}
});
代码示例来源:origin: org.activiti/activiti-engine
protected boolean isHandledByActiviti5Engine() {
boolean isActiviti5ProcessDefinition = Activiti5Util.isActiviti5ProcessDefinitionId(processEngineConfiguration, job.getProcessDefinitionId());
if (isActiviti5ProcessDefinition) {
return processEngineConfiguration.getCommandExecutor().execute(new Command<Boolean>() {
@Override
public Boolean execute(CommandContext commandContext) {
commandContext.getProcessEngineConfiguration().getActiviti5CompatibilityHandler().executeJobWithLockAndRetry(job);
return true;
}
});
}
return false;
}
代码示例来源:origin: org.activiti/activiti-engine
@Override
public Void execute(CommandContext commandContext) {
if (job.getProcessDefinitionId() != null && Activiti5Util.isActiviti5ProcessDefinitionId(commandContext, job.getProcessDefinitionId())) {
Activiti5CompatibilityHandler activiti5CompatibilityHandler = Activiti5Util.getActiviti5CompatibilityHandler();
activiti5CompatibilityHandler.handleFailedJob(job, exception);
return null;
}
CommandConfig commandConfig = processEngineConfiguration.getCommandExecutor().getDefaultConfig().transactionRequiresNew();
FailedJobCommandFactory failedJobCommandFactory = commandContext.getFailedJobCommandFactory();
Command<Object> cmd = failedJobCommandFactory.getCommand(job.getId(), exception);
log.trace("Using FailedJobCommandFactory '" + failedJobCommandFactory.getClass() + "' and command of type '" + cmd.getClass() + "'");
processEngineConfiguration.getCommandExecutor().execute(commandConfig, cmd);
// Dispatch an event, indicating job execution failed in a
// try-catch block, to prevent the original exception to be swallowed
if (commandContext.getEventDispatcher().isEnabled()) {
try {
commandContext.getEventDispatcher().dispatchEvent(ActivitiEventBuilder.createEntityExceptionEvent(ActivitiEventType.JOB_EXECUTION_FAILURE, job, exception));
} catch (Throwable ignore) {
log.warn("Exception occurred while dispatching job failure event, ignoring.", ignore);
}
}
return null;
}
代码示例来源:origin: org.activiti/activiti-engine
public Object execute(CommandContext commandContext) {
if (jobId == null) {
throw new ActivitiIllegalArgumentException("jobId and job is null");
}
Job job = commandContext.getJobEntityManager().findById(jobId);
if (job == null) {
throw new JobNotFoundException(jobId);
}
if (log.isDebugEnabled()) {
log.debug("Executing job {}", job.getId());
}
if (job.getProcessDefinitionId() != null && Activiti5Util.isActiviti5ProcessDefinitionId(commandContext, job.getProcessDefinitionId())) {
Activiti5CompatibilityHandler activiti5CompatibilityHandler = Activiti5Util.getActiviti5CompatibilityHandler();
activiti5CompatibilityHandler.executeJob(job);
return null;
}
commandContext.addCloseListener(new FailedJobListener(commandContext.getProcessEngineConfiguration().getCommandExecutor(), job));
try {
commandContext.getJobManager().execute(job);
} catch (Throwable exception) {
// Finally, Throw the exception to indicate the ExecuteJobCmd failed
throw new ActivitiException("Job " + jobId + " failed", exception);
}
return null;
}
代码示例来源:origin: org.activiti/activiti-rest
public JobResponse createJobResponse(Job job, RestUrlBuilder urlBuilder) {
JobResponse response = new JobResponse();
response.setId(job.getId());
response.setDueDate(job.getDuedate());
response.setExceptionMessage(job.getExceptionMessage());
response.setExecutionId(job.getExecutionId());
response.setProcessDefinitionId(job.getProcessDefinitionId());
response.setProcessInstanceId(job.getProcessInstanceId());
response.setRetries(job.getRetries());
response.setTenantId(job.getTenantId());
response.setUrl(urlBuilder.buildUrl(RestUrls.URL_JOB, job.getId()));
if (job.getProcessDefinitionId() != null) {
response.setProcessDefinitionUrl(urlBuilder.buildUrl(RestUrls.URL_PROCESS_DEFINITION, job.getProcessDefinitionId()));
}
if (job.getProcessInstanceId() != null) {
response.setProcessInstanceUrl(urlBuilder.buildUrl(RestUrls.URL_PROCESS_INSTANCE, job.getProcessInstanceId()));
}
if (job.getExecutionId() != null) {
response.setExecutionUrl(urlBuilder.buildUrl(RestUrls.URL_EXECUTION, job.getExecutionId()));
}
return response;
}
代码示例来源:origin: org.activiti/activiti-explorer
protected void addLinkToProcessDefinition(final VerticalLayout verticalLayout, final String labelText, final boolean isSuspendedProcessDefinition) {
HorizontalLayout layout = new HorizontalLayout();
verticalLayout.addComponent(layout);
Label processDefinitionLabel = new Label(labelText);
processDefinitionLabel.setSizeUndefined();
layout.addComponent(processDefinitionLabel);
layout.addComponent(new Label(" ", Label.CONTENT_XHTML));
Button showProcessDefinitionLink = new Button(job.getProcessDefinitionId());
showProcessDefinitionLink.addStyleName(Reindeer.BUTTON_LINK);
showProcessDefinitionLink.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
if (isSuspendedProcessDefinition) {
ExplorerApp.get().getViewManager().showSuspendedProcessDefinitionsPage(job.getProcessDefinitionId());
} else {
ExplorerApp.get().getViewManager().showActiveProcessDefinitionsPage(job.getProcessDefinitionId());
}
}
});
layout.addComponent(showProcessDefinitionLink);
}
代码示例来源:origin: org.activiti/activiti-explorer
} else {
if (job.getProcessDefinitionId() != null) {
代码示例来源:origin: org.activiti/activiti-engine
event.setExecutionId(((Job) persistedObject).getExecutionId());
event.setProcessInstanceId(((Job) persistedObject).getProcessInstanceId());
event.setProcessDefinitionId(((Job) persistedObject).getProcessDefinitionId());
} else if (persistedObject instanceof DelegateExecution) {
event.setExecutionId(((DelegateExecution) persistedObject).getId());
内容来源于网络,如有侵权,请联系作者删除!