Search in sources :

Example 6 with CaseExecutionCommandBuilder

use of org.camunda.bpm.engine.runtime.CaseExecutionCommandBuilder in project camunda-bpm-platform by camunda.

the class CaseExecutionResourceImpl method manualStart.

public void manualStart(CaseExecutionTriggerDto triggerDto) {
    try {
        CaseService caseService = engine.getCaseService();
        CaseExecutionCommandBuilder commandBuilder = caseService.withCaseExecution(caseExecutionId);
        initializeCommand(commandBuilder, triggerDto, "start manually");
        commandBuilder.manualStart();
    } catch (NotFoundException e) {
        throw createInvalidRequestException("manualStart", Status.NOT_FOUND, e);
    } catch (NotValidException e) {
        throw createInvalidRequestException("manualStart", Status.BAD_REQUEST, e);
    } catch (NotAllowedException e) {
        throw createInvalidRequestException("manualStart", Status.FORBIDDEN, e);
    } catch (ProcessEngineException e) {
        throw createRestException("manualStart", Status.INTERNAL_SERVER_ERROR, e);
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) NotAllowedException(org.camunda.bpm.engine.exception.NotAllowedException) NotFoundException(org.camunda.bpm.engine.exception.NotFoundException) CaseService(org.camunda.bpm.engine.CaseService) CaseExecutionCommandBuilder(org.camunda.bpm.engine.runtime.CaseExecutionCommandBuilder) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Example 7 with CaseExecutionCommandBuilder

use of org.camunda.bpm.engine.runtime.CaseExecutionCommandBuilder in project camunda-bpm-platform by camunda.

the class CaseExecutionResourceImpl method complete.

public void complete(CaseExecutionTriggerDto triggerDto) {
    try {
        CaseService caseService = engine.getCaseService();
        CaseExecutionCommandBuilder commandBuilder = caseService.withCaseExecution(caseExecutionId);
        initializeCommand(commandBuilder, triggerDto, "complete");
        commandBuilder.complete();
    } catch (NotFoundException e) {
        throw createInvalidRequestException("complete", Status.NOT_FOUND, e);
    } catch (NotValidException e) {
        throw createInvalidRequestException("complete", Status.BAD_REQUEST, e);
    } catch (NotAllowedException e) {
        throw createInvalidRequestException("complete", Status.FORBIDDEN, e);
    } catch (ProcessEngineException e) {
        throw createRestException("complete", Status.INTERNAL_SERVER_ERROR, e);
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) NotAllowedException(org.camunda.bpm.engine.exception.NotAllowedException) NotFoundException(org.camunda.bpm.engine.exception.NotFoundException) CaseService(org.camunda.bpm.engine.CaseService) CaseExecutionCommandBuilder(org.camunda.bpm.engine.runtime.CaseExecutionCommandBuilder) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Example 8 with CaseExecutionCommandBuilder

use of org.camunda.bpm.engine.runtime.CaseExecutionCommandBuilder in project camunda-bpm-platform by camunda.

the class CaseInstanceResourceImpl method close.

public void close(CaseExecutionTriggerDto triggerDto) {
    try {
        CaseService caseService = engine.getCaseService();
        CaseExecutionCommandBuilder commandBuilder = caseService.withCaseExecution(caseInstanceId);
        initializeCommand(commandBuilder, triggerDto, "close");
        commandBuilder.close();
    } catch (NotFoundException e) {
        throw createInvalidRequestException("close", Status.NOT_FOUND, e);
    } catch (NotValidException e) {
        throw createInvalidRequestException("close", Status.BAD_REQUEST, e);
    } catch (NotAllowedException e) {
        throw createInvalidRequestException("close", Status.FORBIDDEN, e);
    } catch (ProcessEngineException e) {
        throw createRestException("close", Status.INTERNAL_SERVER_ERROR, e);
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) NotAllowedException(org.camunda.bpm.engine.exception.NotAllowedException) NotFoundException(org.camunda.bpm.engine.exception.NotFoundException) CaseService(org.camunda.bpm.engine.CaseService) CaseExecutionCommandBuilder(org.camunda.bpm.engine.runtime.CaseExecutionCommandBuilder) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Example 9 with CaseExecutionCommandBuilder

use of org.camunda.bpm.engine.runtime.CaseExecutionCommandBuilder in project camunda-bpm-platform by camunda.

the class CaseServiceTest method testWithCaseExecution.

public void testWithCaseExecution() {
    CaseExecutionCommandBuilder builder = caseService.withCaseExecution("aCaseExecutionId");
    assertNotNull(builder);
}
Also used : CaseExecutionCommandBuilder(org.camunda.bpm.engine.runtime.CaseExecutionCommandBuilder)

Aggregations

CaseExecutionCommandBuilder (org.camunda.bpm.engine.runtime.CaseExecutionCommandBuilder)9 CaseService (org.camunda.bpm.engine.CaseService)8 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)8 NotAllowedException (org.camunda.bpm.engine.exception.NotAllowedException)8 NotFoundException (org.camunda.bpm.engine.exception.NotFoundException)8 NotValidException (org.camunda.bpm.engine.exception.NotValidException)8