Package org.camunda.bpm.engine

Examples of org.camunda.bpm.engine.ManagementService


    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);

    when(engine.getRepositoryService()).thenReturn(repoService);
    when(engine.getIdentityService()).thenReturn(identityService);
View Full Code Here


  public ProcessEngine getValue() {
    return processEngine;
  }

  public Set<String> getRegisteredDeployments() {
    ManagementService managementService = processEngine.getManagementService();
    return managementService.getRegisteredDeployments();
  }
View Full Code Here

    ManagementService managementService = processEngine.getManagementService();
    return managementService.getRegisteredDeployments();
  }

  public void registerDeployment(String deploymentId) {
    ManagementService managementService = processEngine.getManagementService();
    managementService.registerDeploymentForJobExecutor(deploymentId);
  }
View Full Code Here

    ManagementService managementService = processEngine.getManagementService();
    managementService.registerDeploymentForJobExecutor(deploymentId);
  }

  public void unregisterDeployment(String deploymentId) {
    ManagementService managementService = processEngine.getManagementService();
    managementService.unregisterDeploymentForJobExecutor(deploymentId);
  }
View Full Code Here

    this.engine = engine;
    this.jobDefinitionId = jobDefinitionId;
  }

  public JobDefinitionDto getJobDefinition() {
    ManagementService managementService = engine.getManagementService();
    JobDefinition jobDefinition = managementService.createJobDefinitionQuery().jobDefinitionId(jobDefinitionId).singleResult();

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

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

    ManagementService managementService = engine.getManagementService();

    Date delayedExecutionDate = null;
    if (executionDate != null && !executionDate.equals("")) {
      delayedExecutionDate = DateTimeUtil.parseDate(executionDate);
    }

    if (jobDefinitionId != null) {
      // activate/suspend job definition by id
      if (getSuspended()) {
        managementService.suspendJobDefinitionById(jobDefinitionId, includeJobs, delayedExecutionDate);
      } else {
        managementService.activateJobDefinitionById(jobDefinitionId, includeJobs, delayedExecutionDate);
      }
    } else

    if (processDefinitionId != null) {
      // activate/suspend job definition by process definition id
      if (getSuspended()) {
        managementService.suspendJobDefinitionByProcessDefinitionId(processDefinitionId, includeJobs, delayedExecutionDate);
      } else {
        managementService.activateJobDefinitionByProcessDefinitionId(processDefinitionId, includeJobs, delayedExecutionDate);
      }
    } else

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

  }

  public void setJobRetries(JobRetriesDto dto) {
    try {
      ManagementService managementService = engine.getManagementService();
      managementService.setJobRetriesByJobDefinitionId(jobDefinitionId, dto.getRetries());
    } catch (ProcessEngineException e) {
      throw new InvalidRequestException(Status.INTERNAL_SERVER_ERROR, e.getMessage());
    }
  }
View Full Code Here

  public List<StatisticsResultDto> getActivityStatistics(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 = engine.getManagementService();
    ActivityStatisticsQuery query = mgmtService.createActivityStatisticsQuery(processDefinitionId);

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

  }

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

  }

  @Override
  public void executeJob() {
    try {
      ManagementService managementService = engine.getManagementService();
      managementService.executeJob(this.jobId);
    } catch (ProcessEngineException e) {
      throw new InvalidRequestException(Status.NOT_FOUND, e.getMessage());
    } catch (RuntimeException r) {
      throw new RestException(Status.INTERNAL_SERVER_ERROR, r.getMessage());
    }
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.