[rules-users] Protobuf Marshaller Question (ScheduledActivation Persistence)

Philipp Herzig pherzig at gmail.com
Mon Oct 1 13:04:47 EDT 2012


Dear developers,

Unfortunately, I was not able to solve this problem yet. However, I
found another issue that seems to be related.
More precisely, when I try to delete the rules that led to the
ScheduledActivations (which are not fired after unmarshalling, i.e.,
there are "orphan" activations on the agenda) I get the following
trace:

java.lang.NullPointerException
	at org.drools.time.impl.JDKTimerService.removeJob(JDKTimerService.java:134)
	at org.drools.reteoo.RuleTerminalNode$RTNCleanupAdapter.cleanUp(RuleTerminalNode.java:524)
	at org.drools.reteoo.BetaNode.doRemove(BetaNode.java:454)
	at org.drools.common.BaseNode.remove(BaseNode.java:106)
	at org.drools.reteoo.RuleTerminalNode.doRemove(RuleTerminalNode.java:410)
	at org.drools.common.BaseNode.remove(BaseNode.java:106)
	at org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:261)
	at org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:459)
	at org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:1106)
	at org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:1084)
	at org.drools.impl.KnowledgeBaseImpl.removeRule(KnowledgeBaseImpl.java:208)

Obviously, there is still a connection between the unfired activations
and the rule.

Since some time ago I've successfully used the JPAKnowledgeService, I
looked into the code and found a line in initKSession which looks
promising:


((AcceptsTimerJobFactoryManager) ((InternalKnowledgeRuntime)
ksession).getTimerService()).getTimerJobFactoryManager().setCommandService(
this );


I kindly wanted to ask, if somebody can explain the implications of
this codeline with regards to the ScheduledActivations.


I would be still happy, if someone could help me.

Thanks,

Philipp


2012/9/3 Philipp Herzig <pherzig at gmail.com>:
> Alright, one step further.
>
> I retrieved the current agenda via
>
> InternalAgenda agenda = ((AgendaImpl)session.getAgenda()).getAgenda();
>
> before marshalling and after unmarshalling.
> Now its great, all my example ScheduledActivations are successfully
> unmarshalled to the agenda. However, they are not fired for some
> reason?
> I call fireAllRules after recreating the session.
>
> Sorry for spaming but I hope this helps someone to get me into the
> right direction.
>
> Thanks again,
>
> Philipp
>
>
>
> ---------- Forwarded message ----------
> From: Philipp Herzig <pherzig at gmail.com>
> Date: 2012/9/3
> Subject: Re: Protobuf Marshaller Question (ScheduledActivation Persistence)
> To: Rules Users List <rules-users at lists.jboss.org>
>
>
> Maybe one addition to that. Currently I am working on 5.4.0.CR1 but
> same applies to me for all versions until 5.3.2.Final including
> 5.4.0.Final (since obviously the protobuf impl has been introduced in
> 5.3.2).
>
> Thanks again,
>
> Philipp
>
> 2012/9/3 Philipp Herzig <pherzig at gmail.com>:
>> Dear developers,
>>
>> I believe this is a question for Edson.
>>
>> I wonder if ScheduledActivations are added to the Agenda when
>> unmarshalling an existing session and fired as well, e.g., non-expired
>> timers.
>>
>> I guess that this worked with the DefaultMarshaller implementation (at
>> least I can see LOCs in the InputMarshaller where normal or scheduled
>> activations are added to the newly created agenda). I cannot find
>> similar code in the ProtobufMarshaller or, more precisely, the
>> ProtobufInputMarshaller.
>>
>> I also tried to override MarshallerProvider in order to use the
>> DefaultMarshaller but that is obviously not-consistent
>> (ClassCastException) with the current codebase anymore.
>>
>> Hopefully, I am doing/understanding sth. completely wrong here.
>>
>> Thanks for any help regarding this issue,
>>
>> Philipp


More information about the rules-users mailing list