FDMEE JythonScripting
FDMEE JythonScripting
15 Years
700+ clients
1000+ projects
Focus
Services
People
Methodology
Customers
Partnership
Business
Intelligence
Consolidation
Enterprise
Planning
Costing &
Profitability
Mgmt
Infrastructure
Data
Services
Project
Management
Training &
Support Services
Agenda
Jython Overview
Configuring Eclipse
FDMEE Scripting Configuration
Jython Basics
Script Format
Utilize Try...Except
try:
Code to execute
except:
Error handling
Functionality
count(Substring,[Start],[End])
endswith(Suffix,[Start],[End])
find(substring,[Start],[End])
isdigit()
isspace()
lower()
replace(old,new,[count])
split([separator],[max split])
startswith(prefix,[Start],[End])
strip([characters])
upper()
zfill(width)
Jython Statements
Jython
VBScript
If Then
if x == 100:
elif x == 200:
else:
If x = 100 then
Elseif x = 200 then
Else
End if
Case
No native statement;
utilize dictionary or If
Then statements
Select Case x
Case 100
Case 200
Case Else
End Select
Jython Iteration
Jython
VBScript
Do Loop
while x<100:
Do something
x += 1
For Loop
for x in range(100):
Do something
For x = 0 to 100
Do something
Next
Jython
VBScript
lListName = [Elem1,Elem2,Elem3]
aArrayName =
Array(Elem1,Elem2,Elem3)
Dictionary
dictName = {}
dictName[Tony Scalese] = 36
dictName[Opal Alapat] = 39
for sKey,sItem in dictName.iteritems():
print sKey + \s age is + str(sItem)
Jython Download
Jython Install
Download Eclipse
Extract Eclipse
Workspace
Expand General
Editors and click Text
Editors
Change the options:
Display tab width: 2
Insert spaces for tabs:
Checked
Show Print Margin:
Checked
Show Line Numbers:
Checked
Install PyDev
PyDev Install
PyDev Install
PyDev Install
Windows Preferences
Expand PyDev and click Editor
Change tab length to 2
Interpreter Jython
Click New
Interpreter Name: Jython2.5.1
Browse and select Jython.jar from C: drive
Click OK
Creating a Project
Creating a Project
Creating a Project
Organize Code
Creating Modules
Creating Modules
Specify a name
Click Finish
When prompted for a template, select Module
main and click OK
Testing Module
Import Scripts
Notice the
colon at the
end
No longer limited to 5
Declare a variable before the function
Designate the variable as global
strDept =
def Nvision_Entity(strfield,strrecord):
if strrecord[1:5] == Dept::
global strDept
strDept = strrecord[6:9]
return strfield
def Nvision_C1(strfield,strrecord):
return strDept
Mapping Scripts
Event Scripts
Description
Import
ImportAction, FileImport
Calculate
Calculate
ProcLogicGroup
ProcMap
ProcMap
Validate
Validate
ExportToDat
ExportToDat
Load
Load
Consolidate
Consolidate
Check
Check
Custom Scripts
Create a group
Logical grouping that a user can select
Select Group
Select Script & click Execute
Specify parameters if applicable
Development Mode
FDM Context
Commonly Used
Occasionally Used
Rarely Used
APPID
CATKEY
CATNAME
CHKSTATUS
EXPSTATUS
IMPSTATUS
INBOXDIR
LOADID
LOCKEY
LOCNAME
OUTBOXDIR
PERIODNAME
PERIODKEY
PROCESSSTATUS
SCRIPTSDIR
VALSTATUS
EXPORTFLAG
EXPORTMODE
FILEDIR
FILENAME
IMPORTFLAG
IMPORTFORMAT
IMPORTMODE
MULTIPERIODLOAD
RULEID
RULENAME
SOURCENAME
SOURCETYPE
TARGETAPPDB
TARGETAPPNAME
BATCHSCRIPTDIR
EPMORACLEHOME
EPMORACLEINSTANCEHOME
Populate Context
fdmContext = fdmAPI.initContext(BigDecimal(LoadID))
print Location Name: + fdmContext[LOCNAME]
Clean-up Action
fdmAPI.closeConnection();
Questions