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&...]