En este escenario se explora el uso de un script de ejemplo para automatizar la integración de datos periódica.
Cree un archivo de lote (.bat
) o shell (.sh
) que contenga un script similar al siguiente para automatizar las actividades relacionadas con la integración de datos. El siguiente script de ejemplo para Windows automatiza la integración diaria de datos de las aplicaciones completando estas actividades:
DailyPlanData
si está presente.DailyPlanData
en el servicio.Clear Plan Targets
en el tipo de plan Plan1
.LoadDailyPlan
.Balance Sheet - Plan
.Allocate Plan Targets
.DailyTarget.zip
si está presente.DailyTarget.zip
con el nombre de trabajo ExportDailyTarget
.DailyTarget.zip
en el servidor y agregue la marca de tiempo.Nota:
Si vuelve a planificar este script para su uso, asegúrese de modificar los valores de los parámetros SET url
y SET user
. Además, puede modificar los valores de los parámetros dataimportfilename
, dataexportfilename
, importdatajobname
, exportdatajobname
, br_clear
, br_calculatebalancesheet
y br_allocatetarget
para ajustar los requisitos
Consulte Automatización de la ejecución de scripts para obtener información sobre la programación del script con Programador de tareas de Windows.
@echo off rem Sample Script to demonstrate daily data integration with rem EPM Cloud application. rem This script uploads Plan data, clears target numbers, rem runs a business rule to calculate balance sheet data, and rem recalculates target numbers on the Vision demo application rem Please update these parameters SET url=https://example.oraclecloud.com SET user=serviceAdmin SET dataimportfilename=DailyPlanData.csv SET dataexportfilename=DailyTarget SET importdatajobname=LoadDailyPlan SET exportdatajobname=ExportDailyTarget SET br_clear=Clear Plan Targets SET br_calculatebalancesheet=Balance Sheet - Plan SET br_allocatetarget=Allocate Plan Targets SET password=%1 rem Executing EPM Automate commands CD /D %~dp0 call epmautomate login %user% %password% %url% IF %ERRORLEVEL% NEQ 0 goto :ERROR for /f %%i in ('call epmautomate listfiles') do if %%i==%dataimportfilename% (call epmautomate deletefile %%i) IF %ERRORLEVEL% NEQ 0 goto :ERROR call epmautomate uploadfile %dataimportfilename% IF %ERRORLEVEL% NEQ 0 goto :ERROR call epmautomate runbusinessrule "%br_clear%" IF %ERRORLEVEL% NEQ 0 goto :ERROR call epmautomate importdata "%importdatajobname%" IF %ERRORLEVEL% NEQ 0 goto :ERROR call epmautomate runbusinessrule "%br_calculatebalancesheet%" IF %ERRORLEVEL% NEQ 0 goto :ERROR call epmautomate runbusinessrule "%br_allocatetarget%" "TargetVersion=Baseline" IF %ERRORLEVEL% NEQ 0 goto :ERROR for /f %%i in ('call epmautomate listfiles') do if %%i=="%dataexportfilename%.zip" (call epmautomate deletefile %%i) IF %ERRORLEVEL% NEQ 0 goto :ERROR call epmautomate exportdata %exportdatajobname% "%dataexportfilename%.zip" IF %ERRORLEVEL% NEQ 0 goto :ERROR call epmautomate downloadfile "%dataexportfilename%.zip" IF %ERRORLEVEL% NEQ 0 goto :ERROR rem Section to rename the file Set Timestamp=%date:~4,2%_%date:~7,2%_%date:~10,4%_%time:~1,1%%time:~3,2%% ren "%dataexportfilename%.zip" "%dataexportfilename%_%Timestamp%.zip" call epmautomate logout IF %ERRORLEVEL% NEQ 0 goto :ERROR :EOF echo Scheduled Task Completed successfully exit /b %errorlevel% :ERROR echo Failed with error #%errorlevel%. exit /b %errorlevel%