[jboss-jira] [JBoss JIRA] (DROOLS-1252) java.lang.ClassCastException: event cannot be cast to org.drools.core.common.InternalFactHandle
Michael Neifeld (JIRA)
issues at jboss.org
Wed Aug 10 10:03:00 EDT 2016
Michael Neifeld created DROOLS-1252:
---------------------------------------
Summary: java.lang.ClassCastException: event cannot be cast to org.drools.core.common.InternalFactHandle
Key: DROOLS-1252
URL: https://issues.jboss.org/browse/DROOLS-1252
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 6.4.0.Final
Environment: Drools 6.4.Final
Fusion (CEP)
Reporter: Michael Neifeld
Assignee: Mario Fusco
Priority: Blocker
Attachments: RULES_ERRORS.log, Rule_Emergency_Network_Start_No_Active_Call_Rule523993873.java
It seems to be similar to another bug DROOLS-1185, but without any Modify.
this is the rule:
{code:java}
declare EmergencyNetworkComplexEvent
@role(event)
@timestamp(timestamp)
@expires(1h)
end
...
global Logger dlogger;
.....
rule "Emergency Network Start No Active Call Rule" //EMERGENCY
salience 90
// no-loop true
when
//conditions
$event : EmergencyNetworkComplexEvent( transition == Transition.START)
$predecessor : CallComplexEvent( radioID == $event.radioID )
not ( EmergencyActiveCallComplexEvent( getTransition() == Transition.START, getCallID() == $event.callID )
or EmergencyActiveCallComplexEvent( getTransition() == Transition.START, getRadioID() == $event.radioID ))
then
if (dlogger.isTraceEnabled()) dlogger.trace("Emergency Network Start No Active Call Rule: receiving {}, {}",$event, $predecessor);
// action: create container, add the event to the container
EmergencyActiveCallComplexEvent container = new EmergencyActiveCallComplexEvent($event);
insert(container);
delete($event); // ???
if (dlogger.isTraceEnabled()) dlogger.trace("Emergency Network Start No Active Call Rule: after delete {}",$event);
//actions: register new active call, new emergency call
new ActiveCallSnapshot().addCall($event);
final EmergencyEventSnapshot snapshot = new EmergencyEventSnapshot();
snapshot.addEmergencyCall($event);
//actions: get preceding event and add it to trail
snapshot.add2Trail($predecessor);
if (dlogger.isTraceEnabled()) dlogger.trace("Emergency Network Start No Active Call Rule: exiting {}",container);
end
{code}
and this is the classdump of this rule:
{code:java}
package com.mot.ssol.cep;
import com.mot.ssol.cep.model.ComplexEventImpl;import com.mot.nsa.monitor.client.NetworkEvent;import com.mot.ssol.cep.model.PseudoActiveCallComplexEvent;import java.util.Date;import com.mot.nsa.monitor.client.CallEvent.ChannelStatus;import com.mot.ssol.cep.model.ControlCallComplexEvent;import com.mot.nsa.monitor.client.GaugeValue;import org.apache.commons.lang3.StringUtils;import com.mot.ssol.cep.TDMAResolver;import com.mot.ssol.cep.model.CEPEvent;import com.mot.ssol.cep.*;import com.mot.ssol.cep.model.InactiveCallComplexEvent;import org.kie.api.runtime.rule.QueryResults;import com.mot.ssol.cep.EventBuilder;import com.mot.nsa.monitor.client.CallEvent;import com.mot.ssol.cep.model.EmergencyNetworkComplexEvent;import com.mot.nsa.monitor.analyzer.AnalyzedEvent;import com.mot.ssol.cep.TrapSnapshot;import com.mot.nsa.monitor.cepm.mapper.RadioAliasMapper;import com.mot.nsa.monitor.MutableTimestampAware;import com.mot.ssol.cep.model.NetworkComplexEvent;import com.mot.ssol.cep.model.CallComplexEvent;import com.mot.ssol.cep.model.ControlNetworkComplexEvent;import java.util.concurrent.BlockingQueue;import com.mot.nsa.monitor.cepm.model.CallCepmEvent;import java.util.concurrent.LinkedBlockingQueue;import com.mot.ssol.cep.model.GroupRegistrationComplexEvent;import com.mot.nsa.monitor.cepm.mapper.GroupAliasMapper;import com.mot.ssol.cep.model.BusyComplexEventDecorator;import java.util.List;import com.mot.ssol.cep.model.ComplexEvent.Type;import com.mot.ssol.cep.EmergencyEventSnapshot;import com.mot.nsa.monitor.cepm.mapper.ZoneMapper;import com.mot.ssol.cep.model.NetworkComplexEventImpl;import com.mot.ssol.cep.model.ChannelHandle;import com.mot.nsa.monitor.cepm.StatisticModule;import com.mot.nsa.monitor.client.ClientEvent;import com.mot.nsa.monitor.client.RadioEvent;import com.mot.ssol.cep.model.CallComplexEventImpl;import com.mot.ssol.cep.model.ChannelCallComplexEvent;import org.kie.api.runtime.rule.QueryResultsRow;import com.mot.nsa.monitor.MutableTransitionAware;import com.mot.ssol.cep.model.RadioHandle;import com.mot.ssol.cep.ActiveCallSnapshot;import com.mot.nsa.monitor.TransitionAware.Transition;import org.drools.core.spi.KnowledgeHelper;import com.mot.ssol.cep.model.PseudoRadioRegistrationComplexEvent;import com.mot.ssol.cep.model.EmergencyActiveCallComplexEvent;import com.mot.nsa.monitor.cepm.model.NonCallEvent;import org.slf4j.Logger;import com.mot.ssol.cep.model.EmergencyComplexEventDecorator;import org.apache.commons.lang3.time.DateUtils;import com.mot.nsa.monitor.client.NetworkEventImpl;import com.mot.ssol.cep.CallEventSnapshot;import com.mot.ssol.cep.model.PendingComplexEvent;import com.mot.ssol.cep.model.RadioRegistrationComplexEvent;import com.mot.ssol.cep.model.ComplexEvent;import com.mot.nsa.monitor.client.CallEventImpl;import com.mot.ssol.cep.model.ActiveCallComplexEvent;import com.mot.nsa.monitor.cepm.model.CallCepmEventImpl;import com.mot.ssol.cep.model.PseudoCallComplexEvent;import org.drools.core.spi.KnowledgeHelper;import static com.mot.ssol.cep.ClearAll.clearAll;import static com.mot.ssol.cep.EndZoneCall.endZoneCall;import static com.mot.ssol.cep.Busies2End.busies2End;import static com.mot.ssol.cep.EndCallEvents.endCallEvents;import static com.mot.ssol.cep.Events2busy.events2busy;import static com.mot.ssol.cep.EndCall.endCall;import static com.mot.ssol.cep.Emergency2end.emergency2end;
public class Rule_Emergency_Network_Start_No_Active_Call_Rule523993873 {
private static final long serialVersionUID = 510l;
public static void defaultConsequence(KnowledgeHelper drools, com.mot.ssol.cep.model.EmergencyNetworkComplexEvent $event, org.kie.api.runtime.rule.FactHandle $event__Handle__ , com.mot.ssol.cep.model.CallComplexEvent $predecessor, org.kie.api.runtime.rule.FactHandle $predecessor__Handle__ , org.slf4j.Logger dlogger ) throws java.lang.Exception { org.kie.api.runtime.rule.RuleContext kcontext = drools;
if (dlogger.isTraceEnabled()) dlogger.trace("Emergency Network Start No Active Call Rule: receiving {}, {}",$event, $predecessor);
// action: create container, add the event to the container
EmergencyActiveCallComplexEvent container = new EmergencyActiveCallComplexEvent($event);
drools.insert(container);
{ drools.delete( $event__Handle__ ); }; // ???
if (dlogger.isTraceEnabled()) dlogger.trace("Emergency Network Start No Active Call Rule: after delete {}",$event);
//actions: register new active call, new emergency call
new ActiveCallSnapshot().addCall($event);
final EmergencyEventSnapshot snapshot = new EmergencyEventSnapshot();
snapshot.addEmergencyCall($event);
//actions: get preceding event and add it to trail
snapshot.add2Trail($predecessor);
if (dlogger.isTraceEnabled()) dlogger.trace("Emergency Network Start No Active Call Rule: exiting {}",container);
}
}
{code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list