Bing Lim [
https://community.jboss.org/people/binglim] created the discussion
"Re: How do you implement data persistence in jbpm5 and simulate multiple trials in
between nodes?"
To view the discussion, visit:
https://community.jboss.org/message/749717#749717
--------------------------------------------------------------
Thanks a lot for the reply.
1) Below is the error message I get from running the example:
23/07 14:25:55,418[main] ERROR hibernate.impl.SessionFactoryImpl.<init> - Error
in named query: ProcessInstancesWaitingForEvent
org.hibernate.hql.ast.QuerySyntaxException: ProcessInstanceInfo is not mapped [select
processInstanceInfo.processInstanceId from ProcessInstanceInfo processInstanceInfo where
:type in elements(processInstanceInfo.eventTypes)]
at
org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:181)
at
org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:110)
at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:94)
at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:316)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3228)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3112)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:720)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:571)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:288)
at
org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:231)
at
org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:254)
at
org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:185)
at
org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at
org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94)
at
org.hibernate.impl.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:484)
at
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:394)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
at
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at
org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
at
org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
at com.sample.HelloProcessTest.main(HelloProcessTest.java:43)
javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.task] Unable to build
EntityManagerFactory
Aside from this example, is there an easier way to implement database persistence?
2) I am designing a worklow process that simulates writing a file to an archive and it is
relevant for business, so it would be better if it is easy to understand.
When the task exceeds a certain time limit, it will enter a human task to prompt the
user if he would like to retry or cancel the task, therefore requires the looping.
Is there a specific node that can implement that function?
3) Is it possible to get ksession from an external process without passing in the
StatefulKnowledgeBaseSession as a parameter?
To do signaling from an external source, I need to execute ksession.signalEvent(type,
eventData);
But I do not want the external process to know the ksession directly by passing it in
as a parameter. So is it possible to obtain the ksession from WorkItem or
WorkItemManager?
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/749717#749717]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]