public void databaseFlushSummary(Collection<DbOperation> operations) { if(isDebugEnabled()) { logDebug("008", "Flush Summary: {}", buildStringFromList(operations)); } }
public void countRowsPerProcessEngineTable(Map<String, Long> map) { if(isDebugEnabled()) { logDebug("047", "Number of rows per process engine table: {}", buildStringFromMap(map)); } }
public ProcessEngineException missingTableException(List<String> components) { return new ProcessEngineException(exceptionMessage( "056", "Tables are missing for the following components: {}", buildStringFromList(components) )); }
throw LOG.entityCacheDuplicateEntryException("TRANSIENT", entityToAdd.getEntity().getId(), entityToAdd.getEntity().getClass(), existingCachedEntity.getEntityState()); throw LOG.alreadyMarkedEntityInEntityCacheException(entityToAdd.getEntity().getId(), entityToAdd.getEntity().getClass(), existingCachedEntity.getEntityState()); throw LOG.entityCacheDuplicateEntryException("PERSISTENT", entityToAdd.getEntity().getId(), entityToAdd.getEntity().getClass(), existingCachedEntity.getEntityState()); throw LOG.entityCacheDuplicateEntryException("MERGED", entityToAdd.getEntity().getId(), entityToAdd.getEntity().getClass(), existingCachedEntity.getEntityState());
@Override public UserTask getBpmnModelElementInstance() { BpmnModelInstance bpmnModelInstance = getBpmnModelInstance(); if(bpmnModelInstance != null) { ModelElementInstance modelElementInstance = bpmnModelInstance.getModelElementById(taskDefinitionKey); try { return (UserTask) modelElementInstance; } catch(ClassCastException e) { ModelElementType elementType = modelElementInstance.getElementType(); throw LOG.castModelInstanceException(modelElementInstance, "UserTask", elementType.getTypeName(), elementType.getTypeNamespace(), e); } } else { return null; } }
public void failedOperation(DbOperation operation) { if (operation instanceof DbEntityOperation) { DbEntityOperation dbEntityOperation = (DbEntityOperation) operation; DbEntity dbEntity = dbEntityOperation.getEntity(); boolean failedOperationEntityInList = false; Iterator<LockedExternalTask> it = tasks.iterator(); while (it.hasNext()) { LockedExternalTask resultTask = it.next(); if (resultTask.getId().equals(dbEntity.getId())) { it.remove(); failedOperationEntityInList = true; break; } } if (!failedOperationEntityInList) { throw LOG.concurrentUpdateDbEntityException(operation); } } } });
protected void ensureTenantIdNotChanged() { final TaskEntity persistentTask = Context.getCommandContext().getTaskManager() .findTaskById(id); if(persistentTask != null) { boolean changed = !tenantIdIsSame(persistentTask); if(changed) { throw LOG.cannotChangeTenantIdOfTask(id, persistentTask.tenantId, tenantId); } } }
protected Double getCollectResultValue(TypedValue collectResultValue) { // the built-in collect aggregators return only numbers if(collectResultValue instanceof IntegerValue) { return ((IntegerValue) collectResultValue).getValue().doubleValue(); } else if(collectResultValue instanceof LongValue) { return ((LongValue) collectResultValue).getValue().doubleValue(); } else if(collectResultValue instanceof DoubleValue) { return ((DoubleValue) collectResultValue).getValue(); } else { throw LOG.collectResultValueOfUnsupportedTypeException(collectResultValue); } }
protected void propagateParentTaskTenantId() { if (parentTaskId != null) { final TaskEntity parentTask = Context .getCommandContext() .getTaskManager() .findTaskById(parentTaskId); if(tenantId != null && !tenantIdIsSame(parentTask)) { throw LOG.cannotSetDifferentTenantIdOnSubtask(parentTaskId, parentTask.getTenantId(), tenantId); } setTenantId(parentTask.getTenantId()); } }
protected static VariableSerializers getCurrentPaSerializers() { if (Context.getCurrentProcessApplication() != null) { ProcessApplicationReference processApplicationReference = Context.getCurrentProcessApplication(); try { ProcessApplicationInterface processApplicationInterface = processApplicationReference.getProcessApplication(); ProcessApplicationInterface rawPa = processApplicationInterface.getRawObject(); if (rawPa instanceof AbstractProcessApplication) { return ((AbstractProcessApplication) rawPa).getVariableSerializers(); } else { return null; } } catch (ProcessApplicationUnavailableException e) { throw LOG.cannotDeterminePaDataformats(e); } } else { return null; } }
public boolean isTablePresent(String tableName) { tableName = prependDatabaseTablePrefix(tableName); Connection connection = null; try { connection = sqlSession.getConnection(); DatabaseMetaData databaseMetaData = connection.getMetaData(); ResultSet tables = null; String schema = this.connectionMetadataDefaultSchema; if (dbSqlSessionFactory.getDatabaseSchema()!=null) { schema = dbSqlSessionFactory.getDatabaseSchema(); } String databaseType = dbSqlSessionFactory.getDatabaseType(); if (DbSqlSessionFactory.POSTGRES.equals(databaseType)) { tableName = tableName.toLowerCase(); } try { tables = databaseMetaData.getTables(this.connectionMetadataDefaultCatalog, schema, tableName, JDBC_METADATA_TABLE_TYPES); return tables.next(); } finally { if (tables != null) { tables.close(); } } } catch (Exception e) { throw LOG.checkDatabaseTableException(e); } }
public ProcessEngineException wrongBatchResultsSizeException(List<DbOperation> operationsToFlush) { return new ProcessEngineException(exceptionMessage( "084", "Exception while executing Batch Database Operations: the size of Batch Result does not correspond to the number of flushed operations. Flush summary: \n {}", buildStringFromList(operationsToFlush) )); }
throw LOG.entityCacheDuplicateEntryException("TRANSIENT", entityToAdd.getEntity().getId(), entityToAdd.getEntity().getClass(), existingCachedEntity.getEntityState()); throw LOG.alreadyMarkedEntityInEntityCacheException(entityToAdd.getEntity().getId(), entityToAdd.getEntity().getClass(), existingCachedEntity.getEntityState()); throw LOG.entityCacheDuplicateEntryException("PERSISTENT", entityToAdd.getEntity().getId(), entityToAdd.getEntity().getClass(), existingCachedEntity.getEntityState()); throw LOG.entityCacheDuplicateEntryException("MERGED", entityToAdd.getEntity().getId(), entityToAdd.getEntity().getClass(), existingCachedEntity.getEntityState());
@Override public UserTask getBpmnModelElementInstance() { BpmnModelInstance bpmnModelInstance = getBpmnModelInstance(); if(bpmnModelInstance != null) { ModelElementInstance modelElementInstance = bpmnModelInstance.getModelElementById(taskDefinitionKey); try { return (UserTask) modelElementInstance; } catch(ClassCastException e) { ModelElementType elementType = modelElementInstance.getElementType(); throw LOG.castModelInstanceException(modelElementInstance, "UserTask", elementType.getTypeName(), elementType.getTypeNamespace(), e); } } else { return null; } }
public void failedOperation(DbOperation operation) { if (operation instanceof DbEntityOperation) { DbEntityOperation dbEntityOperation = (DbEntityOperation) operation; DbEntity dbEntity = dbEntityOperation.getEntity(); boolean failedOperationEntityInList = false; Iterator<LockedExternalTask> it = tasks.iterator(); while (it.hasNext()) { LockedExternalTask resultTask = it.next(); if (resultTask.getId().equals(dbEntity.getId())) { it.remove(); failedOperationEntityInList = true; break; } } if (!failedOperationEntityInList) { throw LOG.concurrentUpdateDbEntityException(operation); } } } });
protected void ensureTenantIdNotChanged() { final TaskEntity persistentTask = Context.getCommandContext().getTaskManager() .findTaskById(id); if(persistentTask != null) { boolean changed = !tenantIdIsSame(persistentTask); if(changed) { throw LOG.cannotChangeTenantIdOfTask(id, persistentTask.tenantId, tenantId); } } }
protected Double getCollectResultValue(TypedValue collectResultValue) { // the built-in collect aggregators return only numbers if(collectResultValue instanceof IntegerValue) { return ((IntegerValue) collectResultValue).getValue().doubleValue(); } else if(collectResultValue instanceof LongValue) { return ((LongValue) collectResultValue).getValue().doubleValue(); } else if(collectResultValue instanceof DoubleValue) { return ((DoubleValue) collectResultValue).getValue(); } else { throw LOG.collectResultValueOfUnsupportedTypeException(collectResultValue); } }
protected void propagateParentTaskTenantId() { if (parentTaskId != null) { final TaskEntity parentTask = Context .getCommandContext() .getTaskManager() .findTaskById(parentTaskId); if(tenantId != null && !tenantIdIsSame(parentTask)) { throw LOG.cannotSetDifferentTenantIdOnSubtask(parentTaskId, parentTask.getTenantId(), tenantId); } setTenantId(parentTask.getTenantId()); } }
protected static VariableSerializers getCurrentPaSerializers() { if (Context.getCurrentProcessApplication() != null) { ProcessApplicationReference processApplicationReference = Context.getCurrentProcessApplication(); try { ProcessApplicationInterface processApplicationInterface = processApplicationReference.getProcessApplication(); ProcessApplicationInterface rawPa = processApplicationInterface.getRawObject(); if (rawPa instanceof AbstractProcessApplication) { return ((AbstractProcessApplication) rawPa).getVariableSerializers(); } else { return null; } } catch (ProcessApplicationUnavailableException e) { throw LOG.cannotDeterminePaDataformats(e); } } else { return null; } }
public boolean isTablePresent(String tableName) { tableName = prependDatabaseTablePrefix(tableName); Connection connection = null; try { connection = sqlSession.getConnection(); DatabaseMetaData databaseMetaData = connection.getMetaData(); ResultSet tables = null; String schema = this.connectionMetadataDefaultSchema; if (dbSqlSessionFactory.getDatabaseSchema()!=null) { schema = dbSqlSessionFactory.getDatabaseSchema(); } String databaseType = dbSqlSessionFactory.getDatabaseType(); if (DbSqlSessionFactory.POSTGRES.equals(databaseType)) { tableName = tableName.toLowerCase(); } try { tables = databaseMetaData.getTables(this.connectionMetadataDefaultCatalog, schema, tableName, JDBC_METADATA_TABLE_TYPES); return tables.next(); } finally { if (tables != null) { tables.close(); } } } catch (Exception e) { throw LOG.checkDatabaseTableException(e); } }