use of org.jbpm.kie.services.impl.query.persistence.PersistDataSetListener in project jbpm by kiegroup.
the class QueryServiceImpl method init.
public void init() {
if (dataSetDefRegistry == null && dataSetManager == null && providerRegistry == null) {
dataSetDefRegistry = DataSetCore.get().getDataSetDefRegistry();
dataSetManager = DataSetCore.get().getDataSetManager();
providerRegistry = DataSetCore.get().getDataSetProviderRegistry();
providerRegistry.registerDataProvider(SQLDataSetProvider.get());
dataSetDefRegistry.addListener(new PersistDataSetListener(commandService));
}
// load previously registered query definitions
if (commandService != null) {
List<QueryDefinitionEntity> queries = commandService.execute(new QueryNameCommand<List<QueryDefinitionEntity>>("getQueryDefinitions"));
for (QueryDefinitionEntity entity : queries) {
QueryDefinition definition = entity.toQueryDefinition();
try {
registerQuery(definition);
} catch (QueryAlreadyRegisteredException e) {
logger.debug("Query {} already registered, skipping...", definition.getName());
}
}
}
}
Aggregations