Search in sources :

Example 1 with SessionLocator

use of com.salaboy.sessions.patterns.SessionLocator in project jBPM5-Developer-Guide by Salaboy.

the class MultiSessionsPatternsTest method createProcessOneKnowledgeSessionAndRegister.

private StatefulKnowledgeSession createProcessOneKnowledgeSessionAndRegister(String key, BusinessEntity interactionSessionEntity, EntityManager em) {
    final StatefulKnowledgeSession ksession = this.createProcessOneKnowledgeSession(key);
    // Registering a SessionLocator inside the interaction Session
    StatefulKnowledgeSession interactionSession = loadKnowldgeSession(interactionSessionEntity.getSessionId(), interactionSessionEntity.getBusinessKey(), em);
    Map<String, String> props = new HashMap<String, String>();
    props.put("process", "com.salaboy.process.AsyncInteractions");
    SessionLocator sessionLocator = new SessionLocator(ksession.getId(), key);
    sessionLocator.setProps(props);
    interactionSession.insert(sessionLocator);
    interactionSession.dispose();
    return ksession;
}
Also used : SessionLocator(com.salaboy.sessions.patterns.SessionLocator) HashMap(java.util.HashMap) StatefulKnowledgeSession(org.drools.runtime.StatefulKnowledgeSession)

Aggregations

SessionLocator (com.salaboy.sessions.patterns.SessionLocator)1 HashMap (java.util.HashMap)1 StatefulKnowledgeSession (org.drools.runtime.StatefulKnowledgeSession)1