Search in sources :

Example 11 with HistoryService

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

the class HistoricCaseActivityInstanceResourceImpl method getHistoricCaseActivityInstance.

public HistoricCaseActivityInstanceDto getHistoricCaseActivityInstance() {
    HistoryService historyService = engine.getHistoryService();
    HistoricCaseActivityInstance instance = historyService.createHistoricCaseActivityInstanceQuery().caseActivityInstanceId(caseActivityInstanceId).singleResult();
    if (instance == null) {
        throw new InvalidRequestException(Status.NOT_FOUND, "Historic case activity instance with id '" + caseActivityInstanceId + "' does not exist");
    }
    return HistoricCaseActivityInstanceDto.fromHistoricCaseActivityInstance(instance);
}
Also used : HistoryService(org.camunda.bpm.engine.HistoryService) InvalidRequestException(org.camunda.bpm.engine.rest.exception.InvalidRequestException) HistoricCaseActivityInstance(org.camunda.bpm.engine.history.HistoricCaseActivityInstance)

Example 12 with HistoryService

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

the class HistoricDecisionInstanceResourceImpl method getHistoricDecisionInstance.

public HistoricDecisionInstanceDto getHistoricDecisionInstance(Boolean includeInputs, Boolean includeOutputs, Boolean disableBinaryFetching, Boolean disableCustomObjectDeserialization) {
    HistoryService historyService = engine.getHistoryService();
    HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery().decisionInstanceId(decisionInstanceId);
    if (includeInputs != null && includeInputs) {
        query.includeInputs();
    }
    if (includeOutputs != null && includeOutputs) {
        query.includeOutputs();
    }
    if (disableBinaryFetching != null && disableBinaryFetching) {
        query.disableBinaryFetching();
    }
    if (disableCustomObjectDeserialization != null && disableCustomObjectDeserialization) {
        query.disableCustomObjectDeserialization();
    }
    HistoricDecisionInstance instance = query.singleResult();
    if (instance == null) {
        throw new InvalidRequestException(Status.NOT_FOUND, "Historic decision instance with id '" + decisionInstanceId + "' does not exist");
    }
    return HistoricDecisionInstanceDto.fromHistoricDecisionInstance(instance);
}
Also used : HistoryService(org.camunda.bpm.engine.HistoryService) HistoricDecisionInstance(org.camunda.bpm.engine.history.HistoricDecisionInstance) InvalidRequestException(org.camunda.bpm.engine.rest.exception.InvalidRequestException) HistoricDecisionInstanceQuery(org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery)

Example 13 with HistoryService

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

the class HistoricCaseInstanceResourceImpl method getHistoricCaseInstance.

public HistoricCaseInstanceDto getHistoricCaseInstance() {
    HistoryService historyService = engine.getHistoryService();
    HistoricCaseInstance instance = historyService.createHistoricCaseInstanceQuery().caseInstanceId(caseInstanceId).singleResult();
    if (instance == null) {
        throw new InvalidRequestException(Status.NOT_FOUND, "Historic case instance with id '" + caseInstanceId + "' does not exist");
    }
    return HistoricCaseInstanceDto.fromHistoricCaseInstance(instance);
}
Also used : HistoricCaseInstance(org.camunda.bpm.engine.history.HistoricCaseInstance) HistoryService(org.camunda.bpm.engine.HistoryService) InvalidRequestException(org.camunda.bpm.engine.rest.exception.InvalidRequestException)

Example 14 with HistoryService

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

the class HistoricProcessInstanceResourceImpl method getHistoricProcessInstance.

@Override
public HistoricProcessInstanceDto getHistoricProcessInstance() {
    HistoryService historyService = engine.getHistoryService();
    HistoricProcessInstance instance = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
    if (instance == null) {
        throw new InvalidRequestException(Status.NOT_FOUND, "Historic process instance with id " + processInstanceId + " does not exist");
    }
    return HistoricProcessInstanceDto.fromHistoricProcessInstance(instance);
}
Also used : HistoricProcessInstance(org.camunda.bpm.engine.history.HistoricProcessInstance) HistoryService(org.camunda.bpm.engine.HistoryService) InvalidRequestException(org.camunda.bpm.engine.rest.exception.InvalidRequestException)

Example 15 with HistoryService

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

the class HistoricJobLogResourceImpl method getStacktrace.

public String getStacktrace() {
    try {
        HistoryService historyService = engine.getHistoryService();
        String stacktrace = historyService.getHistoricJobLogExceptionStacktrace(id);
        return stacktrace;
    } catch (AuthorizationException e) {
        throw e;
    } catch (ProcessEngineException e) {
        throw new InvalidRequestException(Status.NOT_FOUND, e.getMessage());
    }
}
Also used : AuthorizationException(org.camunda.bpm.engine.AuthorizationException) HistoryService(org.camunda.bpm.engine.HistoryService) InvalidRequestException(org.camunda.bpm.engine.rest.exception.InvalidRequestException) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Aggregations

HistoryService (org.camunda.bpm.engine.HistoryService)23 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)9 ManagementService (org.camunda.bpm.engine.ManagementService)5 Batch (org.camunda.bpm.engine.batch.Batch)4 ArrayList (java.util.ArrayList)3 HistoricBatch (org.camunda.bpm.engine.batch.history.HistoricBatch)3 HistoricActivityInstance (org.camunda.bpm.engine.history.HistoricActivityInstance)3 HistoricVariableInstance (org.camunda.bpm.engine.history.HistoricVariableInstance)3 VariableMap (org.camunda.bpm.engine.variable.VariableMap)3 List (java.util.List)2 FormService (org.camunda.bpm.engine.FormService)2 RepositoryService (org.camunda.bpm.engine.RepositoryService)2 TaskService (org.camunda.bpm.engine.TaskService)2 HistoricVariableUpdate (org.camunda.bpm.engine.history.HistoricVariableUpdate)2 VariableMapImpl (org.camunda.bpm.engine.variable.impl.VariableMapImpl)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 Date (java.util.Date)1 ProcessApplicationService (org.camunda.bpm.ProcessApplicationService)1 ProcessApplicationInfo (org.camunda.bpm.application.ProcessApplicationInfo)1