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); }
/** * 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; } } }
/** * 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; } } }
protected void ensureHasId(DbEntity dbEntity) { if(dbEntity.getId() == null) { String nextId = idGenerator.getNextId(); dbEntity.setId(nextId); } }
protected void ensureHasId(DbEntity dbEntity) { if(dbEntity.getId() == null) { String nextId = idGenerator.getNextId(); dbEntity.setId(nextId); } }
/** * 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; }
/** * 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; }
public String getOperationId() { if (!getOperationLogManager().isUserOperationLogEnabled()) { return null; } if (operationId == null) { operationId = Context.getProcessEngineConfiguration().getIdGenerator().getNextId(); } return operationId; }
public String getOperationId() { if (!getOperationLogManager().isUserOperationLogEnabled()) { return null; } if (operationId == null) { operationId = Context.getProcessEngineConfiguration().getIdGenerator().getNextId(); } return operationId; }
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); } }
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); } }
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; }
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; }
/** * 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; } } }
protected void ensureHasId(DbEntity dbEntity) { if(dbEntity.getId() == null) { String nextId = idGenerator.getNextId(); dbEntity.setId(nextId); } }
/** * 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; }
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; }
public static String getNextId() { return ((OProcessEngineConfiguration) BpmPlatform.getDefaultProcessEngine() .getProcessEngineConfiguration()).getIdGenerator().getNextId(); }
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; }
public String getOperationId() { if (!getOperationLogManager().isUserOperationLogEnabled()) { return null; } if (operationId == null) { operationId = Context.getProcessEngineConfiguration().getIdGenerator().getNextId(); } return operationId; }