• Task assignment to pooled actor not working

  • 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.
 #7708  by surajaya
 
Hello All,

I'm currently trying workflow in openkm 5.0. I successfully assign task to single actor (user) but failed to assign task to group of user (pooled actor). In this sample, i'm trying to assign task to user1, user2, user3, and group of UserRole. Here is my sample process definition (processdefinition.xml) :
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<process-definition  xmlns="urn:jbpm.org:jpdl-3.2"  name="AssignmentTest">


	<start-state name="start-state1">
		<task name="testing" blocking="true">
			<description>
				testing
			</description>
			<assignment pooled-actors="group(UserRole)"></assignment>
			<controller></controller>
		</task>
		<transition to="task-node1" name="to_task1"></transition>
	</start-state>


	<task-node name="task-node1">
		<task name="task1" blocking="true">
			<description>
				Testing task1
			</description>
			<assignment actor-id="user1"></assignment>
			<controller></controller>
		</task>
		<transition to="task-node2" name="to_task2"></transition>
	</task-node>

	<task-node name="task-node2">
		<task name="task2" blocking="true">
			<description>
				Testing task2
			</description>
			<assignment actor-id="user2"></assignment>
			<controller></controller>
		</task>
		<transition to="task-node3" name="to_task3"></transition>
	</task-node>

	<task-node name="task-node3">
		<task name="task3" blocking="true">
			<description>
				Testing task3
			</description>
			<assignment actor-id="user3"></assignment>
			<controller></controller>
		</task>
		<transition to="task-node4" name="to_task4"></transition>
	</task-node>

	<task-node name="task-node4">
		<task name="task4" blocking="true">
			<description>
				Testing task4
			</description>
			<assignment pooled-actors="group(UserRole)"></assignment>
			<controller></controller>
		</task>
		<transition to="end-state1" name="to_end"></transition>
	</task-node>


	<end-state name="end-state1"></end-state>


</process-definition>
and here is my form definition (forms.xml) :
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow-forms PUBLIC "-//OpenKM//DTD Workflow Forms 1.0//EN"
                                "http://www.openkm.com/dtd/workflow-forms-1.0.dtd">
<workflow-forms>
  <workflow-form task="testing">
    <input label="variable1" name="variable1" />
    <button label="Submit" />
  </workflow-form>
  <workflow-form task="task1">
    <input label="variable1" name="variable1" />
    <button label="Submit" />
  </workflow-form>
  <workflow-form task="task2">
    <input label="variable2" name="variable2" />
    <button label="Submit" />
  </workflow-form>
  <workflow-form task="task3">
    <input label="variable3" name="variable3" />
    <button label="Submit" />
  </workflow-form>
  <workflow-form task="task4">
    <input label="variable4" name="variable4" />
    <button label="Submit" />
  </workflow-form>
</workflow-forms>
What is probably wrong with my workflow ?. Does openkm 5.0 support pooled actor in the task assignment ?

Thanks in advance for your reply
 #7709  by surajaya
 
I successfully deploy that workflow to openkm5.0, but only user1,user2,user3 have task in their "pending task".
Only task1,task2,task3 is assigned. Testing and task4 is not assigned, even if I logged in as user4 (which belong to group UserRole)
 #7739  by surajaya
 
When I change this :
Code: Select all
<assignment pooled-actors="group(UserRole)"></assignment>
into this :
Code: Select all
<assignment expression="group(UserRole)"></assignment>
I got this error message :
Code: Select all
OKM-015026(callbackRunProcessDefinition): OKM-015026
org.jbpm.identity.assignment.ExpressionAssignmentHandler cannot be cast to org.jbpm.taskmgmt.def.AssignmentHandler
Any idea ?
 #7746  by surajaya
 
Finally solved using AssignmentHandler Class :D
Here is my class sample :
Code: Select all
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.taskmgmt.def.AssignmentHandler;
import org.jbpm.taskmgmt.exe.Assignable;


public class Assignment1 implements AssignmentHandler {

	@Override
	public void assign(Assignable assignable, ExecutionContext executionContext)
			throws Exception {

		String[] aktor = {"user1","user2","user3","user4"}; 
		assignable.setPooledActors(aktor);
	}

}
 #8389  by pavila
 
Sorry surajaya, I didn't saw your post until yesterday and was testing the pooled actors feature. I don't know why is not working for you. With this task node description works without problems:
Code: Select all
<task-node name="task-node">
		<task name="sample">
			<assignment pooled-actors="paco,pepe"></assignment>
			<controller></controller>
			<event type="task-create">
				<script>
					taskInstance.start();
				</script>
			</event>
		</task>
		<transition to="end" name="to_end">
			<action></action>
		</transition>
	</task-node>
Pooled Actor: is defined by an actorID sequence separated by comma (','). When this task is created, is not assigned to any user. An actor should retrieve the list of pending tasks from actor pool and be assigned by himself to be included in his pending task list.
 #8434  by surajaya
 
pavila wrote:Sorry surajaya, I didn't saw your post until yesterday and was testing the pooled actors feature. I don't know why is not working for you. With this task node description works without problems:
Code: Select all
<task-node name="task-node">
		<task name="sample">
			<assignment pooled-actors="paco,pepe"></assignment>
			<controller></controller>
			<event type="task-create">
				<script>
					taskInstance.start();
				</script>
			</event>
		</task>
		<transition to="end" name="to_end">
			<action></action>
		</transition>
	</task-node>
Pooled Actor: is defined by an actorID sequence separated by comma (','). When this task is created, is not assigned to any user. An actor should retrieve the list of pending tasks from actor pool and be assigned by himself to be included in his pending task list.
I'll test it again. The first time I test my code, nothing is blinking in the status bar (notifying that there are some pending task for the user). I must admit that I forgot to check the dashboard and look in the "Unassigned pending task". I'll test this assignment soon :
Code: Select all
<assignment pooled-actors="user1,user2,user3,user4"></assignment>
 #8436  by pavila
 
The blinking icon status take some time to refresh it does not update its status immediately. So is working for you isn't it?

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.