[jBPM] - Re: Host property for jbpm5 console
by cold_burn
cold_burn [https://community.jboss.org/people/cold_burn] created the discussion
"Re: Host property for jbpm5 console"
To view the discussion, visit: https://community.jboss.org/message/719898#719898
--------------------------------------------------------------
I'm sorry to dig this thread up, but I did this with JBPM 5.2.0 on Jboss 7.0.2, but it didn't work.
The instructions said here are similar to what is being said on this link:
http://bpmgeek.com/blog/making-jbpm5-work-remote-host http://bpmgeek.com/blog/making-jbpm5-work-remote-host
Doing either instructions doesn't allow the access to the JBPM interfaces (console, designer or guvnor) on a remote machine.
On my case I find it necessary to also modify the following files to be able to access remotely, +*although barely*+, to JBPM:
Location:
C:\JBPM\jbpm-installer\jboss-as-7.0.2.Final\standalone\configuration
standalone.xml
standalone-ha.xml
standalone-preview.xml
standalone-preview-ha.xml
standalone-xts.xml
Modification done: Changed 127.0.0.1 to Static IP of the server.
I say, "+*although barely*+" because becomes possible to access the JBPM interfaces from a remote machine, but several errors occur.
Those are:
Loading Tasks: Exception "Could not connect task client"
Loading Processes: Exception "Could not connect task client"
Loading Reporting area says "Reporting Engine does not seem to be running."
These errors also happen on the server SO environment.
Those errors don't show up when a 127.0.0.1 configuration is in place.
Technical information:
JBPM 5.2.0
Jboss 7.0.2
Windows Server 2003 x64
jdk1.6.0_25 x86
So, if you can help me it would be great. Don't know what I'm doing wrong.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/719898#719898]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
14 years, 1 month
[jBPM] - Re: How to get WorkItemHandler results
by Esteban Aliverti
Esteban Aliverti [https://community.jboss.org/people/eaa] created the discussion
"Re: How to get WorkItemHandler results"
To view the discussion, visit: https://community.jboss.org/message/719789#719789
--------------------------------------------------------------
> The application I'm making makes the interaction with the user through the web designer. Therefore I'll need to run the process definition in a Servlet. As such I'm startin the process within the Servlet and the WorkItemHandler will be returning information to be sent to the user. As such isn't this the only way to do it? Because executeWorkItem is void I can't send it to the Servlet...right?
The WorkItemHanlder always returns information to the process. If you map the return of your Handler to a process variable, you can get the value of that variable right after you do session.startProcess() (assuming there is no intermediate wait-state before your Work Item). So, the process will start, it will exectue the WI Handler, the Handler will create the result and complete the WI (passing the result) the result will be map to a process variable (because you explicitly defined this mapping) and then, the process will continue until it reaches a wait-state or an End Event Node. At this point, the control will be returned to your servlet where you can read the pocess variable value.
There are possibly more than 100 other ways to do this same thing. Pass some listener to the WI Handler that will be invoked when the result is ready, use JMS to communicate the Handler and your code, etc.
> My other one is the web app is running in jBoss and although there shoudln't e problems mixing jBpm and jBoss web I'm having some troubles. I get:
> java.lang.ClassNotFoundException: org.drools.runtime.process.WorkItemHandler
> When deploying the application. What can I do?
Which dependencies are you defining in your app? You should also include some of the drools dependencies:
<dependency>
<groupId>org.drools</groupId>
<artifactId>knowledge-api</artifactId>
<version>5.4.0-SNAPSHOT</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
<version>5.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>5.4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-bpmn2</artifactId>
<version>5.3.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-flow</artifactId>
<version>5.3.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-flow-builder</artifactId>
<version>5.3.0-SNAPSHOT</version>
</dependency>
Best Regards,
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/719789#719789]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
14 years, 1 month
[jBPM] - Re: How to make a process instance go on with jBPM5?
by Jesus De Oliveira
Jesus De Oliveira [https://community.jboss.org/people/jesus.deoliveira] created the discussion
"Re: How to make a process instance go on with jBPM5?"
To view the discussion, visit: https://community.jboss.org/message/719772#719772
--------------------------------------------------------------
Hi,
I also have found that you must force to complete the WorkItem after completing a human task.
A more detailed and a little bit cleaner version of Melih and Donald approach also works perfectly, even when the human task server is running on a separate thread or JVM, provided that the process engine JPA persistence is correctly configured and the original statefull knowledge session is restored upon start-up. Some boilerplate code intentionally omitted for the sake of simplicity:
// If no previous statefull knowledge session exists public void createStatefullKnowledgeSession() { //... create kbase, load process definitions, etc ... EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.persistence.jpa"); Environment env = KnowledgeBaseFactory.newEnvironment(); env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf); env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager()); ksessionStatefull = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env); int sessionId = ksessionStatefull.getId(); // *** STORE sessionId SOMEWHERE PERSISTENTLY, to be able to // recover this session later upon services restart }
public void loadStatefullKnowledgeSession() {
//... create kbase, load process definitions, etc ...
EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.persistence.jpa");
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager());
// *** RECOVER sessionId FROM PERSISTENT STORAGE
// and use it here to recover persisted process engine state
ksessionStatefull = JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId, kbase, null, env);
}
public void complete(long taskId, String userName)
throws Exception {
// ... create the TaskClient (client), and connect it to the task server ...
// first mark the task as completed on the task server
taskOperationHandler = new BlockingTaskOperationResponseHandler();
client.complete(taskId, userName, null, taskOperationHandler);
taskOperationHandler.waitTillDone(1000);
// then retrieve the task to extract the workItemId, where the process instance is waiting
BlockingGetTaskResponseHandler responseHandler = new BlockingGetTaskResponseHandler();
client.getTask(taskId, responseHandler);
responseHandler.waitTillDone(1000);
Task task = responseHandler.getTask();
// force completition of the workItem associated with the task, on which the process instance is waiting
final Map<String, Object> results = new HashMap<String, Object>();
ksessionStatefull.getWorkItemManager().completeWorkItem(task.getTaskData().getWorkItemId(), results);
}
Hope this will be useful to anyone, best regards!
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/719772#719772]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
14 years, 1 month