Thursday, 24 October 2019

SOA Java Snippet to Decode and Encode


Decode: 

XMLElement EncodedData = (XMLElement)getVariableData("VariableName","VariablePart","PathOfTheElementHoldingData");         
String EncodedReportData=EncodedData.getTextContent();                         
oracle.soa.common.util.Base64Decoder B64Decoder = new oracle.soa.common.util.Base64Decoder();                                         
  try                                         
   {                                         
      String DecodedReportData = B64Decoder.decode(EncodedReportData);         
      setVariableData("DecodedString",DecodedReportData);                                           
   }                           
  catch(Exception e)                                             
   {                                         
      addAuditTrailEntry("Exception During Decode "+e.getMessage());       
      e.printStackTrace();                                         
   }


Encode: 

XMLElement DecodedData = (XMLElement)getVariableData("VariableName","VariablePart","PathOfTheElementHoldingData");          
String DecodedReportData=DecodedData.getTextContent();                          
oracle.soa.common.util.Base64Decoder B64Decoder = new oracle.soa.common.util.Base64Decoder();                                          
  try                                          
   {                                          
      String EncodedReportData = B64Encoder.encode(DecodedReportData);          
      setVariableData("EncodedString",EncodedReportData);                                            
   }                            
  catch(Exception e)                                              
   {                                          
      addAuditTrailEntry("Exception During Encode "+e.getMessage());        
      e.printStackTrace();                                          
   }

PGP Encrypt and Decrypt Script


#!/bin/bash

SourceFilePath=$1
OutFilePath=$2
PublicKeyUser=$3

echo "Running GPG Encrypt Command"

gpg --batch --yes --trust-model always -r $PublicKeyUser -o $OutFilePath -e $SourceFilePath


--------------------------------------------

#!/bin/bash


SourceFilePath=$1
OutputFileName=$2
PassPhrase=$3

echo "Running GPG Decrypt Command"

cat $PassPhrase | gpg --output $OutputFileName --batch --yes --passphrase-fd 0 $SourceFilePath

Friday, 27 September 2019

Oracle MFTCS Configurations

  • MFT Configurations can be done using mftconsole
  • Login to mftconsole using admin credentials.
  • After login, select Administration tab on the right corner.
  • Following configurations are available

Server Properties. 
  1. Payload Storage Directory
    • domain_dir/mft/storage
  2. Callout Directory
    • domain_dir/mft/callout
  3. Store inline Payload - File or DB type
  4. We can select the number of processors for Source , Transfer and Target
  5. Configure Control Directory
    • domain_dir/mft/contrl_dir
    • Inbound datasource jndi
    • outbound datasource jndi
Import and Export
  • You can this section to import and export MFT artifacts. 
Keystore Management
  1. Keystore
    • MFT uses SSL and SSH keys to secure embedded SFTP server. 
    • Use this section to configure SSL and SSH keys . 
    • Steps to configure SSL certificates. 
      • Go to WLST command line path
        • /mft/common/bin
      • Start WLST
      • connect("weblogic","welcome1","t3://localhost:7003")
      • Access Oracle Platform Security Services (OPSS) key store service
      • svc = getOpssService(name='KeyStoreService')
      • Create a SSL keystore
      • svc.createKeyStore(appStripe='<StripeName>’, name='<StoreName>’, password='<StorePassword>’, permission=false/true)
        • Example : svc.createKeyStore(appStripe='mft', name='mftDefaultStore', password='Welcome1', permission=false/true)
      • Generate SSL key pairs:
        • svc.generateKeyPair(appStripe='mft', name='mftDefaultStore', password='Welcome1', dn='cn=www.thesnventerprise.com', keysize='1024′,alias='mftssl', keypassword='Welcome2′)
        • Exit WLST .
      • Go to Admin console. 
      • Select Keystore
      •  Add Stripe and Name values as mentioned in the above commands. 
      • Enter the keystore  password and  Private Key Password  in the respective fields and confirm the password by entering it again. 
      • Save changes. 

    • We need to generate a password protected SSH keystore before we configure it in console. 
    • For placing files to embedded SFTP server from a remote server , we need to create an ssh keystore and configure it in mft console. 
    • Use following steps.
      • Go to WLST path
        • /mft/common/bin
      • Start WLST command. 
      • connect("weblogic","welcome1","t3://manged_server_host:PORT")
      • We can generate the key using WLST command or through ssh-keygen
      • generateKeys('SSH', 'Welcome1','/custom/path/ssh-pvt-keys.ppk')
      • ssh-keygen -t rsa -b 2048 -f /custom/path/ssh-pvt-keys.ppk -N Welcome1
      • Import the key
        • importCSFKey('SSH', 'PRIVATE', 'mftssh', '/custom/path/ssh-pvt-keys.ppk')
        • Output - CSF key imported successfully.
        • This will generate an alias name called mftssh
      • Exit WLST
      • Go to Keystore
      • provide the SSH keystore password provided used in generateKeys command. 

    • Use following steps to configure remote server to access  Embedded SFTP server. 
      • Ask the remote server admin to generate a SSH key pair. 
      • Get the public key from the remote user. 
      •  Add the public key in MFT server authorization key. 
        • cat ~/.ssh/remote_pub_key.pub >> ~/.ssh/authorized_keys
      • Import Public keys to MFT using WLST command. 
        • importCSFKey('SSH', 'PUBLIC', 'MFT_RM_USER', '/home/oracle/.ssh/authorized_keys')
      • Note : Get the user name which remote server will use to login and use that user name in import command.

Embedded Servers :
  • Use this option to configure Embedded FTP and SFTP servers.
  • Go to SFTP tab and add the following configurations
    • Enable sFTP by ticking Enabled flag
    • Set the authentication Type as PUBLIC
    • Host Key Alias -- Use the alias name which you have used to generate the SSH keys in the above mentioned steps.  mftssh      
  • Configure the Ports and User access. 
    • Select the MFT_RM_USER  User from the list .
  • After doing the changes RESTART the embedded server. 

PGP Key Configurations :
  • Go to WLST path
  • Run the WLST command
  • Connect to managed_server:port
  • Run the following command to generate the PGP key pair. 
    • generateKeys('PGP', 'PGPWelcome1','/custom_path/PGP/Keys');
    • importCSFKey('PGP', 'PUBLIC', 'Public_PGP', '/custom_path/PGP/Keys/pub.asc');
    • importCSFKey('PGP', 'PRIVATE', 'Private_PGP', '/custom_path/PGP/Keys/secret.asc');
  • Use the password which you have provided in generate key command and update the PGP keystore password in admin console. 
  • You can use the PGP private key for PGP encryption. 

Note Content encrypted using the public key can only be decrypted by the associated private key, which is a secret known only to the possessing party


MFT - Import SSL Certificates for Secured Connection. 
  • Get the certificate from target server
  • Use the following command to get the certificate
  • openssl s_client -connect hostname.com:21 -starttls ftp
  • Copy the certificate including -----BEGIN CERTIFICATE----- and -----END CERTIFICATE-----
  • Put the content in a .cer file. 
  • vi target_server_ssl_certficate.cer and ESC+i , paste it and save it
  • Go to MFT wlst command folder 
  • Sample -  cd /u01/app/oracle/middleware/mft/common/bin
  • Run WLST command - ./wlst.sh
  • Connect to weblgic server. 
  • connect('weblogic','$password', 't3s://AdminServer:7002')
  • Access OPSS Security Service 
  • svc=getOpssService(name='KeyStoreService')
  • Import the certificate using following command
  • svc.importKeyStoreCertificate(appStripe='mft',name='mftDefaultStore', password='$keyStorePassword',alias='$ALIAS_NAME',keypassword='$PasswordForNewCertificate',type='TrustedCertificate',filepath='$FilePath/File_Name.cer')
  • exit()

MFT - Import PRIVATE Keys:
  • cd /u01/app/oracle/middleware/mft/common/bin
  • ./wlst.sh 
  • connect("weblogic","password","t3://managed_server:port")   - $PORT -9073
  • importCSFKey('SSH', 'PRIVATE', 'CLIENT_PRIVATE_KEY', '/u01/app/oracle/tools/home/oracle/CLIENT_AWS_SFTP_privatekey.ppk')
  • CSF key imported successfully
  • exit()

Reference : https://docs.oracle.com/middleware/12213/opss/IDMCR/keystore_service_wlst.htm#IDMCR566

Error Scenario:
Traceback (innermost last):
File "<console>", line 1, in ?
NameError: svc

Solution: Make sure you have run the command to set the value for svc



Monday, 9 September 2019

BPEL Custom Invoke Properties

<bpelx:toProperties>
<bpelx:toProperty name="jca.jndi"
 variable="Dynamic_JNDI"/>
</bpelx:toProperties>


<bpelx:toProperties>
            <bpelx:toProperty name="csf-key" variable="inputVariable(Variable holding the key value)" part="payload">
              <bpelx:query>ns:ParametersList/ns:Parameters[ns:ParameterName='KEY_NAME']/ns:ParameterValue</bpelx:query>
            </bpelx:toProperty>
          </bpelx:toProperties>



        <bpelx:fromProperties>
          <!--<bpelx:fromProperty name="Authorization" variable="authTokenVar"/>-->
          <bpelx:fromProperty name="x-intg-source-system" variable="sourceSystemUserVar"/>
        </bpelx:fromProperties>

Wednesday, 28 August 2019

Simple Steps to Create an HCM Extract.

Steps to Create an HCM  Extract :

  1. Login to HCM
  2. Go to data exchange. 
  3. In Tasks (Right menu), select Manage Extract Definition. 
  4. Select create ( + )
  5. Give a name to Extract.
  6. Give Start Date value. 01-Jan-2000  
  7. The Start date is an effective start date that applies to all date-effective interactions in the current session.
  8. Select extract type
    • HR Archive is for getting assignment and person details. 
    • Payroll interface is for getting payroll related details.
  9. Create Data Group
    • Give Group Name. 
    • Give Display  Name. 
    • Select User Entity based on the data you want to extract.  
      •  Example :
        •  PER_EXT_SEC_ASSIGNMENT_UE     PER_EXT_EMAIL_ADDRESSES_UE
    • set Threading Action Type = Object Action
    • Select Threading Database Item - It will be the unique value of the Main table that will be used to join or get the values.
      •   Example : Extract Assignment ID
  10. Create a Record
    • Give a Record Name.
    • Give a Tag name - This value will be a XML tag (Parent Tag) value under which the attribute values will be coming.
    • Select Type as Detail Record.
    • Process Type as Fast Formula .
  11. Create Attributes - Individual data elements. 
    • Give a Name Value
    • Give a XML tag value. 
    • Short code 
    • Output label value -- All these four values can be same. 
    • Select type as DBI group. 
    • Select the value 
      •   Example :  Extract Assignment ID , Person Number , Person Name , etc. 
      • Set KEy attribute for primary unique value. 
    • Save. 
  12. We can add the conditions at DG level to filter the data. 
  13. Create Data group relationship under Data Groups.
    •   Select the child DG.
    •   select create option under connect DG.
    •   Select the parent DG.
    •   Select the Parent DBI Item  - Parent joining value.
      •     Example - Extract Assignment Person ID
    •   Select chile DBI - Child Joining element value
      •     Example - Extract E-Mail Person ID
    • We can add the filter at the group level or attribute level. 
  14. Go to extract delivery
    • Select add
    • Provide a name for delivery option.
    • Select an output type 
      •   Ex : Text for a CSV and we need to attach a template. 
      •    Data for XML out put and we dont need to attach a template. 
    • Give an output file name. 
    • Select delivery type as None.
    • Save the changes. 
  15. Go to extract execution tree Compile all formulas.
    • Refreh and make sure all formulas are compiled. 
  16. Submit Extract to run the extract. 

Tuesday, 27 August 2019

HCM Extract Issue Resolutions

  • Failure: Due to oracle.xdo.server.ReportException: oracle.xdo.servlet.CreateException: java.lang.SecurityException: Security violation: /Custom/Project/Entity/DemoATest.xdo, user: fusion_apps_hcm_ess_appid, permission: 192 
    • Solution 
      • Go to HCM Analytics
      • Go to the report path
      • Select the report
      • Click More options and select permissions. 
      • Add BI Consumer Role
      • Select Custom Permission and Add all the permission. 

  • Dummy File Deleted
    • Solution :
      • There may be multiple issues. 
        • Check and make sure data model is attached the report.  Use Global Payroll Data model --- Dont miss this
          • Shared Folders/Human Capital Management/Payroll/Data Models/globalReportsDataModel
        • Check proper output format is selected 
  • The report cannot be rendered because of an error, please contact the administrator. java.lang.NullPointerException
    • Solution :
      • After you upload the template to a report, select view report option . 
      • If there is no error then it will display as Report Compiled  Otherwise it will display the above mentioned error. 
      • Main reason would be the structure of the template. 
      • We should always follow the below format while creating the template
<LEVEL>
G_1
<POSITION>
< LENGTH>
<FORMAT>
<PAD>
<DATA>
<COMMENTS>
<NEW RECORD>
G_1
<DISPLAY CONDITION>
COUNT(PersonDetails) > 0



<LEVEL>
G_2
<NEW RECORD>
G_2
<DISPLAY CONDITION>
(PersonDetails/PersonNumber IS NOT NULL)
<MAXIUMUM LENGTH>
<FORMAT>
<DATA>
<COMMENTS>
  • The template is not mandatory if output type = Data only, else for all other output types, it is mandatory.
  • For Output Type XML and PDF you should mention the template name.
  • Delivery file output type i.e. PDF, CSV, XML, DOC.
    • The value you choose should be compatible with the Template/Layout you provided in delivery option.
  • Choose Output Type as Text when the expected output format is text or CSV or delimited file.
  • Note
    • If the expected output format is PDF / HTML / DOC, then RTF template should have been created in BIP. 
    • If the expected output format is text / CSV / delimited file, then eText template should have been created in BIP.
Note:  Use following steps to add custom filtering at DG level. 

  • Select the DG
  • Got to Data Group Filter Criteria
  • Select Edit Option. 
  • Go to advanced option and update the SQL.
    • Sample SQL :

((pay_report_utils.get_parameter_value_date('EFFECTIVE_DATE') BETWEEN abspl.effective_start_date AND abspl.effective_end_date)
    AND accrual.accrual_period = (select MAX(fusacc.ACCRUAL_PERIOD) from fusion.anc_per_accrual_entries fusacc where fusacc.person_id = accrual.person_id
AND accrual.PLAN_ID = fusacc.PLAN_ID
AND fusacc.ACCRUAL_PERIOD < pay_report_utils.get_parameter_value_date('EFFECTIVE_DATE')
group by fusacc.person_id,fusacc.PLAN_ID))


pay_report_utils.get_parameter_value_date  :  To get the Parameters. 
Use Fusion.Table Name to use the table. 

Friday, 23 August 2019

SOACS Instance Auto Purge Configuration.


  • Go to SOA-INFRA -> SOA Administration -> Auto Purge
  • Auto Purge Job Name -SOA Flow Purge Job 1 and Enable it. 
  • Provide Job Schedule details as per below .
    • Run every Day at Midnight
      • FREQ=DAILY; BYHOUR=00;
    • Run every weekday at midnight
      • FREQ=DAILY; BYDAY=MON,TUE,WED,THU,FRI; BYHOUR=00;
    • Run every weekend at midnight and 05:00AM
      • FREQ=DAILY; BYDAY=SAT,SUN; BYHOUR=00,05;
    • Run every weekday 30 minutes past midnight
      • FREQ=DAILY; BYDAY=MON,TUE,WED,THU,FRI; BYHOUR=00; BYMINUTE=30;
    • Run every weekend 30 minutes past midnight and 5AM
      • FREQ=DAILY; BYDAY=SAT,SUN; BYHOUR=00,05; BYMINUTE=30;
    • Run every friday at midnight
      • FREQ=DAILY; BYDAY=FRI; BYHOUR=0;
  • Purge Type -> Single
  • Retain Data ->  7 or 30 days. 
  • Batch Size 

Oracle Fusion - Order Management Cross Reference

Summary:  This guide outlines the steps to manage cross-reference data for Sales Order FBDI upload for the source systems,  including export...