Description of problem: Currently we do a DMO rebuild everytime a rule is saved. This is because we use this to get the rule names for the different dropdowns in our guided editors. Building a DMO is how ever heavy and we should try to avoid this. A better solution is to parse the rule from a generated DRL each time we do a rule file save. Rule file types are .rdrl, .drl, .gdst and so on.
This ticket needs to be included in 6.0.1.
*** Bug 1045358 has been marked as a duplicate of this bug. ***
master: https://github.com/droolsjbpm/guvnor/commit/f416da94c2153e50a81eabf078eb603d1d182e31 https://github.com/droolsjbpm/guvnor/commit/ee104c1dcf308928d13bade95ffa40776b47333a https://github.com/droolsjbpm/kie-wb-common/commit/e496fd2b5043d2991e7c96982a33e20eaf3aae7f https://github.com/droolsjbpm/kie-wb-common/commit/6dda6e584636440fa14f9f3473f7a2735559ee35https://github.com/droolsjbpm/kie-wb-common/commit/fe9af8a36eebf91a2a5d73a2568702c533c2629e https://github.com/droolsjbpm/kie-wb-common/commit/1d2d55bab3de264560ad6fc108a0461ce64da7cc https://github.com/droolsjbpm/kie-wb-common/commit/63125805b2b1d98f647310c01c753ac902d82dd5 https://github.com/droolsjbpm/kie-wb-common/commit/3b3e67c0e1ffa2383effccf45d71dab3c9520cc2 https://github.com/droolsjbpm/kie-wb-common/commit/47bc8d640994752fa90e573e943041432d9c8a1b https://github.com/droolsjbpm/drools-wb/commit/49db7190a38c7aed554d794aab9a5b81f380ff95 https://github.com/droolsjbpm/drools-wb/commit/c787c4b66608b8c071d824e5b59b16291da261c6 https://github.com/droolsjbpm/drools-wb/commit/215f122d22dec741ad8b67b67118e21b14643357 6.0.x: https://github.com/droolsjbpm/guvnor/commit/4c1e1066b8a8842575092982e5a66592b215f267 https://github.com/droolsjbpm/guvnor/commit/4b7ba6d91ce0aed9c4863683064b8a002bc3e0a8 https://github.com/droolsjbpm/kie-wb-common/commit/3ed96ccc08e6f97e53410f796af1f52fa0a1b4c9 https://github.com/droolsjbpm/kie-wb-common/commit/1badfd0defa5d8279396bc0482ac6edb8ace0a1d https://github.com/droolsjbpm/kie-wb-common/commit/5fad2af19b02ce0c22207fa8aa40b97c3ff5c2f8 https://github.com/droolsjbpm/kie-wb-common/commit/e96e563666c26031df29c115f31ea26f51c2322c https://github.com/droolsjbpm/kie-wb-common/commit/d631cdfa89da7560d1ada591d8c36e508baa68c2 https://github.com/droolsjbpm/kie-wb-common/commit/8f4229486a5d7be88b6fe5f9efaa3f196cda1e9d https://github.com/droolsjbpm/kie-wb-common/commit/c6b76ebda2064390c3151434460bba5995e83302 https://github.com/droolsjbpm/drools-wb/commit/a033a046c3b6ee18137f57bba19a51b8a3f232e3 https://github.com/droolsjbpm/drools-wb/commit/77499340190659b33c80df08c17f53ff7ec32622 https://github.com/droolsjbpm/drools-wb/commit/3a074ce08aa7b743b7e0837fb1925d863529a13c
More tests just to verify the code works. No fix was needed. master: https://github.com/droolsjbpm/kie-wb-common/commit/6e76dfd7e 6.0.x: https://github.com/droolsjbpm/kie-wb-common/commit/193c16818
ClassCastExceptions fixed. master: https://github.com/droolsjbpm/drools-wb/commit/4cbf9f636 6.0.x: https://github.com/droolsjbpm/drools-wb/commit/4c26b8398
Rule Name service was searching for rules inside dot files. Those should be ignored. Fix is here. master https://github.com/droolsjbpm/kie-wb-common/commit/dea975e02 6.0.x https://github.com/droolsjbpm/kie-wb-common/commit/64ccd08cd
After consulting Toni, this seems not to be fixed completely as the following statement is still logged after saving a rule file: 17:02:26,854 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (pool-11-thread-4) KieModule was added:MemoryKieModule[ ReleaseId=mortgages:mortgages:0.0.1] Moreover, although it may not be related, the commit https://github.com/droolsjbpm/kie-wb-common/commit/64ccd08cd from comment 7 is not included in ER2 build since it was made after ER2 sync tagging.
Looks like part of the problem is that I didn't remove the rule formats from ResourceChangeObserver observables. The actual rule names should be working correctly and Builder no longer updates these for the DMO/rule name service, just the lines here are causing a rebuild. https://github.com/droolsjbpm/guvnor/blob/master/guvnor-project/guvnor-project-builder/src/main/java/org/guvnor/common/services/builder/ResourceChangeObserver.java#L156
> 17:02:26,854 INFO [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] > (pool-11-thread-4) KieModule was added:MemoryKieModule[ > ReleaseId=mortgages:mortgages:0.0.1] > This can still be seen in the logs. However since the lines mentioned in Comment 9 are removed the DMO cache is not invalidated and there is no need for a DMO rebuild. Rebuild for the KBase is needed since any file added into the project goes into the KBase. master: https://github.com/droolsjbpm/guvnor/commit/ce2b348ac 6.1.x https://github.com/droolsjbpm/guvnor/commit/cf52c79ac5a02fe7660814475f6326b4244efeca
I have created different rule types and saved them a couple of times and I haven't seen DMO rebuild in the logs. Only "KieModule was added..." messages have been present when I have tried to validate the rules etc. Therefore I will mark it as verified (on 6.1.0.CR1).