Flex Filereference Download Example Pdf: Best Practices for Using FileReference.download() Method in
- leontynefrost892v9
- Aug 16, 2023
- 13 min read
Thanks for your reply. I have tried to use purePDF as u recomended. I have downloaded the lib and a helloworld example but i seriously cannot get it work. can u send me an example project file that works with purepdf? idonno how to run it.
Flex Filereference Download Example Pdf
Download Zip: https://tinurll.com/2vF6kB
download this zip file: =purePDF_Examples.zip&can=2&q=you can find tons of samples.In this zip file the base class where everything start is DefaultBasicExample.as and, for example, HelloWorld is a good sample to create text in a PDF file and save it with FileReference.If you need more infos you can also write in PurePDF list: or drop me an email
HCM Data Loader (HDL) supports a flexible, pipe-delimited file format that allows you to provide just the business objects, components and component attributes that are required for your use case. Full sets of data can be loaded, or just incremental changes. To achieve this flexibility, each file submitted for loading, must provide a definition of the business object attributes that are provided in the file. Oracle HCM Cloud business objects can be complex and are usually hierarchical, allowing for multiple child records to exist for a business object, e.g. multiple phone numbers for a Person, or multiple columns and rows for a user defined table. Each delimited file will contain the data for a single business object hierarchy. The file will be named for the business object and have a .dat file extension. For example, Worker.dat contains data for workers, Job.dat contains data for jobs and ElementEntry.dat contains data for element entries.When you supply data to be processed by HDL, you must uniquely identify each record in the file. For new records, two mechanisms are supported:User Key - a combination of user-friendly attributes that can be found on the user interface, which uniquely identify the record. For example, the JobCode and SetCode for a Job, the PersonNumber for a Worker.
Source Key - a combination of two attributes, SourceSystemId and SourceSystemOwner, are used to uniquely identify the record. The SourceSystemId value can be any value, but is often the identifier on the source system, or a value generated by an algorithm. The SourceSystemOwner ensures the source key is unique, when multiple source system exist.
Note: The source key is the recommended solution as user key values can change over time and can often be translated. The source key doesn't change during the life of the record.You can use the source key to reference the record from other objects too.Source keys are particularly useful when the user key attribute is auto-generated by Oracle HCM Cloud, such as PersonNumber.In this tutorial you will create and upload files for the Grade, Job and Worker business objects, learn how to upload flexfield data, images and attachments and understand how to supply data for reporting and reconciliation of your records. What Do You Need? Access to import and load data, using HCM Data Loader. For this you need the following functional security privileges: Name Provides Access To Import and Load HCM DataImport and Load Data task. Transfer HCM file from UCM and import into stageFiles on the WebCenter Content server and the ability to import them. Load HCM DataLoad data from HCM Data Loader staging tables into the Oracle Cloud. Manage Data Exchange Work AreaData Exchange work area. Note: The job role Human Capital Management Integration Specialist inherits all the security access required to complete the steps described.
In this step, you will create a simple file to load new grades. User keys are used to uniquely identify each grade. Using any text editor, create a new file and enter the following line:METADATAGradeGradeCodeSetCodeGradeNameEffectiveStartDateActiveStatusAll files must include METADATA lines, to explain which attributes are included in the file and the order in which their values are supplied.All attribute names and values are delimited by the pipe '' character by default.The string immediately after the METADATA instruction identifies the record type the attributes are for, in this case 'Grade'. The values that follow are the names of the attributes available on the Grade record, that you want to supply data for.Note: Ensure your text editor is using UTF-8 encoding.
On the next line enter the following:MERGEGradeIC1COMMONIndividual Contributor 12000/01/01AThe MERGE instruction tells HDL to create the grade if it doesn't already exist, or update it if it does.Again, the value immediately after the MERGE instruction identifies the record type the attributes for. The values that follow are the values for the attributes named in the corresponding METADATA line.Note: HDL expects dates to be supplied in the format YYYY/MM/DD
Add these MERGE lines to your file:MERGEGradeIC2COMMONIndividual Contributor 22000/01/01AMERGEGradeIC3COMMONIndividual Contributor 32000/01/01AMERGEGradeM1COMMONManager 12000/01/01AMERGEGradeM2COMMONManager 22000/01/01AEach record needs to be uniquely identified. For grade records the user key is the combination of GradeCode and SetCode, i.e. IC2 and COMMON.Tip: When testing this file, you may want to add your initials to these grade code values, to ensure they are unique and not already created in your database.
Save your file, naming it Grade.dat.Alternatively, you can download and edit the Grade.dat file.
Compress (zip) the Grade.dat into a filename of your choice, but it must have a .zip file extension.
You have created your first HCM Data Loader file for bulk loading grades. Follow the next step to import this into the HDL staging tables and load the data into the application tables. Importing and Loading Your FileIn the application, on the home page, click My Client Groups > Data Exchange
On the Data Exchange page, click Import and Load Data
Click Import File on the page header.
Drag and drop your .zip file from your file explorer to the Choose File button. Alternatively, click the Choose File button to search and select your file.Click Submit.
The process parameters are displayed, click Submit.Tip: You don't need to change the parameters values.
Click OK on the Submitted confirmation page.
You're returned to the Import and Load Data page. Click Refresh to see your data set.Tip: Data sets have the same name as your zip file.The Import Status will indicate if the business object .dat files in your zip file imported into the staging tables correctly. Here you can see that import was successful.The Load Status will indicate if the data is successfully loaded in the Oracle HCM Cloud application tables. The clock icon indicates that Load is still in progress.There are various counts; your file contained 5 data lines, so the Total Lines should be 5. In this simple file the 5 lines represented 5 grade objects, so the Total Objects should also be 5.Tip: Some objects have complex hierarchies and you need to supply multiple file lines to create one object. For these objects the Total Lines count will be much larger than the Total Objects count.
Creating a File Using Source KeysWe always recommend supplying source keys to uniquely identify your records. Before you can load a file that uses source keys, you must first register your source system owner value.Defining your Source System OwnerIn this step, you will register the source system owner. In the application, on the home page, click Others > Setup and Maintenance.
Click Search in the panel toolbar.
Search for and select Manage Common Lookups task.
Search for the lookup type HRC_SOURCE_SYSTEM_OWNER.
Click the add icon on the Lookup Codes table toolbar.
Specify VISION in the lookup code and meaning, specify a Start Date of 01/01/2000.
Click Save.
Creating a Simple Source Key FileIn this step, you will create a simple source key file to load jobs. Using any text editor, create a new file and enter the following line:METADATAJobSourceSystemOwnerSourceSystemIdEffectiveStartDateSetCodeJobCodeNameActiveStatusFullPartTimeRegularTemporaryYou will see the SourceSystemOwner and SourceSystemId attributes are specified on the METADATA line, along with the attributes specific to the job record.
Add the following MERGE lines to your file:MERGEJobVISIONSCN2000/01/01COMMONSALES_CONSSales ConsultantAFULL_TIMERMERGEJobVISIONADM2000/01/01COMMONADMINAdministratorAFULL_TIMERMERGEJobVISIONMGR2000/01/01COMMONMANAGERManagerAFULL_TIMERThese three file lines will create three jobs. Each job is identified by a source key: Job Name Source System Owner Source System ID Sales ConsultantVISIONSCN AdministratorVISIONADM ManagerVISIONMGR
Add the following METADATA line:METADATAJobGradeSourceSystemOwnerSourceSystemIdJobId(SourceSystemId)GradeCodeGradeSetCodeEffectiveStartDateA job can have multiple valid grades. The JobGrade component is used to create the valid grades and is a child of the Job component.When you provide data for child records you must name the parent record it relates to. In this example this is achieved with the attribute JobId. As you are using source keys to identify the job, the JobId attribute is followed by (SourceSystemId). Anything in brackets after an attribute name is known as an attribute hint. This hint tells HDL that the source system ID value is going to be supplied to this attribute.Tip: The Understanding HCM Data Loader Business Objects tutorial explains how to identify which attribute identifies the parent record.
Add the following MERGE lines to your file:MERGEJobGradeVISIONSCN_IC1SCNIC1COMMON2000/01/01MERGEJobGradeVISIONSCN_IC2SCNIC2COMMON2000/01/01MERGEJobGradeVISIONSCN_IC3SCNIC3COMMON2000/01/01MERGEJobGradeVISIONADM_IC1ADMIC1COMMON2000/01/01MERGEJobGradeVISIONADM_IC2ADMIC2COMMON2000/01/01MERGEJobGradeVISIONADM_IC3ADMIC3COMMON2000/01/01MERGEJobGradeVISIONMGR_M1MGRM1COMMON2000/01/01MERGEJobGradeVISIONMGR_M2MGRM2COMMON2000/01/01These file lines create valid grades for each of the three jobs. Each valid grade record:Provides a unique identifier, by defining a source key (SourceSystemOwner, SourceSystemId)
Identifies the job it is for, by providing the parent attribute JobId with the SourceSystemID hint and supplying it with the source system ID value defined on the corresponding Job record.For example, ADM is the source system ID for the Administrator job, so the JobId(SourceSystemId) attribute on the valid grades for the Administrator job must be ADM.
References the grade for the valid grade record. The grades referenced in this file are those you created with your Grade.dat file. As only user keys were supplied to identify the grades, this example references them by their user key; GradeCode and GradeSetCode.
Note: If you changed the grade code in your first file, you'll need to make the same updates to this file.Tip: The Understanding HCM Data Loader Business Objects tutorial explains how to identify the user keys for the foreign objects you need to reference. Save your file, naming it Job.dat. You can also download and edit the Job.dat file.
Compress (zip) the Job.dat into a filename of your choice, but it must have a .zip file extension.
Use the steps described in Importing and Loading Your File to create your jobs.
You have now created a source key HDL file that includes child records and references a foreign object. Loading Flexfield DataIn this step, you will learn how to supply METADATA and MERGE lines to upload data to flexfield segments. Before you load data into flexfield, you must first configure and deploy the flexfields in Oracle HCM Cloud. You can find the names of the flexfield attributes in the View Business Objects task. Tip: The Understanding HCM Data Loader Business Objects tutorial explains how to identify flexfield attributes.Flexfield ContextWhen loading flexfield segments, HDL needs to understand the context of the flexfield data being loaded. You can only load data for one context on a MERGE line, though for descriptive flexifields, global segments can be populated along with context specific segments.For both descriptive and extensible flexfields the context is defined using the attribute: FLEX:flexfield codeExamples: FLEX:PER_JOBS_DFF and FLEX:PER_JOBS_LEG_EFF
When supplying flexfield segments the attribute name includes a hint which names the flexfield code and context:flexfield attribute name(flexfield code=context code) For example _JOB_LEVEL(PER_JOBS_DFF=US). This format tells HDL that the job level segment belongs to the PER_JOBS_DFF flexfield in the US context.
Tip: You can find the exact attribute names to use on the Flexfield Attributes tab of the Business Object Details page within the View Business Objects task.Descriptive Flexfield SegmentsDescriptive flexfields extend a business-object component. You supply the attributes of the descriptive flexfield on the same MERGE line as the core attributes of the business-object component. On the METADATA line, you must include both the flexfield code and the descriptive flexfield attributes for which you want to load data. As descriptive flexfield segments aren't preconfigured, it isn't possible to provide an example you can upload. Use these steps to understand how to load descriptive flexfield data, but the attribute names and values will need to be replaced with data relevant to your configuration. Using any text editor, create a new file and supply a METADATA line defining the core attributes, along with the descriptive flexfield attributes you want to load data for. For example:METADATAJobSourceSystemOwnerSourceSystemIdEffectiveStartDateSetCodeJobCodeNameFLEX:PER_JOBS_DFF_JOB_LEVEL(PER_JOBS_DFF=US)
Add MERGE lines to your file to specify the core attribute values, flexfield context and flexfield segment values, such as:MERGEJobVISIONSMGR2000/01/01COMMONSNR_MGRSenior ManagerUS1This will load a value of 1 to the Job Level descriptive flexfield segment for the US flexfield context.
Loading Extensible Flexfield SegmentsIn addition to a flexfield code and context, extensible flexfields also have a category code, which much be supplied to the EFF_CATEGORY_CODE attribute.Using any text editor, create a new file and add the following:METADATAJobLegislativeSourceSystemOwnerSourceSystemIdJobId(SourceSystemId)EffectiveStartDateLegislationCodeInformationCategoryFLEX:PER_JOBS_LEG_EFFEFF_CATEGORY_CODE_EEO1_CATEGORY(PER_JOBS_LEG_EFF=HRX_US_JOBS)_FLSA_STATUS(PER_JOBS_LEG_EFF=HRX_US_JOBS)
Add the following MERGE line to your file:MERGEJobLegislativeVISIONMGR_JOB_LEGMGR2000/01/01USHRX_US_JOBSHRX_US_JOBSJOB_LEGPROFESSIONALNONEXEMPTThis table explains the flexfield attributes supplied in this file: Attribute Name Value Description FLEX:PER_JOBS_LEG_EFFHRX_US_JOBSThe context code of the flexfield. EFF_CATEGORY_CODEJOB_LEGThe flexfield category code. _EEO1_CATEGORY(PER_JOBS_LEG_EFF=HRX_US_JOBS)PROFESSIONALThe EEO1 Category segment on the HRX_US_JOBS context of the PER_JOBS_LEG_EFF flexfield. _FLSA_STATUS(PER_JOBS_LEG_EFF=HRX_US_JOBS)NONEXEMPTThe FLSA Status segment on the HRX_US_JOBS context of the PER_JOBS_LEG_EFF flexfield. Tip: These flexfield segments are lookup validated. The lookup code is supplied, but if you need to supply the meaning to a flexfield attribute, you append _Display to the attribute name, such as_EEO1_CATEGORY_Display(PER_JOBS_LEG_EFF=HRX_US_JOBS)Save your file, naming it Job.dat.
Compress (zip) your Job.dat file into a filename of your choice.
Use the steps described in Importing and Loading Your File to load your extensible flexfield data.
Creating New HiresIn this step, you will create a more complex file to load new hires. You should not attempt this step unless you have loaded the Grade and Job files which you created in the preceding steps of this tutorial.When you create a new hire, you must supply data for these components of the Worker object hierarchy:Worker
PersonName
WorkRelationship
WorkTerms
Assignment
It is also recommended that you supply PersonLegislativeData too. If you don't supply it, a legislative data record will be auto-generated, with an auto-generated source key.For the Worker file we are going to use a different source system owner. Follow the steps in the Defining Your Source System Owner section to create a Source System Owner of 'EMP'.
Using any text editor, create a new file and add the following:METADATAWorkerSourceSystemOwnerSourceSystemIdEffectiveStartDatePersonNumberStartDateDateOfBirthActionCodeMERGEWorkerEMPHDL0012001/09/08HDL-10012001/09/081952/05/21HIREMERGEWorkerEMPHDL0022005/02/08HDL-10022005/02/081966/04/21HIREThese are the file lines needed for the Worker component. In this example:Each Worker record is identified by a source key using attributes SourceSystemOwner and SourceSystemId. For example, EMP and HDL001, EMP and HDL002.
The PersonNumber attribute is provided, but if you are auto-generating person numbers, you don't need to supply it.Tip: If you are auto-generating numbers, supplying a source key becomes mandatory and the user key attribute, PersonNumber, can't be supplied.
An ActionCode of HIRE is required for new hires.
Tip: The value for EffectiveStartDate must match the StartDate value when creating new hires. Add these PersonName file lines to your file:METADATAPersonNameSourceSystemOwnerSourceSystemIdEffectiveStartDatePersonId(SourceSystemId)NameTypeLegislationCodeTitleLastNameFirstNameMERGEPersonNameEMPHDL001_NME2001/09/08HDL001GLOBALUSMR.WellsChristopherMERGEPersonNameEMPHDL002_NME2005/02/08HDL002GLOBALUSMRS.HughLorraineThe PersonName record is where you specify your employee's name. In this example: Each PersonName record is identified by a source key using attributes SourceSystemOwner and SourceSystemId. For example EMP, HDL001_NME.
The attribute that identifies the parent (Worker) record is PersonId. By including the (SourceSystemId) hint, we can supply the SourceSystemId value of the parent worker record. For example, HDL001, or HDL002.Note: As both the local PersonName record and the parent Worker record use the same source system owner, the parent source system owner can inherit its value from the local SourceSystemOwner attribute.
Tip: The EffectiveStartDate of the PersonName record must match that of the Worker record for new hires.Tip: The LegislationCode determines the valid values for the Title attribute, so if you change the legislation code you may need to change the Title values. Add these PersonLegislativeData files lines to your file:METADATAPersonLegislativeDataSourceSystemOwnerSourceSystemIdEffectiveStartDatePersonId(SourceSystemId)LegislationCodeSexMaritalStatusMERGEPersonLegislativeDataEMPHDL001_LEG2001/09/08HDL001USMMMERGEPersonLegislativeDataEMPHDL002_LEG2005/02/08HDL002USFSThe PersonLegislativeData record is where you record your employee's marital status and gender. In this example:Each PersonLegislativeData record is identified by a source key. For example, EMP, HDL001_LEG.
The parent record is Worker, so you reference the parent record in the same way as for PersonName.
Tip: The EffectiveStartDate of the PersonLegislativeData record must match that of the Worker record for new hires.Tip: The LegislationCode determines the valid values for the Sex and MaritalStatus attributes. Add these WorkRelationship file lines to your file:METADATAWorkRelationshipSourceSystemOwnerSourceSystemIdPersonId(SourceSystemId)LegalEmployerNameDateStartWorkerTypePrimaryFlagMERGEWorkRelationshipEMPHDL001_POSHDL001Vision Corporation2001/09/08EYMERGEWorkRelationshipEMPHDL002_POSHDL002Vision Corporation2005/02/08EYThe WorkRelationship record type specifies the legal employer for your employee. In this example:Each WorkRelationship record is identified by a source key. For example, EMP, HDL001_POS.
The parent record is still the Worker record, so you reference the parent record using the PersonId attribute.
Note: You will need to change the LegalEmployerName value of 'Vision Corporation' with a legal employer available on your database.Tip: The DateStart attribute value must match the StartDate supplied on the parent Worker record. Add these WorkTerms file lines to your file:METADATAWorkTermsSourceSystemOwnerSourceSystemIdPeriodOfServiceId(SourceSystemId)ActionCodeEffectiveStartDateEffectiveSequenceEffectiveLatestChangeAssignmentNameAssignmentNumberPrimaryWorkTermsFlagMERGEWorkTermsEMPHDL001_TRMHDL001_POSHIRE2001/09/081YET-HDL001ET-HDL001YMERGEWorkTermsEMPHDL002_TRMHDL002_POSHIRE2005/02/081YET-HDL002ET-HDL002YEmployment Terms are not visible in Oracle HCM any more, but you still need to supply a skeleton WorkTerms record to link the WorkRelationship and Assignment records. In this example:Each WorkTerms record is identified by a source key. For example, EMP, HDL001_TRM.
The parent for the WorkTerms is the WorkRelationship, the parent record is identified by the PeriodOfServiceId attribute. The SourceSystemId hint is added, so you can supply the source key to identify the parent work relationship.As the parent work relationship record and the local employment terms record both use the same source system owner, both references use the same SourceSystemOwner attribute.
Tip: The EffectiveStartDate value must match that on the WorkRelationship record. Note: You only need to supply the mandatory attributes when loading the work terms record. Grade, location, department and so on are now only populated on the Assignment component. Add these Assignment file lines to your file:METADATAAssignmentSourceSystemOwnerSourceSystemIdActionCodeEffectiveStartDateEffectiveSequenceEffectiveLatestChangeWorkTermsAssignmentId(SourceSystemId)AssignmentNameAssignmentNumberAssignmentStatusTypeCodePersonTypeCodeBusinessUnitShortCodePrimaryAssignmentFlagJobId(SourceSystemId)JobId(SourceSystemOwner)MERGEAssignmentEMPHDL001_ASGHIRE2001/09/081YHDL001_TRMHDL001HDL001ACTIVE_PROCESSEmployeeVision Corporation EnterpriseYSCNVISIONMERGEAssignmentEMPHDL002_ASGHIRE2005/02/081YHDL002_TRMHDL002HDL002ACTIVE_PROCESSEmployeeVision Corporation EnterpriseYMGRVISIONThe Assignment record type is where you specify your employee's department, location, position, job and so on. In this example:Each Assignment record is identified by a source key. For example, EMP, HDL001_ASG.
The parent for the Assignment is the WorkTerms, the parent record is identified by the WorkTermsAssignmentId attribute. Using the SourceSystemId hint, you can use the source key to identify the parent WorkTerms record.
The Job is also referenced by its source key, but because it has a different source system owner value, it can't use the value supplied to the SourceSystemOwner attribute.To specifiy a different source system owner for a foreign object reference, add the SourceSystemOwner hint to the attribute that identifies the foreign object, i.e. JobId(SourceSystemOwner).
Note: You will need to change the BusinessUnitShortCode value of 'Vision Corporation Enterprise' with a business unit available on your database.Tip: The EffectiveStartDate value must match that on the WorkTerms record. Tip: The Understanding HCM Data Loader Business Objects tutorial explains how to identify the foreign object reference attributes. Save your file, naming it Worker.dat. You can also download and edit the Worker.dat file.Tip: You can use these steps to extend this file to include other components of the Worker hierarchy, such as PersonEmail.
Compress (zip) the Worker.dat into a filename of your choice, but it must have a .zip file extension.
Import and Load your worker data.Note: This time you will see a Total Lines count of 12, but a Total Objects count of only 2.
Loading Images and AttachmentsIn this step, you will create a file to upload person images. Attachments are loaded in the same way.You will extend the New Hire example you created in the Creating New Hires section.Using any text editor, create a new file and add the following:METADATAPersonImageSourceSystemOwnerSourceSystemIdPersonId(SourceSystemId)ImageNameImagePrimaryFlagMERGEPersonImageEMPHDL001_IMGHDL001Chris Wells Profilechris_wells.pngYMERGEPersonImageEMPHDL002_IMGHDL002Lorraine Hugh Profilelorraine_hugh.jpgYThe PersonImage record identifies the file to upload as the employee's image.Each PersonImage record is identified by a source key. For example, EMP, HDL001_IMG.
The parent record is identified using the PersonId attribute. As the source system ID is used to identify the parent record, the attribute has the (SourceSystemId) hint.
The ImageName attribute is used to provide a name for the image.
The Image attribute is used to specify the name of the file to be uploaded.
Save your file, naming it Worker.dat.Tip: Although your file only contains PersonImage records, it must still be named for the object the PersonImage belong to.
In the same directory as your Worker.dat file, create a sub-directory and name it BlobFiles.Note: Image files and attachments are loaded into attributes that have either a BLOB or CLOB data type. You must supply your image and attachment files in a directory named for the data type of the attribute being used.Tip: The Understanding HCM Data Loader Business Objects explains how you can identify the data type of all supported attributes.
Add the files named by your Worker.dat file, to the BlobFiles directory. Tip: You can use your own files, or download chris_wells.png and lorraine_hugh.jpg.
Compress (zip) your Worker.dat file along with your BlobFiles sub-directory, into a file name of your choice, or you can download and edit the Person Images.zip file.
Import and Load your person images.
Supplying Reconilliation DataData loaded by HCM Data Loader is held in generic staging tables, the values supplied for a business object will not always be stored in the same database column.Note: You should not attempt to read data directly from the HDL staging tables. Instead, supply attribute values that you want to report, total or reconcile on, to the source reference attributes.Source reference attributes are displayed in the Error Management pages of the HDL user interface, and can be extracted using HCM Extracts and OTBI reporting.You can supply up to 10 source reference columns.In the METADATA line you specify prompts for each of your source reference columns:SourceRef001=source-column-001SourceRef002=source-column-002SourceRef003=source-column-003
In your MERGE and DELETE lines, provide the values for your record. For example:METADATAElementEntry...SourceRef001=PersonNumberSourceRef002=ElementNameSourceRef003=AmountMERGEElementEntry...892334Travel Allowance200
Next Tutorial Understanding HCM Data Loader Business Objects
2ff7e9595c
Comments