class CaseRuntimeDataServiceImpl implements CaseRuntimeDataService, DeploymentEventListener {

    @Override
    public Collection<ProcessDefinition> getProcessDefinitions(QueryContext queryContext) {
        Collection<ProcessDefinition> cases = availableProcesses.stream()
                .filter(caseDef -> caseDef.isActive())
                .sorted(new ProcessDefinitionComparator(queryContext.getOrderBy(), queryContext.isAscending()))
                .skip(queryContext.getOffset())
                .limit(queryContext.getCount())
                .collect(toList());
        return cases;
    }

    public  CaseRuntimeDataServiceImpl();

}