Hi All,
We had an existing workflow where the performers of a maual activity were set to group Group1.
Now the requirement was changed so that the performers were set to only those members of Group1 who had the role Role1.We achieved this by running a DQl to get all such members and then add them to a dynamic group and then assign this group as the performer of the activity.
It was working fine in the development environment and the workitem was being sent to members of Group1 who had Role1.
We created a docapp (along with the jar file of the code) and installed it another environment, and it was working there as well.
The problem is when we installed this in the Test environment(using the same package), it wasnt working there.The workitem was sent to the admin with the following notification :
"An error was encountered in a workflow for which you are the supervisor. The system was unable to find a performer for 'Activity1'. This task has been assigned to you."
Could this be an issue with the code or the environment?
Please Help.
Below is the code snippet :
IDfId alias = null;
/* Getting Change Set Work Items*/
IDfWorkitem changeSetWorkitem = getCurrentWorkitem();
changeSetWorkitem.acquire();
/* Getting List of Content from Change Set*/
IDfList listOfContents = WorkflowUtils.getAllChangeSets(changeSetWorkitem);
for (int iterationVariable = 0; iterationVariable < listOfContents.getCount(); ++iterationVariable)
{
IDfId changeSetId = listOfContents.getId(iterationVariable);
if (!(changeSetId.isNull()))
{
IDfFolder changeSet = (IDfFolder)getSession().getObject(changeSetId);
IDfCollection doclist = changeSet.getContents("r_object_id, r_object_type, r_alias_set_id");
try
{
if (doclist.next())
{
String doc_type = doclist.getString("r_object_type");
if (doc_type.startsWith("in_"))
{
IDfId set_id = doclist.getId("r_alias_set_id");
debug("alias Set :" + set_id);
if (!(set_id.isNull()))
{
alias = set_id;
}
}
}
} finally
{
doclist.close();
}
}
}
//Create dynamic group for Managers
String group_name_mgr = "grp_dyn_mgr" + changeSetWorkitem.getWorkflowId().toString();
idfGroupDynMgr = (IDfGroup)session.newObject("dm_group");
idfGroupDynMgr.setPrivate(false);
idfGroupDynMgr.setGroupDisplayName(group_name_mgr);
idfGroupDynMgr.setGroupName(group_name_mgr);
idfGroupDynMgr.setGroupClass("group");
idfGroupDynMgr.save();
out.write("Manager Group Created: "+ group_name_mgr);//
out.newLine();//
/*Groups created*/
String managerAliasValue = null;
String authorAliasValue = null;
IDfAliasSet aliasSetObject = (IDfAliasSet)getSession().getObject(alias);
for(int iCounter=0;iCounter<aliasSetObject.getAliasCount();iCounter++)
{
if (aliasSetObject.getAliasName(iCounter).equalsIgnoreCase("content manager"))
{
managerAliasValue = aliasSetObject.getAliasValue(iCounter);
}
}
//Managers
String managerDQL ="select distinct i_all_users_names from dm_group where any " +
"i_all_users_names in ( select i_all_users_names from dm_group where group_name = '" +
managerAliasValue + "' )and group_name = 'Role1'";
idfCollectionUsersMgr = runSelectQuery(managerDQL);
while (idfCollectionUsersMgr.next()){
String userNameMgr = idfCollectionUsersMgr.getString("i_all_users_names");
idfGroupDynMgr.addUser(userNameMgr);
}
idfGroupDynMgr.save();
IDfList idflistPerformersMgr = new DfList();
idflistPerformersMgr.append(group_name_mgr);
changeSetWorkitem.setPerformers("Activity1", idflistPerformersMgr );