1) did you check out the documentation? what are you trying to achieve with persistence? if you have a long running process, the documentation should help you to get things set up.
Are you using maven? can you share what's the problem in your project? what do you mean with is not working?
2) You have different options:
a) Do you really need to draw your retrying mechanisms? Is it relevant for the business? or is just a technical detail?
If it's a technical concern, you should probably better not draw it in the process file and delegate that logic to the work item hanlder that is in charge of that interaction.
b) you can model it in the diagram using gateways
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)]
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
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?
1) you don't need to implement persistence, you just need to configure it to work in your environment. if you take a look at the error that you paste here, you will notice that is a JPA error, not a jBPM error.
So you need to check your persistence.xml file and the persistence unit defined inside it. But this is a java question, not specific to jBPM. The error in this case is saying that you have a JPQL (JPA query) which uses the ProcessInstanceInfo and you don't have that entity defined as an entity inside the persistence unit configuration.
2) So, as far as I understand you want to execute an automatic activity, which is writing a file and then a human task to control that right? Then the loop can be implemented with a ServiceTask + a HUman task and the required gateways to draw the loop.
3) If you are using persistent session, you should pass the persisted session ID in order to restore your session and then be able to signal an event. Notice that the event is being signaled at session level, which means that you can do much more things that just signaling a specific process instance.
Thanks a lot for the reply.
1) However, I do not know how to configure a persistence.xml to enable persistence in my environment. Is there a detailed and simple to understand example that I can use as a reference?
2) I used gateways to draw the workflow but it's too messy and confusing. Is there a node that can handle the looping and make it look neater, just like in JBPM4?
I have attached the whole zip file if you need any other information.
Thank you for your time and assistance!
ArchiveWriteTest.zip 36.1 KB