JBoss Community

Re: How to persist a timer

created by Stefan Krause in jBPM - View the full discussion

Thanks for your help so far! I found that the problem occurs when I recreate the KnowledgeBase. If I keep the KnowledgeBase (e.g. in a member variable) I can recreate the session with JPAKnowledgeService.loadStatefulKnowledgeSession and everything is fine.

 

Here's how I create the KnowledgeBase:

{code}

KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

kbuilder.add(ResourceFactory.newClassPathResource("TimerPersistence.bpmn2"), ResourceType.BPMN2);

KnowledgeBase knowledgeBase = kbuilder.newKnowledgeBase();

{code}

 

How can I handle recreation of the KnowledgeBase e.g. in a web app when I run in a new java process?

Reply to this message by going to Community

Start a new discussion in jBPM at Community