|
@@ -45,9 +45,9 @@ public class RuleInstanceService extends GenericReactiveCrudService<RuleInstance
|
|
return this.ruleEngine
|
|
return this.ruleEngine
|
|
.shutdown(id)
|
|
.shutdown(id)
|
|
.then(createUpdate()
|
|
.then(createUpdate()
|
|
- .set(RuleInstanceEntity::getState, RuleInstanceState.stopped)
|
|
|
|
- .where(RuleInstanceEntity::getId, id)
|
|
|
|
- .execute())
|
|
|
|
|
|
+ .set(RuleInstanceEntity::getState, RuleInstanceState.stopped)
|
|
|
|
+ .where(RuleInstanceEntity::getId, id)
|
|
|
|
+ .execute())
|
|
.then();
|
|
.then();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -62,17 +62,17 @@ public class RuleInstanceService extends GenericReactiveCrudService<RuleInstance
|
|
return ruleEngine
|
|
return ruleEngine
|
|
.startRule(entity.getId(), model)
|
|
.startRule(entity.getId(), model)
|
|
.then(createUpdate()
|
|
.then(createUpdate()
|
|
- .set(RuleInstanceEntity::getState, RuleInstanceState.started)
|
|
|
|
- .where(entity::getId)
|
|
|
|
- .execute()).then();
|
|
|
|
|
|
+ .set(RuleInstanceEntity::getState, RuleInstanceState.started)
|
|
|
|
+ .where(entity::getId)
|
|
|
|
+ .execute()).then();
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Mono<Integer> deleteById(Publisher<String> idPublisher) {
|
|
public Mono<Integer> deleteById(Publisher<String> idPublisher) {
|
|
return Flux.from(idPublisher)
|
|
return Flux.from(idPublisher)
|
|
- .flatMap(id -> this.stop(id).thenReturn(id))
|
|
|
|
- .as(super::deleteById);
|
|
|
|
|
|
+ .flatMap(id -> this.stop(id).thenReturn(id))
|
|
|
|
+ .as(super::deleteById);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -81,7 +81,12 @@ public class RuleInstanceService extends GenericReactiveCrudService<RuleInstance
|
|
.where()
|
|
.where()
|
|
.is(RuleInstanceEntity::getState, RuleInstanceState.started)
|
|
.is(RuleInstanceEntity::getState, RuleInstanceState.started)
|
|
.fetch()
|
|
.fetch()
|
|
- .flatMap(this::doStart)
|
|
|
|
|
|
+ .flatMap(e -> this
|
|
|
|
+ .doStart(e)
|
|
|
|
+ .onErrorResume(err -> {
|
|
|
|
+ log.warn("启动规则[{}]失败", e.getName(), e);
|
|
|
|
+ return Mono.empty();
|
|
|
|
+ }))
|
|
.subscribe();
|
|
.subscribe();
|
|
}
|
|
}
|
|
}
|
|
}
|