当前位置: 首页>>代码示例>>Java>>正文


Java ProcessEngine.getRepositoryService方法代码示例

本文整理汇总了Java中org.activiti.engine.ProcessEngine.getRepositoryService方法的典型用法代码示例。如果您正苦于以下问题:Java ProcessEngine.getRepositoryService方法的具体用法?Java ProcessEngine.getRepositoryService怎么用?Java ProcessEngine.getRepositoryService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.activiti.engine.ProcessEngine的用法示例。


在下文中一共展示了ProcessEngine.getRepositoryService方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getImage

import org.activiti.engine.ProcessEngine; //导入方法依赖的package包/类
@Test
public void getImage() throws IOException {
    ProcessEngine processEngine = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti.cfg.xml").buildProcessEngine();
    logger.info("### ============= 创建Activiti流程引擎实例, {}", processEngine);

    RepositoryService repositoryService = processEngine.getRepositoryService();

    //通过流程ID(XML上写的)找到流程
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
            .processDefinitionId("请假流程:2:10004")
            .singleResult();
    String diagramResourceName = processDefinition.getDiagramResourceName();
    logger.info(diagramResourceName);
    InputStream imageStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), diagramResourceName);

    FileUtils.writeByteArrayToFile(new File("F:\\123456.png"),IOUtils.toByteArray(imageStream));
    imageStream.close();

    processEngine.close();
}
 
开发者ID:Lzw2016,项目名称:study,代码行数:21,代码来源:Test01.java

示例2: testStartProcess

import org.activiti.engine.ProcessEngine; //导入方法依赖的package包/类
@Test
public void testStartProcess() throws Exception {
    // 创建流程引擎,使用内存数据库
    ProcessEngine processEngine = ProcessEngineConfiguration
            .createStandaloneInMemProcessEngineConfiguration()
            .buildProcessEngine();

    // 部署流程定义文件
    RepositoryService repositoryService = processEngine.getRepositoryService();
    String processFileName = "me/kafeitu/activiti/helloworld/sayhelloleave.bpmn";
    repositoryService.createDeployment().addClasspathResource(processFileName)
            .deploy();

    // 验证已部署流程定义
    ProcessDefinition processDefinition = repositoryService
            .createProcessDefinitionQuery().singleResult();
    assertEquals("leavesayhello", processDefinition.getKey());

    // 启动流程并返回流程实例
    RuntimeService runtimeService = processEngine.getRuntimeService();
    ProcessInstance processInstance = runtimeService
            .startProcessInstanceByKey("leavesayhello");
    assertNotNull(processInstance);
    System.out.println("pid=" + processInstance.getId() + ", pdid="
            + processInstance.getProcessDefinitionId());
}
 
开发者ID:shawn-gogh,项目名称:myjavacode,代码行数:27,代码来源:VerySimpleLeaveProcessTest.java

示例3: main

import org.activiti.engine.ProcessEngine; //导入方法依赖的package包/类
public static void main(String[] args) {
	// 创建流程引擎
	ProcessEngine engine = ProcessEngines
			.getDefaultProcessEngine();
	// 得到流程存储服务组件
	RepositoryService repositoryService = engine.getRepositoryService();
	// 得到运行时服务组件
	RuntimeService runtimeService = engine.getRuntimeService();
	// 部署流程文件
	repositoryService.createDeployment()
			.addClasspathResource("com/roger/activiti/workflow/CompensationBoundaryEvent.bpmn").deploy();
	// 初始化参数
	Map<String, Object> vars = new HashMap<String, Object>();
	vars.put("result", false);
	runtimeService.startProcessInstanceByKey("cbProcess", vars);
}
 
开发者ID:yudar1024,项目名称:spring4-springmvc4-mybatis3-activiti,代码行数:17,代码来源:CompensationBoundaryEvent.java

示例4: main

import org.activiti.engine.ProcessEngine; //导入方法依赖的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());
}
 
开发者ID:yudar1024,项目名称:spring4-springmvc4-mybatis3-activiti,代码行数:27,代码来源:SignalThrowingEvent.java

示例5: main

import org.activiti.engine.ProcessEngine; //导入方法依赖的package包/类
public static void main(String[] args) {
	// 创建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();
	// 得到流程存储服务组件
	RepositoryService repositoryService = engine.getRepositoryService();
	// 得到运行时服务组件
	RuntimeService runtimeService = engine.getRuntimeService();
	TaskService taskService = engine.getTaskService();
	// 部署流程文件
	repositoryService.createDeployment()
			.addClasspathResource("bpmn/MessageCatchingEvent.bpmn").deploy();
	// 启动流程
	ProcessInstance pi = runtimeService.startProcessInstanceByKey("mcProcess");
	Execution exe = runtimeService.createExecutionQuery().activityId("messageintermediatecatchevent1").singleResult();
	runtimeService.messageEventReceived("myMsg", exe.getId());
	// 输出当前的任务
	List<Task> tasks = taskService.createTaskQuery().list();
	for (Task task : tasks) {
		System.out.println(task.getName());
	}
}
 
开发者ID:yudar1024,项目名称:spring4-springmvc4-mybatis3-activiti,代码行数:22,代码来源:MessageCatchingEvent.java

示例6: main

import org.activiti.engine.ProcessEngine; //导入方法依赖的package包/类
public static void main(String[] args) {
	// 创建流程引擎
	ProcessEngine engine = ProcessEngines
			.getDefaultProcessEngine();
	// 得到流程存储服务组件
	RepositoryService repositoryService = engine.getRepositoryService();
	// 得到运行时服务组件
	RuntimeService runtimeService = engine.getRuntimeService();
	// 获取流程任务组件
	TaskService taskService = engine.getTaskService();
	// 部署流程文件
	repositoryService.createDeployment()
			.addClasspathResource("bpmn/ErrorBoundaryEvent.bpmn").deploy();
	// 启动流程
	runtimeService.startProcessInstanceByKey("ebProcess");
	// 进行任务查询
	Task task = taskService.createTaskQuery().singleResult();
	System.out.println(task.getName());
}
 
开发者ID:yudar1024,项目名称:spring4-springmvc4-mybatis3-activiti,代码行数:20,代码来源:ErrorBoundaryEvent.java

示例7: main

import org.activiti.engine.ProcessEngine; //导入方法依赖的package包/类
public static void main(String[] args) {
	// 创建流程引擎
	ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();
	// 得到流程存储服务组件
	RepositoryService repositoryService = engine.getRepositoryService();
	// 得到运行时服务组件
	RuntimeService runtimeService = engine.getRuntimeService();
	TaskService taskService = engine.getTaskService();
	// 部署流程文件
	repositoryService.createDeployment()
			.addClasspathResource("bpmn/SignalCatchingEvent.bpmn").deploy();
	// 启动流程
	runtimeService.startProcessInstanceByKey("scProcess");
	Task firstTask = taskService.createTaskQuery().singleResult();
	taskService.complete(firstTask.getId());
	// 此时会出现并行的两个流程分支,查找用户任务并完成
	Task payTask = taskService.createTaskQuery().singleResult();
	// 完成任务
	taskService.complete(payTask.getId());
	// 发送信号完成支付
	runtimeService.signalEventReceived("finishPay");
	Task finishTask = taskService.createTaskQuery().singleResult();
	System.out.println("当前流程任务:" + finishTask.getName());
}
 
开发者ID:yudar1024,项目名称:spring4-springmvc4-mybatis3-activiti,代码行数:25,代码来源:SignalCatchingEvent.java

示例8: main

import org.activiti.engine.ProcessEngine; //导入方法依赖的package包/类
public static void main(String[] args) throws InterruptedException {
// Build process enigne
ProcessEngine processEngine = new StandaloneInMemProcessEngineConfiguration()
								// enable process definition info cache
								 .setEnableProcessDefinitionInfoCache(true)
								 .buildProcessEngine();
   
   RepositoryService repositoryService = processEngine.getRepositoryService();
   RuntimeService runtimeService = processEngine.getRuntimeService();
   
   // deploy process definition
   repositoryService.createDeployment()
     .addClasspathResource("dynamic-service-task.bpmn20.xml")
     .deploy();
   
   // this will invoke OldServiceTask
   ProcessInstance processInstance = 
   		runtimeService.startProcessInstanceByKey("dynamic-service-task");

   String processDefinitionId = processInstance.getProcessDefinitionId();
   
   // change service task class name
   System.out.println("==== changing service task class name ====");
   
   DynamicBpmnService dynamicBpmnService = processEngine.getDynamicBpmnService();
   ObjectNode infoNode = dynamicBpmnService
   					.changeServiceTaskClassName("dynamicServiceTask", 
   							"org.activiti.examples.NewServiceTask");
   
   dynamicBpmnService.saveProcessDefinitionInfo(processDefinitionId, infoNode);
   
   // this will invoke NewServiceTask
   processInstance = runtimeService.startProcessInstanceByKey("dynamic-service-task");
 }
 
开发者ID:balsarori,项目名称:activiti-examples,代码行数:35,代码来源:ChangeServiceClass.java

示例9: main

import org.activiti.engine.ProcessEngine; //导入方法依赖的package包/类
public static void main(String[] args) throws InterruptedException {
// Build process enigne
ProcessEngine processEngine = new StandaloneInMemProcessEngineConfiguration()
								// enable process definition info cache
								 .setEnableProcessDefinitionInfoCache(true)
								 .buildProcessEngine();
   
   RepositoryService repositoryService = processEngine.getRepositoryService();
   RuntimeService runtimeService = processEngine.getRuntimeService();
   
   // deploy process definition
   repositoryService.createDeployment()
     .addClasspathResource("dynamic-script-task.bpmn20.xml")
     .deploy();
   
   String processDefinitionId = repositoryService.createProcessDefinitionQuery()
								.singleResult().getId();
   
   DynamicBpmnService dynamicBpmnService = processEngine.getDynamicBpmnService();
   ObjectNode infoNode = dynamicBpmnService
   					.changeScriptTaskScript("scriptTask", 
   							"java.lang.System.out.println(\"New output\");");
   
   dynamicBpmnService.saveProcessDefinitionInfo(processDefinitionId, infoNode);
   
   // start a process instance
   runtimeService.startProcessInstanceByKey("dynamic-script-task");
   
 }
 
开发者ID:balsarori,项目名称:activiti-examples,代码行数:30,代码来源:ChangeScriptTask.java

示例10: ActivitiUtil

import org.activiti.engine.ProcessEngine; //导入方法依赖的package包/类
public ActivitiUtil(ProcessEngine engine, boolean deployWorkflowsInTenant)
{
    this.repoService = engine.getRepositoryService();
    this.runtimeService = engine.getRuntimeService();
    this.taskService = engine.getTaskService();
    this.historyService = engine.getHistoryService();
    this.formService = engine.getFormService();
    this.managementService = engine.getManagementService();
    this.deployWorkflowsInTenant = deployWorkflowsInTenant;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:11,代码来源:ActivitiUtil.java

示例11: testDeploy

import org.activiti.engine.ProcessEngine; //导入方法依赖的package包/类
public void testDeploy() throws Exception
    {
        ProcessEngine engine = buildProcessEngine();

        RepositoryService repoService = engine.getRepositoryService();

        Deployment deployment = deployDefinition(repoService);

        assertNotNull(deployment);

        RuntimeService runtimeService = engine.getRuntimeService();
        try
        {
            ProcessInstance instance = runtimeService.startProcessInstanceByKey("testTask");
            assertNotNull(instance);
            
            String instanceId = instance.getId();
            ProcessInstance instanceInDb = findProcessInstance(runtimeService, instanceId);
            assertNotNull(instanceInDb);
            runtimeService.deleteProcessInstance(instanceId, "");
        }
        finally
        {
            
//            List<Deployment> deployments = repoService.createDeploymentQuery().list();
//            for (Deployment deployment2 : deployments)
//            {
//                repoService.deleteDeployment(deployment2.getId());
//            }
            
            repoService.deleteDeployment(deployment.getId());
        }
    }
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:34,代码来源:ActivitiSmokeTest.java

示例12: generateTestData

import org.activiti.engine.ProcessEngine; //导入方法依赖的package包/类
@Override
public void generateTestData(ProcessEngine processEngine) {
    RepositoryService repositoryService = processEngine.getRepositoryService();
    repositoryService.createDeployment().addClasspathResource("expressionInJavaDelegateProcess.bpmn20.xml").deploy();

    RuntimeService runtimeService = processEngine.getRuntimeService();
    runtimeService.startProcessInstanceByKey("expressionInJavaDelegate");
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:9,代码来源:ExpressionInJavaDelegateTestDataGenerator.java

示例13: generateTestData

import org.activiti.engine.ProcessEngine; //导入方法依赖的package包/类
@Override
public void generateTestData(ProcessEngine processEngine) {
    RepositoryService repositoryService = processEngine.getRepositoryService();
    repositoryService.createDeployment().addClasspathResource("oneTaskProcess.bpmn20.xml").deploy();

    RuntimeService runtimeService = processEngine.getRuntimeService();
    runtimeService.startProcessInstanceByKey("oneTaskProcess", "activitiv5-one-task-process");
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:9,代码来源:StartProcessInstanceTestDataGenerator.java

示例14: generateTestData

import org.activiti.engine.ProcessEngine; //导入方法依赖的package包/类
@Override
public void generateTestData(ProcessEngine processEngine) {
    RepositoryService repositoryService = processEngine.getRepositoryService();
    repositoryService.createDeployment().addClasspathResource("parseHandlerProcess.bpmn20.xml").deploy();

    RuntimeService runtimeService = processEngine.getRuntimeService();
    runtimeService.startProcessInstanceByKey("parseHandlerTestProcess");
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:9,代码来源:ParseHandlerTestDataGenerator.java

示例15: generateTestData

import org.activiti.engine.ProcessEngine; //导入方法依赖的package包/类
@Override
public void generateTestData(ProcessEngine processEngine) {
    RepositoryService repositoryService = processEngine.getRepositoryService();
    repositoryService.createDeployment().addClasspathResource("javaDelegateProcess.bpmn20.xml").deploy();

    RuntimeService runtimeService = processEngine.getRuntimeService();
    runtimeService.startProcessInstanceByKey("javaDelegateTestProcess");
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:9,代码来源:JavaDelegateTestDataGenerator.java


注:本文中的org.activiti.engine.ProcessEngine.getRepositoryService方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。