Is there a way to inserting (and removing) rules at runtime using the Drools-Camel component ?
According to these two you can only insert facts.
https://issues.jboss.org/browse/JBRULES-2804
https://github.com/droolsjbpm/droolsjbpm-integration/blob/master/drools-camel/src/test/java/org/drools/camel/component/CamelEndpointActionInsertTest.java
If there is no support for doing this in the drools-camel component what other options are there for inserting and removing rules at runtime.
thanks.
drools-camel uses drools-spring. drools-spring can use a KnowledgeAgent spring configuration to get its KnowledgeBase from Guvnor. Guvnor can be used to add or remove rules.
As for this date, I couldn't find a way to achieving this in camel-drools component.
Related
I have this enabled in my database config. Which enabled to fetch Audit logs with the help of JPA methods. (spring-data-envers) is being used in POM for this
#EnableJpaRepositories(
repositoryFactoryBeanClass = EnversRevisionRepositoryFactoryBean.class)
Now I want to use jquery datatable's back-end processing. For this I will be using (spring-data-jpa-datatables) in my POM.
#EnableJpaRepositories(repositoryFactoryBeanClass = DataTablesRepositoryFactoryBean.class)
How can I use both of them in one Single Project.
DataTablesRepositoryFactoryBean seems to be rather simple.
It performs a simple check and then does it's own thing or invokes super, i.e. JpaRepositoryFactoryBean
By reimplementing that but inheriting from EnversRevisionRepositoryFactoryBean instead you should be able to use both in one project.
Is there a way to add Validation to a property on my VM "dynamically" (i.e. sometime after I register the initial rules on the VM)?
Currently, I'm registering the rules in the constructor of the VM, then a little while later, after the user has entered a bunch of data, I need to show a new field (using if.bind) and want to add validation depending on the result of a web api call..
Wondering if there's an API for this that I've missed?
You can achieve it without dynamically adding rule but instead you can use satisfiesRule and when, see it here in section Conditional Validation. satisfiesRule will only evaluated if the property that attached to it is already pass.
when will only evaluated the rule if the condition is true.
Additional link.
If you're using bootstrap, you can find this useful.
I want to create a directive / component which will provide it's own translations to the translate provider. So I wonder if there is a way to manipulate/add keys to the translationTable object within directive. Something like $translatePartialLoader.addPart('{ "MY_TEST_VAR": "This is test"}') to the preferred language.
Currently there is a discussion about it at
https://github.com/angular-translate/angular-translate/issues/316.
I want to do custom configuration parameters in config.yml
Example:
In config.yml file
security_enhancement:
authentication:true
authorization:true
In same format like swiftmailer configuration etc.I'm not getting idea how to define.
I'm getting error like:
1/2 ParseException: Unable to parse in "\/var\/www\/demo\/app\/config\/config.yml" at line 217 (near "authentication:true").
Am I missing something here? Is it necessary to add in depending injection extension file? .Actually I want to enable disable authentication,authorization execution during dev mode which is implemented in listener which can be done using config_dev.yml . I don't want to add under Parameters. Any suggestions?
As you've rightly theorised, you do indeed need to add in DI extension files, assuming your configuration relates to particular bundles (which it almost certain will).
Whilst parameters can simply be defined at will, configuration features hierarchical structure and validation.
Usually, configuration is used to in turn, define parameters, but it allows for the values to be parsed and validated prior to their instantiation, so that bundle writers can provide better guidance as to how their services can be used (with meaningful errors), and trust the values that are being passed into them.
A decent read on how to get started with config component can be found in the Symfony2 docs: defining and processing configuration files with the config component.
In each of my domains I have defined a custom sequence inside the static mapping closure:
static mapping = {
version false
id generator:'sequence', params:[sequence:'MY_SEQ']
}
When I create the database, the MY_SEQ sequence is there, however grails also still makes a default hibernate_sequence. How do I get grails to not make the default, and be certain that it is using my custom sequence? Is this common for Grails to generate a default even though it won't get used?
It is common and it comes from Hibernate by default, it's not a grails' thing. There's even a JIRA open for that, but still unresolved.
You could try to extend the dialect though! You can find a code that is kinda same thing you want in this topic.
About being sure if the table is using the specified sequence, it should, given the way you did it.