• findUserTaskInstances error while using workflow

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #21243  by aliism
 
Hello,

I'm using OpenKM 6.2.2 (build 7815) tomcat bundle version on Windows.

Here is my workflow process definition:
Code: Select all
<?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>
Here is forms.xml:
Code: Select all
<?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>
And here are handler Classes:
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 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();
		}
	}
}
and
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
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)
Why do I get this error on task1?

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.