Need help assigning a workflow task to a group

Post any question regarding setting up, running or configuring Verj.io Workflow

Moderators: Dave, Jon, Steve, Ian

LKirby
Ebase User
Posts: 37
Joined: Wed Mar 13, 2013 11:33 am
Contact:

Need help assigning a workflow task to a group

#1

Postby LKirby » Tue Apr 02, 2013 11:21 am

Hi, im really stuck on how i should go about assigning tasks to a group of users.
I've got a logon service (in javascript) that is just returning user-id (from an external database). when looking at WORKFLOW_TASKLIST, if the task has been assigned using workflow_administrator to that user it shows up in their task list, otherwise it doesn't show up. i cant work out what should be in the workflow_assignment_logic to assign it to a group. and javascript would be preferred.

any help would be great thanks as i just cant work out how to do this :(

Edit: I know im supposed to something with roles/custom roles but im really clueless atm.
0 x

User avatar
Wai
Moderator
Moderator
Posts: 165
Joined: Wed Sep 12, 2007 9:04 am
Location: Sandy, UK
Contact:

#2

Postby Wai » Tue Apr 02, 2013 12:32 pm

You need to set up the assignment criteria in workflow_assignment_service_logic script. The default shipped with Ebase is in FPL, you can create a new JS script and attach it to the Workflow_Assignment_service event in place of the FPL script.

In your interactive task, select Custom Assignment in the Resource tab. Enter a descriptive name in the Assignment Key box for the Group.

For example:

sales

In the script you will then check for the Key and execute the code within, for example:

Code: Select all

// Role based assignment
// Any user with a role of 'Sales' will see the task in their task list
if ( fields.WFKEY.value == "sales")
{
	roles.insertRow();
	roles.ROLEID.value = "Sales";	
	roles.updateTable();
}
You can also assign to a group of users who share common info for example, the department they belong to. You do this by using Credentials, for example:

Code: Select all

if ( fields.WFKEY.value == "sales")
{
	credentials.insertRow();
	credentials.ID.value = "Department";	
	credentials.VALUE.value = "Sales Dept";	
	credentials.updateTable();
}
0 x

LKirby
Ebase User
Posts: 37
Joined: Wed Mar 13, 2013 11:33 am
Contact:

#3

Postby LKirby » Wed Apr 03, 2013 9:53 am

Ok i'll give that a go next time i'm on Ebase. I think part of what I was doing wrong as well was that the logon service script wasn't assigning the user a role during login so I'll have to change that as well. I'll let you know how it goes :)

Thanks,
0 x

LKirby
Ebase User
Posts: 37
Joined: Wed Mar 13, 2013 11:33 am
Contact:

#4

Postby LKirby » Thu Apr 04, 2013 10:58 am

Ok I tried what you said and its not working at the moment.

The logon works fine and if the user has the role IT then the job isn't appearing in the workflow_tasklist but if i set the user's role to WFADMIN then it shows up fine. So im guessing the script for workflow_assignment is wrong? at the moment i have:

Code: Select all

if ( fields.WFKEY.value == "IT") 
{ 
  tables.EBASEROLES.insertRow();
  tables.EBASEROLES.ROLEID.value = "IT";    
  tables.EBASEROLES.updateTable();
} 
In the interactive task, under resources, i have it set to custom and the assignment key is IT. (The process has been released after making changes so its not that).



Edit: just realised what was wrong;
in the script, where it says "Using System Service:" it was set to the logon service not workflow_assignment so it wasnt showing the roles table. so i've changed the workflow_assignement script to:

Code: Select all

if ( fields.WFKEY.value == "IT") {
  tables.ROLES.insertRow();
  tables.ROLES.ROLEID.value = "IT";
  tables.ROLES.updateTable();
} 
Now it works fine :D

Thanks for you help.
0 x

User avatar
Wai
Moderator
Moderator
Posts: 165
Joined: Wed Sep 12, 2007 9:04 am
Location: Sandy, UK
Contact:

#5

Postby Wai » Fri Apr 05, 2013 5:10 pm

That's great, no problem.
0 x


Who is online

Users browsing this forum: No registered users and 1 guest