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


Java CaseService类代码示例

本文整理汇总了Java中org.camunda.bpm.engine.CaseService的典型用法代码示例。如果您正苦于以下问题:Java CaseService类的具体用法?Java CaseService怎么用?Java CaseService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: mockServices

import org.camunda.bpm.engine.CaseService; //导入依赖的package包/类
private void mockServices(ProcessEngine engine) {
  RepositoryService repoService = mock(RepositoryService.class);
  IdentityService identityService = mock(IdentityService.class);
  TaskService taskService = mock(TaskService.class);
  RuntimeService runtimeService = mock(RuntimeService.class);
  FormService formService = mock(FormService.class);
  HistoryService historyService = mock(HistoryService.class);
  ManagementService managementService = mock(ManagementService.class);
  CaseService caseService = mock(CaseService.class);
  FilterService filterService = mock(FilterService.class);
  ExternalTaskService externalTaskService = mock(ExternalTaskService.class);

  when(engine.getRepositoryService()).thenReturn(repoService);
  when(engine.getIdentityService()).thenReturn(identityService);
  when(engine.getTaskService()).thenReturn(taskService);
  when(engine.getRuntimeService()).thenReturn(runtimeService);
  when(engine.getFormService()).thenReturn(formService);
  when(engine.getHistoryService()).thenReturn(historyService);
  when(engine.getManagementService()).thenReturn(managementService);
  when(engine.getCaseService()).thenReturn(caseService);
  when(engine.getFilterService()).thenReturn(filterService);
  when(engine.getExternalTaskService()).thenReturn(externalTaskService);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:24,代码来源:MockedProcessEngineProvider.java

示例2: setUpRuntime

import org.camunda.bpm.engine.CaseService; //导入依赖的package包/类
@Before
public void setUpRuntime() {
  CaseDefinition mockCaseDefinition = MockProvider.createMockCaseDefinition();

  setUpRuntimeData(mockCaseDefinition);

  caseServiceMock = mock(CaseService.class);

  when(processEngine.getCaseService()).thenReturn(caseServiceMock);

  caseInstanceBuilder = mock(CaseInstanceBuilder.class);
  CaseInstance mockCaseInstance = MockProvider.createMockCaseInstance();

  when(caseServiceMock.withCaseDefinition(MockProvider.EXAMPLE_CASE_DEFINITION_ID)).thenReturn(caseInstanceBuilder);
  when(caseInstanceBuilder.businessKey(anyString())).thenReturn(caseInstanceBuilder);
  when(caseInstanceBuilder.setVariables(Matchers.<Map<String, Object>>any())).thenReturn(caseInstanceBuilder);
  when(caseInstanceBuilder.create()).thenReturn(mockCaseInstance);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:CaseDefinitionRestServiceInteractionTest.java

示例3: completeStage

import org.camunda.bpm.engine.CaseService; //导入依赖的package包/类
@DescribesScenario("triggerStageEntryCriterion")
public static ScenarioSetup completeStage() {
  return new ScenarioSetup() {
    public void execute(ProcessEngine engine, String scenarioName) {
      CaseService caseService = engine.getCaseService();
      CaseInstance caseInstance = caseService.createCaseInstanceByKey("case", scenarioName);
      String caseInstanceId = caseInstance.getId();
      
      CaseExecutionQuery query = caseService.createCaseExecutionQuery().caseInstanceId(caseInstanceId);

      String firstHumanTaskId = query.activityId("PI_HumanTask_1").singleResult().getId();
      caseService.manuallyStartCaseExecution(firstHumanTaskId);
      caseService.completeCaseExecution(firstHumanTaskId);

      String secondHumanTaskId = query.activityId("PI_HumanTask_2").singleResult().getId();
      caseService.manuallyStartCaseExecution(secondHumanTaskId);
    }
  };
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:SentryScenario.java

示例4: newSentryInstance

import org.camunda.bpm.engine.CaseService; //导入依赖的package包/类
@DescribesScenario("newSentryInstance")
public static ScenarioSetup newSentryInstance() {
  return new ScenarioSetup() {
    public void execute(ProcessEngine engine, String scenarioName) {
      CaseService caseService = engine.getCaseService();
      CaseInstance caseInstance = caseService.createCaseInstanceByKey("case", scenarioName);
      String caseInstanceId = caseInstance.getId();
      
      CaseExecutionQuery query = caseService.createCaseExecutionQuery().caseInstanceId(caseInstanceId);

      String firstHumanTaskId = query.activityId("PI_HumanTask_1").singleResult().getId();
      caseService.manuallyStartCaseExecution(firstHumanTaskId);
      caseService.completeCaseExecution(firstHumanTaskId);

      String secondHumanTaskId = query.activityId("PI_HumanTask_2").singleResult().getId();
      caseService.manuallyStartCaseExecution(secondHumanTaskId);
      caseService.completeCaseExecution(secondHumanTaskId);
    }
  };
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:SentryScenario.java

示例5: MigrateCaseInstanceVersionCmd

import org.camunda.bpm.engine.CaseService; //导入依赖的package包/类
public MigrateCaseInstanceVersionCmd(@NonNull final String caseDefinitionKey, @NonNull final ApplicationContext ctx) {
    this.caseDefinitionKey = caseDefinitionKey;

    migrator = ctx.getBean(CaseInstanceMigrator.class);
    repositoryService = ctx.getBean(RepositoryService.class);
    caseService = ctx.getBean(CaseService.class);
}
 
开发者ID:holisticon,项目名称:holunda,代码行数:8,代码来源:MigrateCaseInstanceVersionCmd.java

示例6: assigneToMe

import org.camunda.bpm.engine.CaseService; //导入依赖的package包/类
@Test
public void assigneToMe() {
  CaseService caseService = processEngine().getCaseService();
  CaseInstance caseInstance = caseService.createCaseInstanceByKey("Case");

  Task task = taskService().createTaskQuery().caseInstanceId(caseInstance.getId()).singleResult();
  assertThat(task).isAssignedTo("me");

  CaseExecution caseExecution = caseService.createCaseExecutionQuery().activityId("_ab60407c-449e-4048-ba9c-01bb59f2f095").singleResult();
  caseService.completeCaseExecution(caseExecution.getId());
}
 
开发者ID:camunda,项目名称:camunda-bpm-reactor,代码行数:12,代码来源:CaseTest.java

示例7: startCaseInstance

import org.camunda.bpm.engine.CaseService; //导入依赖的package包/类
@PostDeploy
public void startCaseInstance(ProcessEngine processEngine) {
  CaseService caseService = processEngine.getCaseService();
  caseService.createCaseInstanceByKey("loan_application",
      Variables.createVariables()
        .putValue("applicationSufficient", Variables.booleanValue(null))
        .putValue("rating", Variables.integerValue(null)));

}
 
开发者ID:camunda,项目名称:camunda-get-started-cmmn,代码行数:10,代码来源:LoanApprovalApplication.java

示例8: getCaseExecution

import org.camunda.bpm.engine.CaseService; //导入依赖的package包/类
public CaseExecutionDto getCaseExecution() {
  CaseService caseService = engine.getCaseService();

  CaseExecution execution = caseService
      .createCaseExecutionQuery()
      .caseExecutionId(caseExecutionId)
      .singleResult();

  if (execution == null) {
    throw new InvalidRequestException(Status.NOT_FOUND, "Case execution with id " + caseExecutionId + " does not exist.");
  }

  CaseExecutionDto result = CaseExecutionDto.fromCaseExecution(execution);
  return result;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:16,代码来源:CaseExecutionResourceImpl.java

示例9: updateVariableEntities

import org.camunda.bpm.engine.CaseService; //导入依赖的package包/类
protected void updateVariableEntities(VariableMap variables, List<String> deletions) {
  CaseService caseService = engine.getCaseService();
  caseService
    .withCaseExecution(resourceId)
    .setVariablesLocal(variables)
    .removeVariablesLocal(deletions)
    .execute();
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:9,代码来源:LocalCaseExecutionVariablesResource.java

示例10: removeVariableEntity

import org.camunda.bpm.engine.CaseService; //导入依赖的package包/类
protected void removeVariableEntity(String variableKey) {
  CaseService caseService = engine.getCaseService();
  caseService
    .withCaseExecution(resourceId)
    .removeVariableLocal(variableKey)
    .execute();
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:8,代码来源:LocalCaseExecutionVariablesResource.java

示例11: getCaseInstance

import org.camunda.bpm.engine.CaseService; //导入依赖的package包/类
public CaseInstanceDto getCaseInstance() {
  CaseService caseService = engine.getCaseService();

  CaseInstance instance = caseService
      .createCaseInstanceQuery()
      .caseInstanceId(caseInstanceId)
      .singleResult();

  if (instance == null) {
    throw new InvalidRequestException(Status.NOT_FOUND, "Case instance with id " + caseInstanceId + " does not exist.");
  }

  CaseInstanceDto result = CaseInstanceDto.fromCaseInstance(instance);
  return result;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:16,代码来源:CaseInstanceResourceImpl.java

示例12: updateVariableEntities

import org.camunda.bpm.engine.CaseService; //导入依赖的package包/类
protected void updateVariableEntities(VariableMap variables, List<String> deletions) {
  CaseService caseService = engine.getCaseService();
  caseService
    .withCaseExecution(resourceId)
    .setVariables(variables)
    .removeVariables(deletions)
    .execute();
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:9,代码来源:CaseExecutionVariablesResource.java

示例13: removeVariableEntity

import org.camunda.bpm.engine.CaseService; //导入依赖的package包/类
protected void removeVariableEntity(String variableKey) {
  CaseService caseService = engine.getCaseService();
  caseService
    .withCaseExecution(resourceId)
    .removeVariable(variableKey)
    .execute();
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:8,代码来源:CaseExecutionVariablesResource.java

示例14: setVariableEntity

import org.camunda.bpm.engine.CaseService; //导入依赖的package包/类
protected void setVariableEntity(String variableKey, TypedValue variableValue) {
  CaseService caseService = engine.getCaseService();
  caseService
    .withCaseExecution(resourceId)
    .setVariable(variableKey, variableValue)
    .execute();
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:8,代码来源:CaseExecutionVariablesResource.java

示例15: setUpRuntime

import org.camunda.bpm.engine.CaseService; //导入依赖的package包/类
@Before
public void setUpRuntime() {
  CaseExecution mockCaseExecution = MockProvider.createMockCaseExecution();

  caseServiceMock = mock(CaseService.class);

  when(processEngine.getCaseService()).thenReturn(caseServiceMock);

  caseExecutionQueryMock = mock(CaseExecutionQuery.class);

  when(caseServiceMock.createCaseExecutionQuery()).thenReturn(caseExecutionQueryMock);
  when(caseExecutionQueryMock.caseExecutionId(MockProvider.EXAMPLE_CASE_EXECUTION_ID)).thenReturn(caseExecutionQueryMock);
  when(caseExecutionQueryMock.singleResult()).thenReturn(mockCaseExecution);

  when(caseServiceMock.getVariableTyped(anyString(), anyString(), eq(true))).thenReturn(EXAMPLE_VARIABLE_VALUE);
  when(caseServiceMock.getVariablesTyped(anyString(), eq(true))).thenReturn(EXAMPLE_VARIABLES);

  when(caseServiceMock.getVariableLocalTyped(anyString(), eq(EXAMPLE_VARIABLE_KEY), anyBoolean())).thenReturn(EXAMPLE_VARIABLE_VALUE);
  when(caseServiceMock.getVariableLocalTyped(anyString(), eq(EXAMPLE_BYTES_VARIABLE_KEY), eq(false))).thenReturn(EXAMPLE_VARIABLE_VALUE_BYTES);
  when(caseServiceMock.getVariablesLocalTyped(anyString(), eq(true))).thenReturn(EXAMPLE_VARIABLES);

  when(caseServiceMock.getVariablesTyped(anyString(), Matchers.<Collection<String>>any(), eq(true))).thenReturn(EXAMPLE_VARIABLES);
  when(caseServiceMock.getVariablesLocalTyped(anyString(), Matchers.<Collection<String>>any(), eq(true))).thenReturn(EXAMPLE_VARIABLES);

  caseExecutionCommandBuilderMock = mock(CaseExecutionCommandBuilder.class);

  when(caseServiceMock.withCaseExecution(MockProvider.EXAMPLE_CASE_EXECUTION_ID)).thenReturn(caseExecutionCommandBuilderMock);

  when(caseExecutionCommandBuilderMock.setVariable(anyString(), any())).thenReturn(caseExecutionCommandBuilderMock);
  when(caseExecutionCommandBuilderMock.setVariableLocal(anyString(), any())).thenReturn(caseExecutionCommandBuilderMock);
  when(caseExecutionCommandBuilderMock.setVariables(Matchers.<Map<String, Object>>any())).thenReturn(caseExecutionCommandBuilderMock);
  when(caseExecutionCommandBuilderMock.setVariablesLocal(Matchers.<Map<String, Object>>any())).thenReturn(caseExecutionCommandBuilderMock);

  when(caseExecutionCommandBuilderMock.removeVariable(anyString())).thenReturn(caseExecutionCommandBuilderMock);
  when(caseExecutionCommandBuilderMock.removeVariableLocal(anyString())).thenReturn(caseExecutionCommandBuilderMock);
  when(caseExecutionCommandBuilderMock.removeVariables(Matchers.<Collection<String>>any())).thenReturn(caseExecutionCommandBuilderMock);
  when(caseExecutionCommandBuilderMock.removeVariablesLocal(Matchers.<Collection<String>>any())).thenReturn(caseExecutionCommandBuilderMock);

}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:40,代码来源:CaseExecutionRestServiceInteractionTest.java


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