How to configure KieSession with Pseudo Clock in Spring application context?

Solution Verified - Updated -

Issue

When Spring application context includes following config:

<kie:kmodule id="drools">
        <kie:kbase name="KieBase_TestEventTimingAgendaEventListener"
            eventProcessingMode="stream" equalsBehavior="equality"
            packages="sample.package">
            <kie:ksession name="KieSession_TestEventTimingAgendaEventListener"
                clockType="pseudo" type="stateful">

Then following call:

SessionPseudoClock clock = session.getSessionClock();

ends up with exception:

java.lang.ClassCastException: org.drools.core.time.impl.JDKTimerService cannot be cast to org.drools.core.time.SessionPseudoClock

How to correctly configure pseudo clock in Drools/jBPM when using Spring?

Environment

  • Red Hat JBoss BRMS, BPM Suite
    • 6.0.x
    • 6.1.x
    • 6.2.x
    • 6.3.0
    • 6.3.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.