Package org.camunda.bpm.engine

Examples of org.camunda.bpm.engine.ManagementService


  }

  @Override
  public void setJobDuedate(JobDuedateDto dto) {
    try {
      ManagementService managementService = engine.getManagementService();
      managementService.setJobDuedate(jobId, dto.getDuedate());
    } catch (ProcessEngineException e) {
      throw new InvalidRequestException(Status.INTERNAL_SERVER_ERROR, e.getMessage());
    }
  }
View Full Code Here


    this.jobId = jobId;
  }

  @Override
  public JobDto getJob() {
    ManagementService managementService = engine.getManagementService();
    Job job = managementService.createJobQuery().jobId(jobId).singleResult();

    if (job == null) {
      throw new InvalidRequestException(Status.NOT_FOUND, "Job with id " + jobId + " does not exist");
    }
View Full Code Here

  }

  @Override
  public String getStacktrace() {
    try {
      ManagementService managementService = engine.getManagementService();
      String stacktrace = managementService.getJobExceptionStacktrace(jobId);
      return stacktrace;
    } catch (ProcessEngineException e) {
      throw new InvalidRequestException(Status.NOT_FOUND, e.getMessage());
    }
  }
View Full Code Here

    if (params > 1) {
      String message = "Only one of jobId, jobDefinitionId, processInstanceId, processDefinitionId or processDefinitionKey should be set to update the suspension state.";
      throw new InvalidRequestException(Status.BAD_REQUEST, message);
    }

    ManagementService managementService = engine.getManagementService();

    if (jobId != null) {
      // activate/suspend job by id
      if (getSuspended()) {
        managementService.suspendJobById(jobId);
      } else {
        managementService.activateJobById(jobId);
      }
    } else

    if (jobDefinitionId != null) {
      // activate/suspend jobs by job definition id
      if (getSuspended()) {
        managementService.suspendJobByJobDefinitionId(jobDefinitionId);
      } else {
        managementService.activateJobByJobDefinitionId(jobDefinitionId);
      }
    } else

    if (processInstanceId != null) {
      // activate/suspend jobs by process instance id
      if (getSuspended()) {
        managementService.suspendJobByProcessInstanceId(processInstanceId);
      } else {
        managementService.activateJobByProcessInstanceId(processInstanceId);
      }
    } else

    if (processDefinitionId != null) {
      // activate/suspend jobs by process definition id
      if (getSuspended()) {
        managementService.suspendJobByProcessDefinitionId(processDefinitionId);
      } else {
        managementService.activateJobByProcessDefinitionId(processDefinitionId);
      }
    } else

    if (processDefinitionKey != null) {
      // activate/suspend jobs by process definition key
      if (getSuspended()) {
        managementService.suspendJobByProcessDefinitionKey(processDefinitionKey);
      } else {
        managementService.activateJobByProcessDefinitionKey(processDefinitionKey);
      }
    } else {
      String message = "Either jobId, jobDefinitionId, processInstanceId, processDefinitionId or processDefinitionKey should be set to update the suspension state.";
      throw new InvalidRequestException(Status.BAD_REQUEST, message);
    }
View Full Code Here

  public List<StatisticsResultDto> getStatistics(Boolean includeFailedJobs, Boolean includeIncidents, String includeIncidentsForType) {
    if (includeIncidents != null && includeIncidentsForType != null) {
      throw new InvalidRequestException(Status.BAD_REQUEST, "Only one of the query parameter includeIncidents or includeIncidentsForType can be set.");
    }

    ManagementService mgmtService = getProcessEngine().getManagementService();
    ProcessDefinitionStatisticsQuery query = mgmtService.createProcessDefinitionStatisticsQuery();

    if (includeFailedJobs != null && includeFailedJobs) {
      query.includeFailedJobs();
    }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.ManagementService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.