congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
IdGenerator
Code IndexAdd Tabnine to your IDE (free)

How to use
IdGenerator
in
org.camunda.bpm.engine.impl.cfg

Best Java code snippets using org.camunda.bpm.engine.impl.cfg.IdGenerator (Showing top 20 results out of 315)

origin: camunda/camunda-bpm-platform

public void createRuns(PerfTestRunner runner, PerfTestStep firstStep, int numberOfRuns) {
 runs = new HashMap<String, PerfTestRun>();
 for (int i = 0; i < numberOfRuns; i++) {
  String runId = idGenerator.getNextId();
  runs.put(runId, new PerfTestRun(runner, runId, firstStep));
 }
 runs = Collections.unmodifiableMap(runs);
}
origin: camunda/camunda-bpm-platform

/**
 * generates an activity instance id
 */
@Override
protected String generateActivityInstanceId(String activityId) {
 if (activityId.equals(processDefinitionId)) {
  return processInstanceId;
 } else {
  String nextId = Context.getProcessEngineConfiguration().getIdGenerator().getNextId();
  String compositeId = activityId + ":" + nextId;
  if (compositeId.length() > 64) {
   return String.valueOf(nextId);
  } else {
   return compositeId;
  }
 }
}
origin: camunda/camunda-bpm-platform

/**
 * generates an activity instance id
 */
@Override
protected String generateActivityInstanceId(String activityId) {
 if (activityId.equals(processDefinitionId)) {
  return processInstanceId;
 } else {
  String nextId = Context.getProcessEngineConfiguration().getIdGenerator().getNextId();
  String compositeId = activityId + ":" + nextId;
  if (compositeId.length() > 64) {
   return String.valueOf(nextId);
  } else {
   return compositeId;
  }
 }
}
origin: camunda/camunda-bpm-platform

protected void ensureHasId(DbEntity dbEntity) {
 if(dbEntity.getId() == null) {
  String nextId = idGenerator.getNextId();
  dbEntity.setId(nextId);
 }
}
origin: camunda/camunda-bpm-platform

protected void ensureHasId(DbEntity dbEntity) {
 if(dbEntity.getId() == null) {
  String nextId = idGenerator.getNextId();
  dbEntity.setId(nextId);
 }
}
origin: camunda/camunda-bpm-platform

/**
 * create an id for the definition. The default is to ask the {@link IdGenerator}
 * and add the definition key and version if that does not exceed 64 characters.
 * You might want to hook in your own implementation here.
 */
protected String generateDefinitionId(DeploymentEntity deployment, DefinitionEntity newDefinition, DefinitionEntity latestDefinition) {
 String nextId = idGenerator.getNextId();
 String definitionKey = newDefinition.getKey();
 int definitionVersion = newDefinition.getVersion();
 String definitionId = definitionKey
  + ":" + definitionVersion
  + ":" + nextId;
 // ACT-115: maximum id length is 64 characters
 if (definitionId.length() > 64) {
  definitionId = nextId;
 }
 return definitionId;
}
origin: camunda/camunda-bpm-platform

/**
 * create an id for the definition. The default is to ask the {@link IdGenerator}
 * and add the definition key and version if that does not exceed 64 characters.
 * You might want to hook in your own implementation here.
 */
protected String generateDefinitionId(DeploymentEntity deployment, DefinitionEntity newDefinition, DefinitionEntity latestDefinition) {
 String nextId = idGenerator.getNextId();
 String definitionKey = newDefinition.getKey();
 int definitionVersion = newDefinition.getVersion();
 String definitionId = definitionKey
  + ":" + definitionVersion
  + ":" + nextId;
 // ACT-115: maximum id length is 64 characters
 if (definitionId.length() > 64) {
  definitionId = nextId;
 }
 return definitionId;
}
origin: camunda/camunda-bpm-platform

public String getOperationId() {
 if (!getOperationLogManager().isUserOperationLogEnabled()) {
  return null;
 }
 if (operationId == null) {
  operationId = Context.getProcessEngineConfiguration().getIdGenerator().getNextId();
 }
 return operationId;
}
origin: camunda/camunda-bpm-platform

public String getOperationId() {
 if (!getOperationLogManager().isUserOperationLogEnabled()) {
  return null;
 }
 if (operationId == null) {
  operationId = Context.getProcessEngineConfiguration().getIdGenerator().getNextId();
 }
 return operationId;
}
origin: camunda/camunda-bpm-platform

protected void createFailedJobIncident() {
 final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
 if (processEngineConfiguration
   .isCreateIncidentOnFailedJobEnabled()) {
  String incidentHandlerType = Incident.FAILED_JOB_HANDLER_TYPE;
  // make sure job has an ID set:
  if(id == null) {
   id = processEngineConfiguration
     .getIdGenerator()
     .getNextId();
  } else {
   // check whether there exists already an incident
   // for this job
   List<Incident> failedJobIncidents = Context
     .getCommandContext()
     .getIncidentManager()
     .findIncidentByConfigurationAndIncidentType(id, incidentHandlerType);
   if (!failedJobIncidents.isEmpty()) {
    return;
   }
  }
  IncidentContext incidentContext = createIncidentContext();
  incidentContext.setActivityId(getActivityId());
  processEngineConfiguration
   .getIncidentHandler(incidentHandlerType)
   .handleIncident(incidentContext, exceptionMessage);
 }
}
origin: camunda/camunda-bpm-platform

protected void createFailedJobIncident() {
 final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
 if (processEngineConfiguration
   .isCreateIncidentOnFailedJobEnabled()) {
  String incidentHandlerType = Incident.FAILED_JOB_HANDLER_TYPE;
  // make sure job has an ID set:
  if(id == null) {
   id = processEngineConfiguration
     .getIdGenerator()
     .getNextId();
  } else {
   // check whether there exists already an incident
   // for this job
   List<Incident> failedJobIncidents = Context
     .getCommandContext()
     .getIncidentManager()
     .findIncidentByConfigurationAndIncidentType(id, incidentHandlerType);
   if (!failedJobIncidents.isEmpty()) {
    return;
   }
  }
  IncidentContext incidentContext = createIncidentContext();
  incidentContext.setActivityId(getActivityId());
  processEngineConfiguration
   .getIncidentHandler(incidentHandlerType)
   .handleIncident(incidentContext, exceptionMessage);
 }
}
origin: camunda/camunda-bpm-platform

protected static IncidentEntity create(String incidentType) {
 String incidentId = Context.getProcessEngineConfiguration()
   .getDbSqlSessionFactory()
   .getIdGenerator()
   .getNextId();
 // decorate new incident
 IncidentEntity newIncident = new IncidentEntity();
 newIncident.setId(incidentId);
 newIncident.setIncidentTimestamp(ClockUtil.getCurrentTime());
 newIncident.setIncidentType(incidentType);
 newIncident.setCauseIncidentId(incidentId);
 newIncident.setRootCauseIncidentId(incidentId);
 return newIncident;
}
origin: camunda/camunda-bpm-platform

protected static IncidentEntity create(String incidentType) {
 String incidentId = Context.getProcessEngineConfiguration()
   .getDbSqlSessionFactory()
   .getIdGenerator()
   .getNextId();
 // decorate new incident
 IncidentEntity newIncident = new IncidentEntity();
 newIncident.setId(incidentId);
 newIncident.setIncidentTimestamp(ClockUtil.getCurrentTime());
 newIncident.setIncidentType(incidentType);
 newIncident.setCauseIncidentId(incidentId);
 newIncident.setRootCauseIncidentId(incidentId);
 return newIncident;
}
origin: org.camunda.bpm/camunda-engine

/**
 * generates an activity instance id
 */
@Override
protected String generateActivityInstanceId(String activityId) {
 if (activityId.equals(processDefinitionId)) {
  return processInstanceId;
 } else {
  String nextId = Context.getProcessEngineConfiguration().getIdGenerator().getNextId();
  String compositeId = activityId + ":" + nextId;
  if (compositeId.length() > 64) {
   return String.valueOf(nextId);
  } else {
   return compositeId;
  }
 }
}
origin: org.camunda.bpm/camunda-engine

protected void ensureHasId(DbEntity dbEntity) {
 if(dbEntity.getId() == null) {
  String nextId = idGenerator.getNextId();
  dbEntity.setId(nextId);
 }
}
origin: org.camunda.bpm/camunda-engine

/**
 * create an id for the definition. The default is to ask the {@link IdGenerator}
 * and add the definition key and version if that does not exceed 64 characters.
 * You might want to hook in your own implementation here.
 */
protected String generateDefinitionId(DeploymentEntity deployment, DefinitionEntity newDefinition, DefinitionEntity latestDefinition) {
 String nextId = idGenerator.getNextId();
 String definitionKey = newDefinition.getKey();
 int definitionVersion = newDefinition.getVersion();
 String definitionId = definitionKey
  + ":" + definitionVersion
  + ":" + nextId;
 // ACT-115: maximum id length is 64 characters
 if (definitionId.length() > 64) {
  definitionId = nextId;
 }
 return definitionId;
}
origin: camunda/camunda-bpm-platform

public HistoryEvent createFormPropertyUpdateEvt(ExecutionEntity execution, String propertyId, String propertyValue, String taskId) {
 final IdGenerator idGenerator = Context.getProcessEngineConfiguration().getIdGenerator();
 HistoricFormPropertyEventEntity historicFormPropertyEntity = newHistoricFormPropertyEvent();
 historicFormPropertyEntity.setId(idGenerator.getNextId());
 historicFormPropertyEntity.setEventType(HistoryEventTypes.FORM_PROPERTY_UPDATE.getEventName());
 historicFormPropertyEntity.setTimestamp(ClockUtil.getCurrentTime());
 historicFormPropertyEntity.setActivityInstanceId(execution.getActivityInstanceId());
 historicFormPropertyEntity.setExecutionId(execution.getId());
 historicFormPropertyEntity.setProcessDefinitionId(execution.getProcessDefinitionId());
 historicFormPropertyEntity.setProcessInstanceId(execution.getProcessInstanceId());
 historicFormPropertyEntity.setPropertyId(propertyId);
 historicFormPropertyEntity.setPropertyValue(propertyValue);
 historicFormPropertyEntity.setTaskId(taskId);
 historicFormPropertyEntity.setTenantId(execution.getTenantId());
 historicFormPropertyEntity.setUserOperationId(Context.getCommandContext().getOperationId());
 historicFormPropertyEntity.setRootProcessInstanceId(execution.getRootProcessInstanceId());
 if (isHistoryRemovalTimeStrategyStart()) {
  provideRemovalTime(historicFormPropertyEntity);
 }
 ProcessDefinitionEntity definition = execution.getProcessDefinition();
 if (definition != null) {
  historicFormPropertyEntity.setProcessDefinitionKey(definition.getKey());
 }
 // initialize sequence counter
 initSequenceCounter(execution, historicFormPropertyEntity);
 return historicFormPropertyEntity;
}
origin: OrienteerBAP/Orienteer

public static String getNextId() {
  return ((OProcessEngineConfiguration) BpmPlatform.getDefaultProcessEngine()
      .getProcessEngineConfiguration()).getIdGenerator().getNextId();
}

origin: camunda/camunda-bpm-platform

public HistoryEvent createFormPropertyUpdateEvt(ExecutionEntity execution, String propertyId, String propertyValue, String taskId) {
 final IdGenerator idGenerator = Context.getProcessEngineConfiguration().getIdGenerator();
 HistoricFormPropertyEventEntity historicFormPropertyEntity = newHistoricFormPropertyEvent();
 historicFormPropertyEntity.setId(idGenerator.getNextId());
 historicFormPropertyEntity.setEventType(HistoryEventTypes.FORM_PROPERTY_UPDATE.getEventName());
 historicFormPropertyEntity.setTimestamp(ClockUtil.getCurrentTime());
 historicFormPropertyEntity.setActivityInstanceId(execution.getActivityInstanceId());
 historicFormPropertyEntity.setExecutionId(execution.getId());
 historicFormPropertyEntity.setProcessDefinitionId(execution.getProcessDefinitionId());
 historicFormPropertyEntity.setProcessInstanceId(execution.getProcessInstanceId());
 historicFormPropertyEntity.setPropertyId(propertyId);
 historicFormPropertyEntity.setPropertyValue(propertyValue);
 historicFormPropertyEntity.setTaskId(taskId);
 historicFormPropertyEntity.setTenantId(execution.getTenantId());
 historicFormPropertyEntity.setUserOperationId(Context.getCommandContext().getOperationId());
 historicFormPropertyEntity.setRootProcessInstanceId(execution.getRootProcessInstanceId());
 if (isHistoryRemovalTimeStrategyStart()) {
  provideRemovalTime(historicFormPropertyEntity);
 }
 ProcessDefinitionEntity definition = execution.getProcessDefinition();
 if (definition != null) {
  historicFormPropertyEntity.setProcessDefinitionKey(definition.getKey());
 }
 // initialize sequence counter
 initSequenceCounter(execution, historicFormPropertyEntity);
 return historicFormPropertyEntity;
}
origin: org.camunda.bpm/camunda-engine

public String getOperationId() {
 if (!getOperationLogManager().isUserOperationLogEnabled()) {
  return null;
 }
 if (operationId == null) {
  operationId = Context.getProcessEngineConfiguration().getIdGenerator().getNextId();
 }
 return operationId;
}
org.camunda.bpm.engine.impl.cfgIdGenerator

Javadoc

generates IdBlocks that are used to assign ids to new objects. The scope of an instance of this class is process engine, which means that there is only one instance in one process engine instance.

Most used methods

  • getNextId

Popular in Java

  • Updating database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (ScheduledExecutorService)
  • addToBackStack (FragmentTransaction)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Reference (javax.naming)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now