PC in Runsave Options Funclib - WF Record
PC in Runsave Options Funclib - WF Record
ula;
Declare Function
Declare Function
dFormula;
Declare Function
a;
Declare Function
Declare Function
Declare Function
la;
Declare Function
a;
Declare Function
ormula;
Declare Function
ormula;
Declare Function
Formula;
Declare Function
dFormula;
Declare Function
ormula;
Declare Function
ula;
Declare Function
ula;
Declare Function
la;
Declare Function
ula;
Declare Function
la;
Declare Function
mula;
Declare Function
mula;
Declare Function
eldFormula;
Declare Function
Declare Function
Declare Function
dFormula;
End-If;
Else;
If All(&AdminSSOverride) Then;
If &AdminSSOverride = "M" Then;
&AdminSelect = "S";
Else;
&AdminSelect = &AdminSSOverride;
End-If;
Else;
If All(&AdminSbpChoice) Then;
&AdminSelect = &AdminSbpChoice;
End-If;
End-If;
End-If;
&DatRowset.GetRow(1).GetRecord(@&DatRecObj).GetField(Field.WF_STATUS
).Value = SetWFStatus(&AdminSelect);
Else;
/*CI wasn't called. It's not an admin. Assume that trans is in app
roval process*/
&DatRowset.GetRow(1).GetRecord(@&DatRecObj).GetField(Field.WF_STATUS
).Value = SetWFStatus("I");
End-If;
Else;
/*&one_trans_not_done = true*/
If &ApprLogicExists = "Y" Then;
&DatRowset.GetRow(1).GetRecord(@&DatRecObj).GetField(Field.WF_STATUS
).Value = "M";
End-If;
End-If;
End-If;
End-Function;
Function RebuildRowset(&Transaction_name, &Rowset, &RowsetRecObj, &Rowset_CI, &R
owset_NO_CI);
GetWFTransfKeys(&Transaction_name, &WFTransfKeysArray);
&numkeys = &WFTransfKeysArray.len;
For &j = 1 To &Rowset_CI.Activerowcount
&CIKeyValues = CreateArrayRept(CreateArrayRept("", 0), 0);
For &k = 1 To &numkeys;
&Fieldname = "Field." | &WFTransfKeysArray [&k][1];
&Keyvalue = &Rowset_CI.GetRow(&j).GetRecord(@&RowsetRecObj).GetField(@&
Fieldname).value;
&CIKeyValues.Push(&Fieldname);
&CIKeyValues [&k].Push(&Keyvalue);
End-For;
&CI_RS_Ind = &Rowset_CI.GetRow(&j).GetRecord(@&RowsetRecObj).GetField(Fiel
d.SS_STAT_INDICATOR).value;
/*have one row*/
For &i = 1 To &Rowset.rowcount;
For &l = 1 To &numkeys;
&Fieldname = "Field." | &WFTransfKeysArray [&l][1];
&RowsetKeyvalue = &Rowset.GetRow(&i).GetRecord(@&RowsetRecObj).GetFi
eld(@&Fieldname).value;
&CompValue = &CIKeyValues [&l][2];
If &RowsetKeyvalue = &CompValue Then;
If &l = &numkeys Then;
&row_match = &i;
&Rowset.GetRow(&row_match).GetRecord(@&RowsetRecObj).GetField(
Field.SS_STAT_INDICATOR).value = &CI_RS_Ind;
&i = &Rowset.rowcount;
End-If;
Else;
Break;
End-If;
End-For;
End-For;
End-For;
For &j = 1 To &Rowset_NO_CI.Activerowcount
&NoCIKeyValues = CreateArrayRept(CreateArrayRept("", 0), 0);
For &k = 1 To &numkeys;
&Fieldname = "Field." | &WFTransfKeysArray [&k][1];
&Keyvalue = &Rowset_NO_CI.GetRow(&j).GetRecord(@&RowsetRecObj).GetField
(@&Fieldname).value;
&NoCIKeyValues.Push(&Fieldname);
&NoCIKeyValues [&k].Push(&Keyvalue);
End-For;
&NO_CI_RS_Ind = &Rowset_NO_CI.GetRow(&j).GetRecord(@&RowsetRecObj).GetFiel
d(Field.SS_STAT_INDICATOR).value;
/*have one row*/
For &i = 1 To &Rowset.rowcount;
For &l = 1 To &numkeys;
&Fieldname = "Field." | &WFTransfKeysArray [&l][1];
&RowsetKeyvalue = &Rowset.GetRow(&i).GetRecord(@&RowsetRecObj).GetFi
eld(@&Fieldname).value;
&CompValue = &NoCIKeyValues [&l][2];
If &RowsetKeyvalue = &CompValue Then;
If &l = &numkeys Then;
&row_match = &i;
&Rowset.GetRow(&row_match).GetRecord(@&RowsetRecObj).GetField(
Field.SS_STAT_INDICATOR).value = &NO_CI_RS_Ind;
&i = &Rowset.rowcount;
End-If;
Else;
Break;
End-If;
End-For;
End-For;
End-For;
End-Function;
Function AdminPosnNotify(&DatRowset, &Rowset_NO_CI, &Transaction_Name);
/*position-managed employee. CI won't be called. manual processing required
by admin
*/
/*set derived workfield on page = admin roleusers, set ci status = manual, an
d notify admin*/
GetAdminBP(&Transaction_Name, &BusProc, &BusActivity, &BusEvent);
If &Transaction_Name = "HR_LOCATION_CHG" Then;
&MsgNum = 1;
NotifyAdmin(&DatRowset, &Rowset_NO_CI, &MsgNum, &Transaction_Name, &BusPro
c, &BusActivity, &BusEvent);
Else;
GetAdminList(&RoleName, &AdminList);
For &z = 1 To &AdminList.rowcount;
DERIVED_HR.ROLEUSER = &AdminList.GetRow(&z).GetRecord(Record.PSROLEMEMB
ER).GetField(Field.ROLEUSER).Value;
&MsgNum = 1;
&Enabled_Flag = False;
If All(&DatRowset) Then;
&DatRecName = &DatRowset.DBRecordName;
&DatRecObj = "Record." | &DatRecName;
/* WinMessage(&DatRecObj); HR_TERM_DAT*/
&Rowset = &DatRowset;
&RowsetRecName = &DatRecName;
&RowsetRecObj = &DatRecObj;
End-If;
If All(&TRANSRowset) Then;
&TransRecName = &TRANSRowset.DBRecordName;
&TransRecObj = "Record." | &TransRecName;
WinMessage(&TransRecObj);
&Rowset = &TRANSRowset;
&RowsetRecName = &TransRecName;
&RowsetRecObj = &TransRecObj;
End-If;
WinMessage("isadmin:" | &isAdmin);
If &isAdmin = True Then;
/*only one of 3 administrator subpages will be visible at any given time.
*/
/*if employee being worked on has a position #, choice will come from SS_S
TAT_IND_POSTN
*/
/*if employee being worked does not have position #, choice will come from
SS_STAT_IND_SBP
*/
/*if errors/warnings were encountered during CI call, choice will come fro
m SS_STAT_ADM_CHOICE*/
&AdminSbpChoice = GetLevel0().GetRow(1).GetRecord(Record.WF_SS_ERR_WRK).Ge
tField(Field.SS_STAT_IND_SBP).Value;
&AdminChgStatus = GetLevel0().GetRow(1).GetRecord(Record.WF_SS_ERR_WRK).Ge
tField(Field.SS_STAT_ADM_CHOICE).Value;
&AdminPostnChoice = GetLevel0().GetRow(1).GetRecord(Record.WF_SS_ERR_WRK).
GetField(Field.SS_STAT_IND_POSTN).Value;
WinMessage("&AdminSbpChoice:" | &AdminSbpChoice | " &AdminChgStatus: " | &
AdminChgStatus | " &AdminPostnChoice:" | &AdminPostnChoice);
/*Regular update - Employee being worked isn't controlled by position*/
If All(&AdminSbpChoice) Then;
&AdminProcType = "Regular";
&AdminProcChoice = &AdminSbpChoice;
End-If;
/*Errors/warnigns were encountered during CI call*/
If All(&AdminChgStatus) Then;
&AdminProcType = "Status Override";
&AdminProcChoice = &AdminChgStatus;
End-If;
/*Position update - Employee being worked on has a position #*/
If All(&AdminPostnChoice) Then;
&AdminProcType = "Position";
&AdminProcChoice = &AdminPostnChoice;
End-If;
apprprocerror:" | &ApprProcError
);
If &ApprProcError = True Then;
DisplayErrorConfirm();
Else;
/* 83SSWF */
If &isAdmin = False Then;
If &Call_CI = True Then
If &EmpInPosition = True Then;
DisplaySubmitConfirm();
Else
If &CI_Status = "E" Or
&CI_Status = "B" Then
DisplayErrorConfirm();
Else
DisplaySaveConfirm();
End-If;
End-If;
Else
/*CALL CI IS FALSE*/
If &ApprovalRequired = "Y" Then;
TransferPage(@&Pagename);
Else;
DisplaySubmitConfirm();
End-If;
End-If;
Else;
/*it is an admin*/
&ReturnPanel = &Pagename;
If &Call_CI = True Then
If &CI_Status = "E" Or
&CI_Status = "B" Then
DisplayErrorConfirm();
Else
DisplaySaveConfirm();
End-If;
Else;
/*CALL CI IS FALSE*/
If &AdminProcType = "Status Override" Or
&AdminProcType = "Position" Then;
DisplaySaveConfirm();
Else;
DisplaySubmitConfirm();
End-If;
End-If;
End-If;
End-If;
End-Function;
/*******************************************************************************
************/
/* This function facilitates error processing when an approver is not found for
a
*/
/* transaction requiring approval.
*/
/*******************************************************************************
************/
Function ApproverNotFound(&StagedDataRecObj As Record, &NotifyBusinessProc, &Not
ifyActivity, &NotifyEvent, &RoleName, &Transaction_Name);
/* Setup message blob array*/
&MsgLineArray = CreateArrayRept("", 0);
&OriginatorName = GetEmployeeName(%EmployeeId);
/* Setup for TriggerBusinessEvent */
&BusinessProcess = "BUSPROCESS." | &NotifyBusinessProc;
&BusinessActivity = "BUSACTIVITY." | &NotifyActivity;
&BusinessEvent = "BUSEVENT." | &NotifyEvent;
/* get the folks in the administrator role into a rowset*/
&RS_RoleMember = CreateRowset(Record.PSROLEMEMBER);
&RS_RoleMember.Fill("WHERE ROLENAME = :1", &RoleName);
/* Generate "Errors" E-Mail Message, Build the E-Mail Subject Line */
HR_LBL_WRK.HR_EMAIL_SUBJECT = MsgGetExplainText(6605, 616, "Message Not Found
", &TransactionDescr, DERIVED_WF.NAME);
/* Build the E-Mail Text */
HR_LBL_WRK.HR_EMAIL_TEXT = MsgGetExplainText(6605, 615, "Message Not Found",
&TransactionDescr, DERIVED_WF.NAME, (&StagedDataRecObj.GetField(Field.EMPLID).Va
lue), &OriginatorName);
&MsgLineArray = BuildEmailBody(&Transaction_Name, &StagedDataRecObj, Null);
/* Build the "Goto" Link */
HR_LBL_WRK.HR_EMAIL_LINK = BuildReviewURL(&StagedDataRecObj, Null);
/****************************************************************/
/* The following code creates the exception array and populates */
/* the error table with the correct error message
*/
/****************************************************************/
/* Get the transaction parameters*/
GetTransactionConfig(&Transaction_Name);
/* Create the SS Application Exception Arrays */
&SSExceptionArray = CreateSSExceptionArray(&ExceptionTableName);
&SSExceptionArray.Len = 0;
&RecNameObject = "RECORD." | &ExceptionTableName;
&SSExceptionRec = CreateRecord(@(&RecNameObject));
&StagedDataRecObj.CopyFieldsTo(&SSExceptionRec);
/* Populate the additional keys. */
For &j = 1 To &SSExceptionRec.FieldCount
&Fieldname = &SSExceptionRec.GetField(&j).Name;
If Not FieldExists(&Fieldname, &StagedDataRecObj) Then
/* This is an additional field - it doesn't exist in &ExceptionRec */
&FieldValue = "";
Evaluate &Fieldname
When = "TRANSACTION_NAME"
&FieldValue = &TransactionName;
Break;
When = "MESSAGE_SET_NBR"
&FieldValue = "6605";
Break;
When = "MESSAGE_NBR"
&FieldValue = "617";
Break;
When = "MESSAGE_TEXT"
&MsgText = MsgGetExplainText(6605, 617, "Message not found");
&FieldValue = &MsgText;
Break;
End-Evaluate;
If All(&FieldValue) Then
&SSExceptionRec.GetField(&j).Value = &FieldValue;
End-If;
End-If;
End-For;
&SSExceptionArray.Push(&SSExceptionRec);
/* Delete existing rows in the exception table for this transaction's keys */
DeleteExceptions(&ExceptionTableName, &SSExceptionArray);
/* Insert exceptions into the exception table */
InsertExceptions(&ExceptionTableName, &SSExceptionArray);
/******************************/
/* end - exception processing */
/******************************/
/* Send the notification to each Role User in the administrator role*/
For &i = 1 To &RS_RoleMember.ActiveRowCount
DERIVED_HR.ROLEUSER = &RS_RoleMember.GetRow(&i).GetRecord(Record.PSROLEMEM
BER).GetField(Field.ROLEUSER).Value;
&WF_Result = TriggerBusinessEvent(@&BusinessProcess, @&BusinessActivity, @
&BusinessEvent);
End-For;
End-Function;