use of org.jbpm.kie.services.impl.query.persistence.QueryDefinitionEntity 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());
}
}
}
}
use of org.jbpm.kie.services.impl.query.persistence.QueryDefinitionEntity in project jbpm by kiegroup.
the class QueryServiceImpl method getQueries.
@Override
public List<QueryDefinition> getQueries(QueryContext queryContext) {
List<QueryDefinition> result = new ArrayList<QueryDefinition>();
Map<String, Object> params = new HashMap<String, Object>();
applyQueryContext(params, queryContext);
List<QueryDefinitionEntity> queries = commandService.execute(new QueryNameCommand<List<QueryDefinitionEntity>>("getQueryDefinitions", params));
for (QueryDefinitionEntity entity : queries) {
QueryDefinition definition = entity.toQueryDefinition();
result.add(definition);
}
return result;
}
Aggregations