Java Code Examples for org.camunda.bpm.engine.ProcessEngine#getName()

The following examples show how to use org.camunda.bpm.engine.ProcessEngine#getName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RuntimeContainerDelegateImpl.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
@Override
public void registerProcessEngine(ProcessEngine processEngine) {
  ensureNotNull("Cannot register process engine in Jmx Runtime Container", "process engine", processEngine);

  String processEngineName = processEngine.getName();

  // build and start the service.
  JmxManagedProcessEngine managedProcessEngine = new JmxManagedProcessEngine(processEngine);
  serviceContainer.startService(ServiceTypes.PROCESS_ENGINE, processEngineName, managedProcessEngine);

}
 
Example 2
Source File: FetchAndLockHandlerImpl.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
@Override
public void addPendingRequest(FetchExternalTasksExtendedDto dto, AsyncResponse asyncResponse, ProcessEngine processEngine) {
  Long asyncResponseTimeout = dto.getAsyncResponseTimeout();
  if (asyncResponseTimeout != null && asyncResponseTimeout > MAX_REQUEST_TIMEOUT) {
    asyncResponse.resume(new InvalidRequestException(Status.BAD_REQUEST, "The asynchronous response timeout cannot be set to a value greater than "
        + MAX_REQUEST_TIMEOUT + " milliseconds"));
    return;
  }

  IdentityService identityService = processEngine.getIdentityService();
  Authentication authentication = identityService.getCurrentAuthentication();
  String processEngineName = processEngine.getName();

  FetchAndLockRequest incomingRequest = new FetchAndLockRequest()
    .setProcessEngineName(processEngineName)
    .setAsyncResponse(asyncResponse)
    .setAuthentication(authentication)
    .setDto(dto);

  LOG.log(Level.FINEST, "New request: {0}", incomingRequest);

  FetchAndLockResult result = tryFetchAndLock(incomingRequest);

  LOG.log(Level.FINEST, "Fetch and lock result: {0}", result);

  if (result.wasSuccessful()) {
    List<LockedExternalTaskDto> lockedTasks = result.getTasks();
    if (!lockedTasks.isEmpty() || dto.getAsyncResponseTimeout() == null) { // response immediately if tasks available
      asyncResponse.resume(lockedTasks);

      LOG.log(Level.FINEST, "Resuming request with {0}", lockedTasks);
    } else {
      addRequest(incomingRequest);

      LOG.log(Level.FINEST, "Deferred request");
    }
  }
  else {
    Throwable processEngineException = result.getThrowable();
    asyncResponse.resume(processEngineException);

    LOG.log(Level.FINEST, "Resuming request with error {0}", processEngineException);
  }
}
 
Example 3
Source File: HistoricProcessDefinitionRestServiceImpl.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public HistoricProcessDefinitionRestServiceImpl(ObjectMapper objectMapper, ProcessEngine processEngine) {
  super(processEngine.getName(), objectMapper);
}