Escolar Documentos
Profissional Documentos
Cultura Documentos
Agenda
Introduction to Component Interface Component Interface Architecture Elements of Component Interfaces Developing and Implementing CIs
External applications need not be concerned with the details of page structures and component definitions in order to access the underlying data and business logic through component interfaces. Evolution of the Message Agent from version 7.5
Data Integrity
Upgradeable PeopleTools object Result: Saves Time & Money
PeopleSoft Application
Component Component Interface
PeopleCode
Keys
API
Methods
External Application
COM (VB) C/C++
Component Interface
Exposed aspect of a component. However, unlike components, component interfaces are readily accessible by internal and external applications and multiple component interfaces can reference the same component.
Methods
10
Methods
A method is a function that performs a specific task on a component interface at runtime. There are two main types of methods: standard and user-defined. Standard methods are those that are available for all component interfaces. Example : Find, Get, Save and Cancel methods. User-defined methods are created in PeopleSoft Application Designer to provide added functionality to the component interface.
11
12
CreateKeys
Generated in CI when the Use tab on the Component Properties dialog allows the Add action
Findkeys
Maps to fields marked as both Alternate Search keys and Search Key in the Component Search Record
13
You can add or delete a Find key if its based on an alternate search key field. You can add any type of key based on a qualifying search key field in the component, if it isnt already the basis of an existing key of the same type. You can delete any type of key if its underlying search key field meets one of these criteria: It is no longer defined as a search key field. It is no longer designated as a list box item. It has been deleted from the component.
14
15
16
Collections
It is a group of properties that corresponds to a scroll, its fields and its subordinate scrolls in the underlying component. A collection is a type of propertywhich points to a scroll, instead of mapping to an individual field, it points to a scroll. A collection groups multiple fields in a scroll. All the fields in the scroll are mapped to a property. These properties are part of the collection.
17
Standard Properties
Standard properties are common across all component interfaces and are assigned automatically when a component interface is created.
Standard properties also exist for each collection within a component interface.
18
19
20
21
User-Defines methods User-defined methods are those that you can create to meet the requirements of an individual component interface.
A method is simply a PeopleCode function that you wish to make accessible through the component interface. Each method maps to a single PeopleCode function. Application developer can write their own methods. These methods are written as Functions using Component Interface PeopleCode. For example, suppose you wanted to be able to copy an instance of Component Interface data.
22
23
24
25
26
28
1.
GetCompIntfc (name )
2.
7.
Cancel()
5.
Save()
6.
30
Scope of a Component Interface Object A Component Interface can be instantiated from PeopleCode, from a Visual Basic program, from COM and C/C++. This object can be used anywhere you have PeopleCode, that is, in message subscription PeopleCode, Application Engine PeopleCode, record field PeopleCode, and so on. Variables defined at Component and Global are only for Component Interface.
31
32
If there are multiple errors, all errors will be logged to the PSMessages collection, not just the first occurrence of an error. As you correct each error, you will want to delete it from the PSMessages collection. For example, if you specified the incorrect format for a date field of the Component Interface named ABS_HIST, the Text property would contain the following string: Invalid Date {ABS_HIST.BEGIN_DT} (90), (1)
33
34
If there are multiple errors, all errors will be logged to the PSMessages collection, not just the first occurrence of an error. As you correct each error, you will want to delete it from the PSMessages collection. For example, if you specified the incorrect format for a date field of the Component Interface named ABS_HIST, the Text property would contain the following string: Invalid Date {ABS_HIST.BEGIN_DT} (90), (1)
35
36
37
38
39
The data that is used for the test corresponds to the key values that you enter here.
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
CI will take care all the validation while inserting rows for newly created jobcodes in jobcode table.
60
61
Click on Yes or No per your discretion, though 'Yes' will be better moving ahead.
62
63
Create a application Engine to read the file and load the data into Jobcode table using CI.
64
65
Component Interface Code to read the file through file layout (contd.)
If &RSParent.ActiveRowCount > 0 Then &RSParent.DeleteRow(1); End-If; Else &LOGFILE.WriteRowset(&RS); &LOGFILE.WriteLine("****Correct error in this record and delete all error messages"); &LOGFILE.WriteRecord(&REC2); For &L = 1 To &RS2.GetRow(&I).ChildCount &RS1 = &RS2.GetRow(&I).GetRowset(&L); If (&RS1 <> Null) Then &LOGFILE.WriteRowset(&RS1); End-If; End-For; End-If; End-For; End-Function;
rem *****************************************************************; rem * PeopleCode to Import Data *; rem *****************************************************************; Local File &FILE1; Local Record &REC1; Local SQL &SQL1; Local Rowset &RS1, &RS2; Local integer &M;
&FILE1 = GetFile("C:\Documents and Settings\user1\Desktop\jobcode.csv", "r", "a", %FilePath_Absolute); &LOGFILE = GetFile("C:\Documents and Settings\user1\Desktop\jobcode_err.txt", "W", %FilePath_Absolute); &FILE1.SetFileLayout(FileLayout.CI_TEST); &LOGFILE.SetFileLayout(FileLayout.CI_TEST); &RS1 = &FILE1.CreateRowset(); &RS = CreateRowset(Record.TEST); &SQL1 = CreateSQL("%Insert(:1)"); &RS1 = &FILE1.ReadRowset(); While &RS1 <> Null; ImportSegment(&RS1, &RS); &RS1 = &FILE1.ReadRowset(); End-While; &FILE1.Close(); &LOGFILE.Close();
66
Local File &fileLog; Local ApiObject &oSession, &oCiJobCodeTbl; Local ApiObject &oSetJobBuVwCollection, &oSetJobBuVw; Local ApiObject &oCollJobcodeTblCollection, &oCollJobcodeTbl; Local ApiObject &oJobcodeTblBraCollection, &oJobcodeTblBra; Local ApiObject &oJobcdTrnProgCollection, &oJobcdTrnProg; Local ApiObject &oJbcdCmpRt2VwCollection, &oJbcdCmpRt2Vw; Local ApiObject &oJbcdCmpRt3VwCollection, &oJbcdCmpRt3Vw; Function errorHandler() Local ApiObject &oPSMessageCollection, &oPSMessage; Local number &i; Local string &sErrMsgSetNum, &sErrMsgNum, &sErrMsgText, &sErrType; &oPSMessageCollection = &oSession.PSMessages; For &i = 1 To &oPSMessageCollection.Count &oPSMessage = &oPSMessageCollection.Item(&i); &sErrMsgSetNum = &oPSMessage.MessageSetNumber; &sErrMsgNum = &oPSMessage.MessageNumber; &sErrMsgText = &oPSMessage.Text; &fileLog.WriteLine(&sErrType | " (" | &sErrMsgSetNum | "," | &sErrMsgNum | ") - " | &sErrMsgText); End-For; rem ***** Delete the Messages from the collection *****; &oPSMessageCollection.DeleteAll(); End-Function;
67
For &i = 1 To &RS.activerowcount &REC1 = &RS.GetRow(&i).getrecord(Record.TEST); &setid = &REC1.GetField(Field.SETID).Value; &jobcode = &REC1.GetField(Field.JOBCODE).Value; &effdt = &REC1.GetField(Field.EFFDT).Value; &status = &REC1.GetField(Field.EFF_STATUS).Value; &descr = &REC1.GetField(Field.DESCR).Value; &descrshort = &REC1.GetField(Field.DESCRSHORT).Value; &std_hrs = &REC1.GetField(Field.STD_HOURS).Value; &manager_level = &REC1.GetField(Field.MANAGER_LEVEL).Value; &comp_frequency = &REC1.GetField(Field.COMP_FREQUENCY).Value; rem ***** Get the Component Interface *****; &oCiJobCodeTbl = &oSession.GetCompIntfc(CompIntfc.CI_JOB_CODE_TBL); If &oCiJobCodeTbl = Null Then errorHandler(); throw CreateException(0, 0, "GetCompIntfc failed"); End-If;
68
rem ***** Set/Get COLL_JOBCODE_TBL Collection Field Properties -- Parent: PS_ROOT Collection *****; &oCollJobcodeTblCollection = &oCiJobCodeTbl.COLL_JOBCODE_TBL; Local integer &i113; For &i113 = 1 To &oCollJobcodeTblCollection.Count; &oCollJobcodeTbl = &oCollJobcodeTblCollection.Item(&i113); &fileLog.WriteLine("&oCollJobcodeTbl.KEYPROP_EFFDT = " | &oCollJobcodeTbl.KEYPROP_EFFDT); &oCollJobcodeTbl.KEYPROP_EFFDT = &effdt;
69
70
Run the application engine. The application engine willl load the jobcodes created.
71
49588
49588
07/01/2011
07/01/2011
0
0
DTA
PAY
SUP
APR
Hints : Create a csv file using the format mentioned in the test file to upload the data.
Create a file layout to read the data. Create a CI for job data component to upload the data. Create a process which will read the data from file and upload data through CI.
72
About SOAIS
SOAIS is a provider of Enterprise IT and Process outsourcing solutions. Since its inception SOAIS has expanded at a tremendous pace and has garnered customers from both midmarket segment and Fortune 100 companies. We have experience in managing ERP applications as well as in providing high value services around packaged enterprise applications such as PeopleSoft and Oracle. Our experience in the business process outsourcing area fully extends our services footprint to provide end to end enterprise wide solutions. See www.soais.com for information.
73