1. Create departments where all the employees to be reviewed are in departments with managers.
2. You have one process to start reviews:
(_) -> [review committee] -> (_)
And a second process to review each employee:
(_) -> [manager reviews employee] -> [employee evaluates] -> <_> ...
The "manager reviews employee" task has the managers in its assignment pool and it uses Value Based Assignment and the variable @@managerID. The "employee evaluates" task has the employees in its assignment pool and it uses Value Based Assignment and the variable @@employeeID.
3. Create a group named "Employees to Review" for the employees who will be reviewed
4. Then you can use this trigger code to create separate cases:
Code: Select all$processID = '1234567890abcde1234567890abcde'; //set to ID of second process
$taskID = '1234567890abcde1234567890abcde'; //set to ID of the "manager reviews employee" task
@@casesCreated = '';
$aGroups = PMFGetUidFromText("Employees to Review", "GRP_TITLE");
if (count($aGroups) > 0) {
$groupID = $aGroups[0];
G::LoadClass("groups");
$g = new Groups();
$aUsers = $g->getUsersOfGroup($groupID);
foreach ($aUsers as $aUser) {
$aUserInfo = userInfo($aUser['USR_UID']);
$managerID = $aUserInfo['reportsto'];
$aVars = array(
'employeeID' => $aUser['USR_UID'],
'managerID' => $managerID
);
$newCaseID = PMFNewCase($processID, $managerID, $taskID, $aVars);
if (empty($newCaseID)) {
throw new Exception("Unable to create case.");
}
else {
$aCaseInfo = $c->LoadCase($newCaseID, 1);
@@casesCreated .= (empty(@@casesCreated) ? '' : "\n") .
"Case #".$aCaseInfo['APP_NUMBER']." to review ".$aUserInfo['firstname'].' '.$aUserInfo['lastname'];
}
}
}
Set this trigger to fire in the "review committee" task in the first process. Following this trigger, a DynaForm containing an textarea associated with the casesCreated variable will display a report showing which cases have been created in the second process.