[jboss-user] [jBPM] - Re: Is WorkingMemoryLogger working?

Lukasz Kozerski do-not-reply at jboss.com
Tue Aug 23 09:30:10 EDT 2011


Lukasz Kozerski [http://community.jboss.org/people/lukasz.kozerski] created the discussion

"Re: Is WorkingMemoryLogger working?"

To view the discussion, visit: http://community.jboss.org/message/622393#622393

--------------------------------------------------------------
Yes.

I have simple method:

    private Environment environment(EntityManagerFactory emf) {
        Environment env = KnowledgeBaseFactory.newEnvironment();
        env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
        env.set(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES,
                new ObjectMarshallingStrategy[] {MarshallerFactory.newSerializeMarshallingStrategy()});
        return env;
    }

In this example logger works fine:

        environment = environment(emf);
        StatefulKnowledgeSession ksession = newSession();
        int sessionId = ksession.getId();
        Map<String, Object> parameters = new HashMap<String, Object>();
        Object object = createObject();
        parameters.put("object", object);
        ksession.insert(object);
        ksession.startProcess("process", parameters);
        ksession.fireAllRules();
        environment = environment(emf);
        ksession = loadSession(sessionId);
        KnowledgeRuntimeLoggerFactory.newConsoleLogger(ksession);
        WorkItemManager mgr = ksession.getWorkItemManager();
        mgr.completeWorkItem(workItemId, null);
        ksession.dispose();

and when I will comment this line:

        //environment = environment(emf); <- commented
        ksession = loadSession(sessionId);
        KnowledgeRuntimeLoggerFactory.newConsoleLogger(ksession);

it is not.
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/622393#622393]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110823/a7a2e064/attachment.html 


More information about the jboss-user mailing list