Return to Navigation

Commonly Used Calculated Mapping Application Class Objects

This section provides an example for how to derive: Application Center Default.

It is assumed that the person who will be responsible for creating and managing the Application Classes is a seasoned engineer who is comfortable with working with PeopleTools Application Designer, is well versed in writing PeopleCode, and has detailed knowledge of the referential integrity associated with the tables referenced by the File Parser Context definition.

Warning! This is only an example, and have not been exposed to any rigorous testing scenarios. Should you decide to use this example in any form, it is strongly recommended that a complete and thorough set of test cycle(s) be exercised before moving to production.

Code example:

import SCC_FILE_PARSER:UTIL:FieldCalculationAbstract;
import SCC_FILE_PARSER:MODEL:Results:ResultsField;
import SCC_FILE_PARSER:MODEL:Results:ResultsRecord;
import SCC_FILE_PARSER:MODEL:Results:ResultsCollection;
import SCC_FILE_PARSER:UTIL:Exception:FileParserException;
import SAD_ADM_APPL:Setup:ApplicationDefaults;

/**
  *  class ApplicationCenterDefault
  *
  *  @version
  *  @author 	
  *
  *  Module: 
  *  Description: 
  */

class ApplicationCenterDefault extends 
SCC_FILE_PARSER:UTIL:FieldCalculationAbstract
   /* public methods */
   method ApplicationCenterDefault();
   method calculateValue(&ResultsFieldIn As 
SCC_FILE_PARSER:MODEL:Results:ResultsField, &ResultsCollectionIn 
As SCC_FILE_PARSER:MODEL:Results:ResultsCollection) Returns any;
   
private
   method GetFileData();
   method GetFieldReferences();
   
   instance string &Institution;
   instance string &Career;
   instance string &Program;
   instance string &Plan;
   instance string &Country;
   instance string &Citizenshipstatus;
   
   instance SAD_ADM_APPL:Setup:ApplicationDefaults &ApplicationDefaults;
   instance SCC_FILE_PARSER:MODEL:Results:ResultsField &ResultsField;
   instance SCC_FILE_PARSER:MODEL:Results:ResultsCollection 
&ResultsCollection;
   instance SCC_FILE_PARSER:MODEL:Results:ResultsField &InstitutionField;
   instance SCC_FILE_PARSER:MODEL:Results:ResultsField &CareerField;
   instance SCC_FILE_PARSER:MODEL:Results:ResultsField &ProgramField;
   instance SCC_FILE_PARSER:MODEL:Results:ResultsField &PlanField;
   instance SCC_FILE_PARSER:MODEL:Results:ResultsField &CountryField;
   instance SCC_FILE_PARSER:MODEL:Results:ResultsField 
&CitizenshipstatusField;
   
end-class;


method ApplicationCenterDefault
   
   %Super = create SCC_FILE_PARSER:UTIL:FieldCalculationAbstract();
   &ApplicationDefaults = create SAD_ADM_APPL:Setup:ApplicationDefaults();
   
end-method;


method calculateValue
   /+ &ResultsFieldIn as SCC_FILE_PARSER:MODEL:Results:ResultsField, +/
   /+ &ResultsCollectionIn as SCC_FILE_PARSER:MODEL:Results:
ResultsCollection +/
   /+ Returns Any +/
   /+ Extends/implements 
SCC_FILE_PARSER:UTIL:FieldCalculationAbstract.CalculateValue +/
   Local string &ApplicationCenter;
   
   &ResultsCollection = &ResultsCollectionIn;
   &ResultsField = &ResultsFieldIn;
   
   %This.GetFileData();
   
   try
      
      &ApplicationCenter = &ApplicationDefaults.getApplicationCenter(
&Institution, &Career, &Program, &Plan, &Country, &Citizenshipstatus);
   catch Exception &exception
      Local string &strParm = &Country | "," | &Citizenshipstatus;
      throw create SCC_FILE_PARSER:UTIL:
Exception:FileParserException(14015, 648, 
"Message Not found - problem with App Center API", 
&Institution, &Career, &Program, &Plan, &strParm);
   end-try;
   
   Return &ApplicationCenter;
   
end-method;


method GetFileData
   
   If &InstitutionField = Null Then
      %This.GetFieldReferences();
   End-If;
   
   &Institution = "";
   If &InstitutionField <> Null Then
      &Institution = &InstitutionField.FieldValue;
   End-If;
   
   &Career = "";
   If &CareerField <> Null Then
      &Career = &CareerField.FieldValue;
   End-If;
   
   &Program = "";
   If &ProgramField <> Null Then
      &Program = &ProgramField.FieldValue;
   End-If;
   
   &Plan = "";
   If &PlanField <> Null Then
      &Plan = &PlanField.FieldValue;
   End-If;
   
   &Country = "";
   If &CountryField <> Null Then
      &Country = &CountryField.FieldValue;
  End-If;
   
   &Citizenshipstatus = "";
   If &CitizenshipstatusField <> Null Then
      &Citizenshipstatus = &CitizenshipstatusField.FieldValue;
   End-If;
   
end-method;


method GetFieldReferences
   
   Local integer &SegmentNbr;
   Local integer &RowNbr = 1;
   
   Local SCC_FILE_PARSER:MODEL:Results:ResultsRecord &obj_SCC_STG_CITZN;
   Local SCC_FILE_PARSER:MODEL:Results:ResultsRecord &obj_SCC_STG_STD_CAR;
   Local SCC_FILE_PARSER:MODEL:Results:ResultsRecord &obj_SAD_APL_DAT_STG;
   Local SCC_FILE_PARSER:MODEL:Results:ResultsRecord &obj_SAD_APL_PRG_STG;
   Local SCC_FILE_PARSER:MODEL:Results:ResultsRecord &obj_SAD_APL_PLN_STG;
   &SegmentNbr = &ResultsField.ResultsRecord.SegmentNbr;
   
   &obj_SCC_STG_CITZN = &ResultsCollection.
GetResultsRecord(&SegmentNbr, "SCC_STG_CITZN", &RowNbr);
   &obj_SCC_STG_STD_CAR = &ResultsCollection.
GetResultsRecord(&SegmentNbr, "SCC_STG_STD_CAR", &RowNbr);
   &obj_SAD_APL_DAT_STG = &ResultsCollection.
GetResultsRecord(&SegmentNbr, "SAD_APL_DAT_STG", &RowNbr);
   &obj_SAD_APL_PRG_STG = &ResultsCollection.
GetResultsRecord(&SegmentNbr, "SAD_APL_PRG_STG", &RowNbr);
   &obj_SAD_APL_PLN_STG = &ResultsCollection.
GetResultsRecord(&SegmentNbr, "SAD_APL_PLN_STG", &RowNbr);
   
   If &obj_SCC_STG_CITZN <> Null Then
      &CountryField = &obj_SCC_STG_CITZN.GetResultsField("COUNTRY");
      &CitizenshipstatusField = &obj_SCC_STG_CITZN.
GetResultsField("CITIZENSHIP_STATUS");
   End-If;
   
   If &obj_SCC_STG_STD_CAR <> Null Then
      &CareerField = &obj_SCC_STG_STD_CAR.GetResultsField("ACAD_CAREER");
   End-If;
   
   If &obj_SAD_APL_DAT_STG <> Null Then
      &InstitutionField = &obj_SAD_APL_DAT_STG.
GetResultsField("INSTITUTION");
   End-If;
   
   If &obj_SAD_APL_PRG_STG <> Null Then
      &ProgramField = &obj_SAD_APL_PRG_STG.GetResultsField("ACAD_PROG");
   End-If;
   
   If &obj_SAD_APL_PLN_STG <> Null Then
      &PlanField = &obj_SAD_APL_PLN_STG.GetResultsField("ACAD_PLAN");
   End-If;
   
end-method;