/** * Creates the rule used for updating the results including changes in feature values. * * @param observableCollectionUpdate * the observable collection to handle * @param querySpecification * the {@link IQuerySpecification} used to create the rule */ protected static <Match extends IPatternMatch, Matcher extends ViatraQueryMatcher<Match>> RuleSpecification<Match> createUpdatingRuleSpecification( IObservablePatternMatchCollectionUpdate<Match> observableCollectionUpdate, IQuerySpecification<Matcher> querySpecification) { Set<Job<Match>> jobs = getObservableCollectionJobs(observableCollectionUpdate); Job<Match> updateJob = Jobs.newErrorLoggingJob(new SequentialProcessorsJob<Match>( CRUDActivationStateEnum.UPDATED, Arrays.asList( new ObservableCollectionProcessor<Match>(Direction.DELETE, observableCollectionUpdate), new ObservableCollectionProcessor<Match>(Direction.INSERT, observableCollectionUpdate) ))); jobs.add(updateJob); return Rules.newMatcherRuleSpecification(querySpecification, Lifecycles.getDefault(true, true), jobs); }