Import Data, Run a Calculation Script, and Copy Data from a Block Storage Database to an Aggregate Storage Database

Use these scripts to import data from a file, refresh the cube, run a business rule to calculate the cube, and then push data to an ASO cube.

These scripts perform the following actions:

  • Signs in to an environment.
  • Uploads a file data.csv.
  • Imports data from data.csv into the application using job loadingq1data.
  • Refreshes the cube.
  • Runs business rules to transform data.
  • Pushes data to an aggregate storage database using a job.
  • Signs out.

Windows Sample Script

Create importDataPlus.ps1 by copying this script. Save it to a local directory.
$inputproperties = ConvertFrom-StringData(Get-Content ./input.properties -raw)
$username="$($inputproperties.username)"
$passwordfile="$($inputproperties.passwordfile)"
$serviceURL="$($inputproperties.serviceURL)"
$importDataJobName="$($inputproperties.importDataJobName)"
$businessRuleName="$($inputproperties.businessRuleName)"
$planTypeMapName="$($inputproperties.planTypeMapName)"
$param1Key="$($inputproperties.param1Key)"
$param1Value="$($inputproperties.param1Value)"
$param2Key="$($inputproperties.param2Key)"
$param2Value="$($inputproperties.param2Value)"
$clearData="$($inputproperties.clearData)"

epmautomate login ${username} ${passwordfile} ${serviceURL}
epmautomate uploadfile ${file1}
epmautomate importdata ${importDataJobName} ${file1}
epmautomate refreshcube
epmautomate runbusinessrule ${businessRuleName} ${param1Key}=${param1Value} ${param2Key}=${param2Value}
epmautomate runplantypemap ${planTypeMapName} clearData=${clearData}
epmautomate logout

Linux/UNIX Sample Script

Create importDataPlus.ps1 by copying this script. Save it to a local directory.
#!/bin/bash
. ./input.properties
export JAVA_HOME=${javahome}
${epmautomatescript} login "${username}" "${passwordfile}" "${serviceURL}"
${epmautomatescript} uploadfile "${file1}"
${epmautomatescript} importdata "${importDataJobName}" "${file1}"
${epmautomatescript} refreshcube
${epmautomatescript} runbusinessrule "${businessRuleName}" "${param1Key}=${param1Value}" "${param2Key}=${param2Value}"
${epmautomatescript} runplantypemap "${planTypeMapName}" clearData=${clearData}
${epmautomatescript} logout

Creating the input.properties File

Windows

username=exampleAdmin
passwordfile=examplePassword.epw
serviceURL=exampleURL
File1=FILE_NAME.csv
importDataJobName=FILE_NAME
businessRuleName=RULE_NAME
planTypeMapName=PLAN_TYPE_MAP_NAME
param1Key=RUN-TIME PARAMETER_1
param1Value=RUN-TIME PARAMETER_1_VALUE
param2Key=RUN-TIME PARAMETER_2
param2Value=RUN-TIME PARAMETER_2_VALUE
clearData=true
Linux/UNIX
javahome=JAVA_HOME
epmautomatescript=EPM_AUTOMATE_LOCATION
username=exampleAdmin
passwordfile=examplePassword.epw
serviceURL=exampleURL
File1=FILE_NAME.csv
importDataJobName=FILE_NAME
businessRuleName=RULE_NAME
planTypeMapName=PLAN_TYPE_MAP_NAME
param1Key=RUN-TIME PARAMETER_1
param1Value=RUN-TIME PARAMETER_1_VALUE
param2Key=RUN-TIME PARAMETER_2
param2Value=RUN-TIME PARAMETER_2_VALUE
clearData=true

Table 3-17 input.properties Parameters

Parameter Description
javahome JAVA_HOME location. For Linux/UNIX only.
epmautomatescript Absolute path of EPM Automate executable (epmautomate.sh). For Linux/UNIX only.
username User name of a Service Administrator, who also has the Identity Domain Administrator role.
password Password of the Service Administrator or the name and location of the encrypted password file.
serviceURL URL of the environment from which you want to generate the snapshot.
File1 Import file from which the data is to be loaded into the application.
iimportDataJobName Name of the job to use for importing data.
businessRuleName The business rule to run on the imported data
planTypeMapName The plan type map to use for copying data from a BSO database to an ASO database or from a BSO database to another BSO database.
param1Key Run-time prompt 1 to run the business rule.
param1Value Value of run-time prompt 1.
param2Key Run-time prompt 2 to run the business rule.
param2Value Value of run-time prompt 2.
clearData Indicates whether the data in the receiving database is to be deleted. Specify false to retain the data.

Running the Scripts

  1. Create importDataPlus.ps1 or importDataPlus.sh by copying the script from a preceding section.
  2. Create the input.properties file and save it in the directory where the importDataPlus script is located. Contents of this file differs depending on your operating system. See Creating the input.properties File.

    Make sure that you have write privileges in this directory. For Windows, you may need to start PowerShell using the Run as Administrator option to be able to run the script.

  3. Launch the script.
    • Windows PowerShell: run importDataPlus.ps1.
    • Linux/UNIX: run ./importDataPlus.sh.