class ProcessHelper {

    public Operation.State computeProcessState(String processId) {
        if (isInAbortedState(processId)) {
            return State.ABORTED;
        }

        if (isInErrorState(processId)) {
            return State.ERROR;
        }

        if (isInReceiveTask(processId)) {
            return State.ACTION_REQUIRED;
        }

        if (isInRunningState(processId)) {
            return State.RUNNING;
        }
        return State.FINISHED;
    }

    @Inject public  ProcessHelper(FlowableFacade flowableFacade, HistoricOperationEventService historicOperationEventService);

}