Hi everyone!
we have made other tow tests:
1 - As suggested by Vincent, we have just used the source gets from Guvnor
and all work fine.
In addition, it would seem that putting observations and events in the same
package all work fine!!!
2 - We have tried to put the observation in the same packet of event in
the model and the new drl becomes:
from *package* org.dfms.model; to *package* org.dfms.model.situation;
from* import* org.dfms.model.observation.ACObservation; to *import*
org.dfms.model.situation.ACObservation;
*
*
*import* org.dfms.model.situation.AccessControlEvent;
*import* org.dfms.model.situation.SituationManager;
*import* org.dfms.model.situation.Event;
*import* org.dfms.model.mapfeature.AccessControlPoint;
*import* com.vividsolutions.jts.geom.Point;
*import* com.vividsolutions.jts.geom.Geometry;
*import* java.util.HashSet;
*import* java.util.ArrayList;
*declare* ACObservation
@role(event)
*end*
*declare* AccessControlEvent
@role(event)
*end*
*rule* "AccessControl"
*no-loop*
*when*
$obs : ACObservation( $sensorid : sensorId, $location :
location ) over window:length(1) *from* entry-point access_control
*then*
*insert*( SituationManager.createAccessControlEvent( $obs, "Access
Control Detection", Event.THREAT_NO, $location, $sensorid ));
*end*
then we have loaded the pkg from Guvnor (by this link
http://localhost:8080/guvnor/org.drools.guvnor.Guvnor/package/org.dfms.mo...
)
into our application and all work fine!!!
Thank you and best regards.
Carolina
2012/7/24 Vincent LEGENDRE <vincent.legendre(a)eurodecision.com>
> Our application is using this url:
http://localhost:8080/guvnor/org.drools.guvnor.Guvnor/package/org.dfms.mo...
> to loading from Guvnor5.3.0 the pkg. Is it correct?
Yes, to get the compiled package, compiled inside Guvnor, but this is the
problem here.
The compiled package is a serialized kPackage object. When you get this
from guvnor, and put it inside your kBase, the object is simply
deserialized. The ObjectTypeConf conf.getTypeDeclaration() will look in
the kBase, and for guvnor compiled package this method returns null (don't
know why). I think you may have a difference between your Guvnor version
and the drools runtime version.
You can either use the source got from guvnor (
http://localhost:8080/guvnor/rest/packages/org.dfms.model/source) to
build your kBase, and this should work fine.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users