findUserTaskInstances error while using workflow
PostPosted:Mon Feb 04, 2013 8:02 am
Hello,
I'm using OpenKM 6.2.2 (build 7815) tomcat bundle version on Windows.
Here is my workflow process definition:
When I assign workflow dx_process to Test Document.docx I get the run_config form.
I fill in description and it goes to the next node - task1.
As soon as I get to this node I get the error: Error when communicating with server (findUserTaskInstances).
Here is stacktrace:
I'm using OpenKM 6.2.2 (build 7815) tomcat bundle version on Windows.
Here is my workflow process definition:
Code: Select all
Here is forms.xml:
<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="dx_process">
<start-state name="start">
<transition to="task1" name="totask1"></transition>
</start-state>
<task-node name="task1">
<task name="dx_task">
<description>okmAdmin should approve/deny the request.</description>
<assignment actor-id="okmAdmin"></assignment>
</task>
<transition to="approve" name="toapprove"></transition>
<transition to="deny" name="todeny"></transition>
</task-node>
<state name="approve">
<description>Request has been approved.</description>
<event type="node-enter">
<action name="approveAction"
class="com.openkm.workflows.DXProcess.ApproveHandler"></action>
</event>
<transition to="end"></transition>
</state>
<state name="deny">
<description>Request has been denied.</description>
<event type="node-enter">
<action name="denyAction" class="com.openkm.workflows.DXProcess.DenyHandler"></action>
</event>
<transition to="end"></transition>
</state>
<end-state name="end"></end-state>
</process-definition>Code: Select all
And here are handler Classes:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow-forms PUBLIC "-//OpenKM//DTD Workflow Forms 2.0//EN"
"http://www.openkm.com/dtd/workflow-forms-2.0.dtd">
<workflow-forms>
<workflow-form task="run_config">
<textarea name="description" label="Description"/>
<button name="submit" label="Send" transition="totask1" />
</workflow-form>
<workflow-form task="dx_task">
<textarea label="Description" name="description" data="description" readonly="true" />
<button name="approve_button" label="Approve" transition="toapprove" />
<button name="deny_button" label="Deny" transition="todeny" />
</workflow-form>
</workflow-forms>Code: Select all
andpackage com.openkm.workflows.DXProses;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
import com.openkm.api.OKMAuth;
import com.openkm.api.OKMDocument;
public class ApproveHandler implements ActionHandler {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public void execute(ExecutionContext executionContext) throws Exception {
try {
String originalFileName = "/okm:root/dx/Test document.docx";
String destFileName = "/okm:root/approved/";
String token = OKMAuth.getInstance().login("okmAdmin", "admin");
OKMDocument.getInstance().move(token, originalFileName, destFileName);
}
catch (Exception e) {
e.printStackTrace();
}
}
}Code: Select all
package com.openkm.workflows.DXProses;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
import com.openkm.api.OKMAuth;
import com.openkm.api.OKMDocument;
public class DeclineHandler implements ActionHandler {
/**
*
*/
private static final long serialVersionUID = 2L;
@Override
public void execute(ExecutionContext executionContext) throws Exception {
try {
String originalFileName = "/okm:root/dx/Test document.docx";
String destFileName = "/okm:root/denied/";
String token = OKMAuth.getInstance().login("okmAdmin", "admin");
OKMDocument.getInstance().move(token, originalFileName, destFileName);
} catch (Exception e) {
e.printStackTrace();
}
}
}When I assign workflow dx_process to Test Document.docx I get the run_config form.
I fill in description and it goes to the next node - task1.
As soon as I get to this node I get the error: Error when communicating with server (findUserTaskInstances).
Here is stacktrace:
Code: Select all
Why do I get this error on task1?2013-02-04 19:57:04,284 [http-bio-192.168.0.50-8080-exec-2] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/OpenKM] - Exception while dispatching incoming RPC call
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.jbpm.bytes.ByteArray.byteBlocks, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:368)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111)
at org.hibernate.collection.PersistentList.hashCode(PersistentList.java:490)
..................
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)