Page 1 of 1

Selecting specific Users from an actor pool during a Workflow

PostPosted:Fri Jan 30, 2015 8:33 pm
by DMT
Hi Guys,

I just wanted to ask if we could implement the following Workflow. I would like to add that we have created actor pools so every role has many Users. For example, Assume there are two roles 'Creator' and 'Manager' and both roles have multiple users (Say User A and User B for Role 'Creator' and User C and User D for role 'Manager'). Hence, what I want to implement is if User A starts the Workflow, then he should be able to choose either 'User C' or 'User D' from a dropdown and the workflow will proceed to that User. Let me know if its possible to do so.

To summarize, this is how the Workflow should work:

1) A User from the Role 'Creator' Uploads the document in OpenKM and Starts Workflow
2) That User gets a dropdown which shows the list of User's from the Role 'Manager' and selects one of them.
3) That selected User then reviews the document and should he accept, the workflow ends
4) If that User rejects, then the Workflow will go back to the Creator (initiator)

Re: Selecting specific Users from an actor pool during a Workflow

PostPosted:Sun Feb 01, 2015 8:58 am
by pavila
Yes, it's possible. You have to use a form with a Select which should be filled with users with this role. After that, you also should implement an AssignmentHandler which make the task assignation from the value of the previous Select.

To fill this Select you can inyect the data from an ActionHandler.

Re: Selecting specific Users from an actor pool during a Workflow

PostPosted:Mon Feb 02, 2015 1:04 pm
by CBD007
Hello Pavilla....I'm rokie to openKM I get stucked at point where I can't able to add role or userid into select attribute tag of form.xml ....could it possible for u to provide me code snippet of assigning role or userid into select tag of form.xml....looking forward to u r response...thank u..

Re: Selecting specific Users from an actor pool during a Workflow

PostPosted:Mon Feb 02, 2015 2:51 pm
by CBD007
Hello Guys...
In two ways I tried to add dynamiclly userid to select attribute of form.xml

1) By using query:
In this method I added query to the optionsQuery proerty of select tag, the problem arises when I am able to reterive values from User table but can't able to display those values in drop down list in openkm form. refer the following code to help out from this issue
Code: Select all
<select label="User Id's" name="userId" type="simple" table="User"
 optionsQuery="select user.id, user.name from User as user Join user.roles as role where role.id in('ROLE_APPROVER')"/>
2) By using Assignment class:
I have created an assignment java class in that i have manully passed some user id's after that this class I need to be configure with select attribute, all those things I have done, but when I upload the created par file then I'm getting -- Attribute "class" must be declared for element type "select".

refer the following code that I have created in form.xml
Code: Select all
<workflow-form task="dropdown">    
	<select label="User Id's" name="pt.userId" type="simple" class="com.xyz.abc.Assign"/>
</workflow-form>

Re: Selecting specific Users from an actor pool during a Workflow

PostPosted:Wed Apr 08, 2015 5:09 am
by pavila
Please, try with a recent nighbuild because there was a problem with the Select form element.

Regards.

Re: Selecting specific Users from an actor pool during a Workflow

PostPosted:Thu Apr 09, 2015 7:29 am
by jllort
You can find nightly build at integration.openkm.com ( consider nightly build as version 6.3.1 http://wiki.openkm.com/index.php/Migration_Guide )