本文整理汇总了Java中org.activiti.engine.ManagementService类的典型用法代码示例。如果您正苦于以下问题:Java ManagementService类的具体用法?Java ManagementService怎么用?Java ManagementService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ManagementService类属于org.activiti.engine包,在下文中一共展示了ManagementService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEngineServices
import org.activiti.engine.ManagementService; //导入依赖的package包/类
@Override
public EngineServices getEngineServices() {
if (this.engineServicesMock != null) {
return this.engineServicesMock;
}
this.engineServicesMock = mock(EngineServices.class);
when(engineServicesMock.getFormService()).thenReturn(mock(FormService.class));
when(engineServicesMock.getHistoryService()).thenReturn(mock(HistoryService.class));
when(engineServicesMock.getIdentityService()).thenReturn(mock(IdentityService.class));
when(engineServicesMock.getManagementService()).thenReturn(mock(ManagementService.class));
when(engineServicesMock.getRepositoryService()).thenReturn(mock(RepositoryService.class));
when(engineServicesMock.getRuntimeService()).thenReturn(mock(RuntimeService.class));
when(engineServicesMock.getTaskService()).thenReturn(mock(TaskService.class));
return engineServicesMock;
}
示例2: main
import org.activiti.engine.ManagementService; //导入依赖的package包/类
public static void main(String[] args) {
AnnotationConfigApplicationContext ctx =
new AnnotationConfigApplicationContext();
ctx.register(SpringAnnotationConfiguration.class);
ctx.refresh();
assertNotNull(ctx.getBean(ProcessEngine.class));
assertNotNull(ctx.getBean(RuntimeService.class));
TaskService bean = ctx.getBean(TaskService.class);
assertNotNull(bean);
assertNotNull(ctx.getBean(HistoryService.class));
assertNotNull(ctx.getBean(RepositoryService.class));
assertNotNull(ctx.getBean(ManagementService.class));
assertNotNull(ctx.getBean(FormService.class));
Task task = bean.newTask();
task.setName("哈哈");
bean.saveTask(task);
}
示例3: main
import org.activiti.engine.ManagementService; //导入依赖的package包/类
public static void main(String[] args) {
// 创建流程引擎
ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();
// 得到流程存储服务组件
RepositoryService repositoryService = engine.getRepositoryService();
// 得到运行时服务组件
RuntimeService runtimeService = engine.getRuntimeService();
// 得到任务服务组件
TaskService taskService = engine.getTaskService();
// 得到管理服务组件
ManagementService managementService = engine.getManagementService();
// 部署流程文件
repositoryService.createDeployment()
.addClasspathResource("bpmn/SignalThrowingEvent.bpmn").deploy();
// 启动流程
runtimeService.startProcessInstanceByKey("stProcess");
// 完成选择商品任务
Task firstTask = taskService.createTaskQuery().singleResult();
taskService.complete(firstTask.getId());
// 完成用户支付任务
Task payTask = taskService.createTaskQuery().singleResult();
taskService.complete(payTask.getId());
// 由于使用了异步的中间Throwing事件,因此会产生2条工作数据
List<Job> jobs = managementService.createJobQuery().list();
System.out.println(jobs.size());
}
示例4: getManagementService
import org.activiti.engine.ManagementService; //导入依赖的package包/类
public ManagementService getManagementService() {
if (processEngine == null) {
return null;
}
return processEngine.getManagementService();
}
示例5: findJobs
import org.activiti.engine.ManagementService; //导入依赖的package包/类
/**
* 作业.
*/
public Page findJobs(String tenantId, Page page) {
ManagementService managementService = processEngine
.getManagementService();
long count = managementService.createJobQuery().jobTenantId(tenantId)
.count();
List<Job> jobs = managementService.createJobQuery()
.jobTenantId(tenantId)
.listPage((int) page.getStart(), page.getPageSize());
page.setResult(jobs);
page.setTotalCount(count);
return page;
}
示例6: execute
import org.activiti.engine.ManagementService; //导入依赖的package包/类
@Override
public void execute(DelegateExecution execution) throws Exception {
ManagementService managementService = execution.getEngineServices().getManagementService();
Job job = managementService.createJobQuery().processInstanceId(execution.getProcessInstanceId()).singleResult();
if (job.getRetries() > 0) {
throw new RuntimeException("本次作业执行失败,再次执行可以成功!");
}
}
示例7: getManagementService
import org.activiti.engine.ManagementService; //导入依赖的package包/类
public ManagementService getManagementService() {
return managementService;
}
示例8: configure
import org.activiti.engine.ManagementService; //导入依赖的package包/类
@Override
protected void configure() {
bind(ProcessEngine.class).toProvider(ProcessEngineProvider.class).in(Singleton.class);
bind(FormService.class).toProvider(FormServiceProvider.class).in(Singleton.class);
bind(HistoryService.class).toProvider(HistoryServiceProvider.class).in(Singleton.class);
bind(IdentityService.class).toProvider(IdentityServiceProvider.class).in(Singleton.class);
bind(ManagementService.class).toProvider(ManagementServiceProvider.class).in(Singleton.class);
bind(RepositoryService.class).toProvider(RepositoryServiceProvider.class).in(Singleton.class);
bind(RuntimeService.class).toProvider(RuntimeServiceProvider.class).in(Singleton.class);
bind(TaskService.class).toProvider(TaskServiceProvider.class).in(Singleton.class);
}
示例9: getManagementService
import org.activiti.engine.ManagementService; //导入依赖的package包/类
/**
* @return ManagementService
*/
public ManagementService getManagementService()
{
return managementService;
}
示例10: CustomTaskQuery
import org.activiti.engine.ManagementService; //导入依赖的package包/类
public CustomTaskQuery(ManagementService managementService) {
super(managementService);
}
示例11: AttachmentQuery
import org.activiti.engine.ManagementService; //导入依赖的package包/类
public AttachmentQuery(ManagementService managementService) {
super(managementService);
}
示例12: getManagementService
import org.activiti.engine.ManagementService; //导入依赖的package包/类
@Override
public ManagementService getManagementService() {
return managementService;
}
示例13: setManagementService
import org.activiti.engine.ManagementService; //导入依赖的package包/类
public ProcessEngineConfigurationImpl setManagementService(ManagementService managementService) {
this.managementService = managementService;
return this;
}
示例14: AbstractQuery
import org.activiti.engine.ManagementService; //导入依赖的package包/类
public AbstractQuery(ManagementService managementService) {
this(((ManagementServiceImpl) managementService).getCommandExecutor());
}
示例15: activitiManagementService
import org.activiti.engine.ManagementService; //导入依赖的package包/类
@Bean
public ManagementService activitiManagementService(ProcessEngine activitiProcessEngine) throws Exception
{
return activitiProcessEngine.getManagementService();
}