Page 1 of 1

findUserTaskInstances error while using workflow

PostPosted:Mon Feb 04, 2013 8:02 am
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?

Re: findUserTaskInstances error while using workflow

PostPosted:Mon Feb 04, 2013 1:45 pm
by aliism
I've found out that I get this same error whenever I try to use more that one workflow-form. Is there any limit?

Re: findUserTaskInstances error while using workflow

PostPosted:Thu Feb 07, 2013 6:29 pm
by jllort
Can you give us the par file and will be more easy to test.

Re: findUserTaskInstances error while using workflow

PostPosted:Fri Feb 08, 2013 5:52 am
by aliism
Here is the archive (.par) file.

Built upon above code.

Note: I've changed extension, because forum doesn't allow .par files to be uploaded.

Re: findUserTaskInstances error while using workflow

PostPosted:Mon Feb 11, 2013 12:40 pm
by pavila
Which database are you using? I recommend MySQL better than default bundle database.

Re: findUserTaskInstances error while using workflow

PostPosted:Wed Mar 26, 2014 11:25 pm
by matt81
Has this been solved? So is that where the issue is coming from, because they used the default database bundle.

Re: findUserTaskInstances error while using workflow

PostPosted:Sun Apr 06, 2014 9:26 am
by pavila
AS I said, I recommend MySQL better than default bundle database. jBPM has some know issues with HSQL.