+ All Categories
Home > Technology > Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

Date post: 15-Apr-2017
Category:
Upload: ca-technologies
View: 107 times
Download: 0 times
Share this document with a friend
55
World ® ’1 6 Understanding when and how to use JavaScript at the Event, Application and Job Level John Rooney, CA Technologies, Sr. Principal Consultant MFX36E MAINFRAME AND WORKLOAD AUTOMATION
Transcript
Page 1: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

World®’16

UnderstandingwhenandhowtouseJavaScriptattheEvent,ApplicationandJobLevelJohnRooney,CATechnologies,Sr.PrincipalConsultant

MFX36E

MAINFRAMEANDWORKLOADAUTOMATION

Page 2: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

2 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

©2016CA.Allrightsreserved.Alltrademarksreferencedhereinbelongtotheirrespectivecompanies.

Thecontentprovidedinthis CAWorld2016presentationisintendedforinformationalpurposesonlyanddoesnotformanytypeofwarranty. The informationprovidedbyaCApartnerand/orCAcustomerhasnotbeenreviewedforaccuracybyCA.

ForInformationalPurposesOnlyTermsofthisPresentation

Page 3: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

3 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Abstract

AJavaScriptcanbeapowerfultooltoautomaticallyadjustApplication

andjobpropertiesatEventtriggertime.Therearemanyareasand

optionswhereaJavaScriptcanbeinvoked.Thissessionwillgoover

somebestpracticesforspecifyingJavaScripts attheEvent,Application

andJobLevelalongwithanylimitationsforCAWorkloadAutomation

(CAWA)DE.

JohnP.RooneyCATechnologiesSr.PrincipalConsultant

Page 4: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

4 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Agenda

SOMEINFORMATIONONJAVASCRIPTS

WHERECANJAVASCRIPTS BEEXECUTED

WHATARETHEBUILT-INUTILITIES

BESTPRACTICE

1

2

3

4

Q&A

SUMMARY5

6

Page 5: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

5 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

JavaScriptisascriptinglanguage

§ CAWorkloadAutomationDEusesRhinoasitsJavaScriptengine– writtenfullyinJavaandmanagedbytheMozillaFoundationasopensourcesoftware– Rhino1.6R2version– Itisaruntimeinterpreterwhichdoesnotgetcompiledintonativemachinecodeand

generallywillrunmoreslowlythanacompiledlanguage– Nothingtodowhenupgrading

§ TheserverusesJavaScriptrelease1.5asitsinternalscriptinglanguageandconformstoEdition3oftheECMA-262Standardforscriptinglanguages.– AnECMAScriptengineisaprogramthatexecutessourcecodewritteninaversionofthe

ECMAScriptlanguagestandard

Page 6: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

6 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

AgoodsiteforJavaScriptSyntax– w3schools.com/js

Page 7: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

7 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

AllowJavacallsinJavaScript

Page 8: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

8 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

MaximumLengthofJavaScript

Page 9: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

9 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

EndusersecurityisnormallysettoREAD

Page 10: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

10 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Whatarethe2mainpurposesofaJavaScriptforCAWADE?§ Usedasapre-processor

– forsettingupand/orcontrollingworkload

§ Usedasapost-processor– forsettingupand/orcontrollingworkload– Executingadditionalprocessesorintegrations

Page 11: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

11 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

YoucanuseJavaScripts to:

§ Createandmanipulatesymbolicvariables

§ Useserverbuilt-infunctions

§ Performcomparison,arithmetic,andlogicaloperations

§ Prepareprograminputandparameters

§ Builddecisionsintoschedules

§ Passdatatootherapplications

Page 12: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

12 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

HowmanyplacescanyouinvokeaJavaScript?

A.1

B.2

C.3

D.4

E.5

Page 13: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

13 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

YoucaninvokeaJavaScriptinthetheseplaces

§ TheEventdefinition

§ TheApplicationdefinition

§ TheJobdefinition

§ InanAlert

Page 14: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

14 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

GenerallytwowaystoinvokeaJavaScript

§ FromtheJavaScriptRepository– Generallytherecommendedplace– Canlocatewhereitisbeingused

§ EmbeddedIntheparticularApplication,JoborAlertdefinition– UsefulwhenmovingtheApplication/AlertfromoneCAWADEinstance

toanotheraspartofachangemanagementprocess– JavaScriptnotusedbyotherApplications,JobsorAlerts

Page 15: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

15 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

HowtofindwhereaJavaScriptintheRepositoryisbeingreferenced?§ SelectDeleteforaJavaScript

– ReferentialIntegrity

BUTDON’TDELETE!

Page 16: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

16 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Whatarethebuilt-inSymbolicPrefixes?

§ ESP– ScopeisacrossallApplications

§ APPL– ScopeislimitedtoanApplication

§ WOB– ScopelimitedtoaspecificJob

§ EVAR– ScopelimitedtoanApplication– IfsetintheEvent,cannotbeoverriddeninaJavaScript

Page 17: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

17 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

AquickwordaboutApplicationParameters– EVARprefixedsymbolics§ CanbeusedlikeaTemplate

– DefinemultipleEvents

§ ResolvedatEventTriggertime

§ CanreplacetheneedforaJavaScript

Page 18: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

18 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

AsummaryofPrefixesandJavaScriptlocationsSpecifying the

JavaScripttoexecute

CansetthesePrefixedSymbolics

Embedded Repository Executeoneormany ESP. APPL. WOB. EVAR.

Event No Yes Many Yes Yes No Yes

Application:

EventTriggerTime No Yes One Yes Yes No Yes

AtJobRunTime No* Yes One Yes Yes Yes Yes

Job:

EventTriggerTime Yes Yes One Yes Yes Yes Yes

AtRunTime Yes Yes* One Yes Yes Yes Yes

Alert Yes Yes One No No No No

*YoucanembedalocalJavaScriptintheApplicationdefinitiontobeinvokedbyajobatRuntime.YouthenselectthelocalJavaScriptfromtheRepositoryintheJobdefinition.

Page 19: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

19 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

OrderofsearchpreferenceofdefinedJavaScriptsforsymbolicresolution

1. JobatEventTrigger

2. ApplicationatEventTrigger

3. Event

4. Jobatruntime

5. Applicationatjobruntime

Thefirstplaceasymbolicvalueisfoundwillbetheoneused

Lastplacesearchedforsymbolicvalue

NOTE:IfyouhavemultipleJavaScripts executingatEventtriggertime,beawareofwhentheSymbolicgetssubstitutedIfitisasymbolicthatisnecessarytoberesolvedatEventTrigger,

thentheJobLevelJavaScriptexecutedatEventTriggertimewilltakeprecedence

Page 20: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

20 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

WhentoRuntheScript:EventTriggerorRunTime§ YoucanchoosetorunascriptatEventtriggertimeorwhenoneormore

jobsrun(atruntime).Whenyourunthescriptdependsonthekindsofvaluesyouarecalculatingwithinthescript.Someinformationisrequiredattriggertime(whentheApplicationbuilds)andotherinformationisrequiredatruntime.– Example,whenanEventtriggersandtheserverbuildstheApplication,theserverneeds

toknowwhichjobswill be runaspartofthatApplication.ThismeansthatallrunfrequenciesneedtoberesolvedatEventtriggertime.Theserver,however,doesnotneedtoknowtheargumentbeingpassedtoaUNIXscriptuntilthescriptisreadytorun.Thismeansthatargumentsdonotneedtoberesolveduntilruntime.

§ Note: Ifyouplantouseasymbolicvariableaspartofajobnameorqualifier,thesymbolicvariablemustbeassignedavalueatEventtriggertime.

Page 21: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

21 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ThefollowingApplicationandjobpropertiesmustberesolvedattriggertime.

PROPERTIES CAWADESKTOPCLIENTDIALOG CAWADESKTOPCLIENTFIELDS

Applicationname Applicationproperties dialog Name dialog

DefaultAgentname Applicationproperties dialog Agent dialog

Applicationrunfrequency Applicationproperties dialog Runfrequency section

Jobnameandqualifier JobdefinitionBasic dialog Name andQualifier fields

Jobrunfrequency JobdefinitionBasic dialog Runfrequency section

Notifications JobdefinitionNotifications dialog AllfieldswithintheAlerts tab

Jobresources JobdefinitionResources dialog Allfields

Jobtimedependencies JobdefinitionTimeDependencies dialog Allfields

Externaljobattributes ExternaljobdefinitionBasic dialog Allfields

Page 22: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

22 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ThefollowingfieldsmustberesolvedatruntimePROPERTIES CAWADESKTOPCLIENTDIALOG CAWADESKTOPCLIENTFIELDS

Emailaddresses NewEmailNotification dialog To field

Agentspecifications JobdefinitionBasic dialogAgentname,Commandtorun,Script/commandname, Argumentstopass,andUserID fields

Environmentvariables Jobdefinition Environment Variables dialog Name andValue fields

OS/400environmentspecifications Environment dialog

Libraryspecifications, Jobspecifications, andOS/400exitprogram fields

Exitcodes JobdefinitionExitCodes tab Code andInterpretation fields

TriggerconditionsforFiletriggerjobs

JobdefinitionBasic dialogJobdefinitionUser/Groupspecifications dialog

Filename fieldOwneruserID,group,andMonitorasuser fields

StepspecificationsforSAPR/3jobs JobdefinitionStepSpecifications dialog Allfields

AgentspecificationsforPeopleSoftjobs JobdefinitionBasic dialog Processname andProcesstype fields

Page 23: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

23 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

SpecifyingaJavaScriptintheEventDefinition

Page 24: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

24 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

JavaScriptdefinedintheEvent

§ WhentheEventisTriggered

§ ExecutesfromtheJavaScriptRepository

§ CanspecifythatmultipleJavaScriptstobeexecuted

Page 25: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

25 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

JavaScriptdefinedintheEventScenarios

§ YouwanttorunmultiplescriptswhentheEventistriggered.Incontrast,theApplicationdefinitionandjobdefinitionletyouspecifyonlyonescriptusingtheAtruntime optionandonescriptusingtheAtEventtriggertime option.

§ Note: SpecifyingonescriptintheEventdefinitionisequivalenttospecifyingthescriptintheApplicationdefinitionusingtheAtEventtriggertime option.

§ Thescriptdefinesorsetsvaluesforsystem-levelsymbolicvariables.ThenamesofthesevariablesbeginwiththeprefixESP.

§ ThescriptdefinesorsetsvaluesforApplication-levelsymbolicvariables.ThenamesofthesevariablesbeginwiththeprefixAPPL.

Page 26: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

26 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

SpecifyingaJavaScriptintheApplicationDefinition

Page 27: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

27 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

SpecifyingaJavaScriptintheApplicationDefinitionEditlocalscriptforjobstoexecutetheJavaScriptatruntime

Page 28: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

28 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

JavaScriptdefinedintheApplication

§ ProbablythemostcommonlydefinedJavaScriptiswhentheEventistriggered

§ YoucanspecifyaJavascripttobeexecutedbeforeeach(andevery)jobisexecuted

Page 29: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

29 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

JavaScriptdefinedintheApplicationScenarios

§ ThescriptdefinesorsetsvaluesforsymbolicvariablesthatneedtobeavailabletomultiplejobswithintheApplication.Thesevariablescanbesystem-level(thenamesbeginwiththeprefixESP)orApplicationlevel(thenamesbeginwiththeprefixAPPL).

§ ThescriptpassesparametersfromtheEventtotheApplication.

§ Thescriptdetermineswhethermultiplejobswill run.

§ Thescriptgeneratesdateandtimevariablestobeusedbymultiplejobs.

§ Thescriptdefinesorsetsvaluesforjob-levelsymbolicvariables.ThenamesofthesevariablesbeginwiththeprefixWOB.Forthesescripts,youmustselecttheAtruntime option.ThescriptrunswheneachjobintheApplicationstartstorun.

Page 30: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

30 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

SpecifyingaJavaScriptintheJobdefinition

Importfromalocaldirectory

Page 31: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

31 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

JavaScriptdefinedintheJob

§ WhentheEventistriggered

§ Beforethejobisrun

§ EitherspecificationcanbefromtheJavaScriptrepositoryorfromanembeddedJavaScriptinthejobdefinition

§ CreateWOB,APPL,ESP,EVARprefixedvariables

Page 32: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

32 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

JavaScriptdefinedintheJobScenarios§ Thescriptsetsvaluesforvariables usedbyasinglejob.

§ Thescriptsetsavariablewhosevaluemustbeconfinedtoasinglejob(thesymbolicvariableisusedinmultiplejobsbutmusthaveauniquevalueforeachjob).

§ Thescriptspecifiesruncriteriaforasinglejob.

§ ThescriptdefinesorsetsvaluesforsymbolicvariablesthatbeginwiththeprefixWOB.

§ Thescriptdefinesorsetsvaluesforsystem-levelsymbolicvariables.ThenamesofthesevariablesbeginwiththeprefixESP.

§ ThescriptdefinesorsetsvaluesforApplication-levelsymbolicvariables.ThenamesofthesevariablesbeginwiththeprefixAPPL.

Page 33: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

33 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

SpecifyingaJavaScriptinanAlert

Page 34: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

34 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

JavaScriptdefinedinanAlert

§ ExecuteaJavaScriptfromtherepositoryorfromanembeddedJavaScriptintheAlertdefinition

§ Usedtoexecutecommandsaspartofjobpost-processing

Page 35: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

35 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

JavaScriptdefinedinanAlertScenarios

§ Triggeradditionalworkloadautomatically

§ CompleteanApplicationwhenajobisoverdue

§ Resubmitajobifitcompleteswithaparticularexitcodebeforeaspecifictime

§ Executeuserdefinedapplicationintegrations– Openupservicedesktickets

Page 36: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

36 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

UseanAlerttopassinformationaboutajobwhentriggeringanEvent

Page 37: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

37 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

CreatingaJavaScript

§ ManyJavaScriptsareonlyonestatementandusebuilt-infunctionstodoanactionorsetasymbolic

§ YoudonotneedtobeanexperttostartdefiningaJavaScript– Lotsofexamplesinthedocumentation

Page 38: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

38 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Documentation

https://docops.ca.com/ca-wla-de/12-0/en/scheduling/javascripts/built-in-functions

Page 39: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

39 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

UsingContentAssistwhilecreatingaJavaScript

Page 40: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

40 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Somecommonlyusedbuilt-infunctionstoautomatecommandexecution§ execCommand(jobname|ALL|SUBAPPL(subApplname),

applnameAndGeneration,action)

§ execTrigger(eventname,ADD|REPLACE,time,NOHOLD|HOLD,userparameter1,userparameter4,userparameter3,userparameter2,rootjobs)

§ resetResourceProperty(resourceName,property,count)

Page 41: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

41 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Somecommonlyusedbuilt-infunctionsforDates

§ daysBetween(startDate,endDate,dateType)

§ daysFrom(date)§ daysTo(date)§ genTime(prefix,date)§ today(scheduleExpression)§ tomorrow(scheduleExpression)§ yesterday(scheduleExpression)

Page 42: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

42 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Somecommonlyusedbuilt-infunctionsforGlobalVariables§ decrementVar(name,context)

§ deleteVar(name,context)

§ getVar(name,context)

§ incrementVar(name,context)

§ setVar(name,value,context)

Page 43: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

43 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ExampleJavaScriptsthatyoushouldhaveinyourrepository§ LoadEventPrefixGlobalVariables

– loadContext(APPL,'%APPL._eventprefix');

§ ReadAPPL._ftfileandgetfilename– varpos=APPL._ftfile.lastIndexOf('\\');– APPL.filename=APPL._ftfile.substring(pos+1);

Page 44: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

44 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ExampleJavaScriptsthatyoushouldhaveinyourrepository§ KillLongRunningJob

– execCommand('%WOB._name','%(APPL._name).%(APPL._gen)','ACTIONKILL');

§ SelfCompleteorForceCompleteJobfromAlert– execCommand('%WOB._name','%(APPL._name).%APPL._gen','ACTION

COMPLETE');

Page 45: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

45 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ExampleJavaScriptsthatyoushouldhaveinyourrepository§ Retriggersameapplication

– execTrigger('%APPL._event','ADD');

§ TRIGGEREVENTANDPASSUSERPARAMETERS– execTrigger(‘Prefix.Application','','','','%WOB._name','%WOB._qualifier,

'%APPL._name','%APPL._gen');

§ Retriggersameeventiftimeisnot7pm– if(WOB._RHH<'19'&&APPL._SDATE==WOB._RDATE);

execTrigger('%APPL._event','ADD');

Page 46: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

46 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ExampleJavaScriptsthatyoushouldhaveinyourrepository§ Gentime FirstDayofCurrentmonthinYYYYMMDDFormat

– genTime('FD','first dayofmonthless1month');APPL.first_day_of_month_yyyymmdd =FDYEAR+FDMM+FDDD

§ TodayinYYYYMMDDFormat– TODAY=‘%APPL._SYY%APPL._SMM%APPL._SDD'

Page 47: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

47 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ExampleJavaScriptsthatyoushouldhaveinyourrepository§ SettimesbasedondayoftheweekusingIf/Else

elseif(TDDOWNUM=='5'){APPL.Start_batch="5PM";APPL.Late_end ="5AMtomorrow";}elseif(TDDOWNUM=='6'){APPL.Start_batch="6PM";APPL.Late_end ="6AMtomorrow";}elseif(TDDOWNUM=='7'){APPL.Start_batch="7PM";APPL.Late_end ="7AMtomorrow";}else{APPL.Start_batch="8PM";APPL.Late_end ="8AMtomorrow";}

genTime('TD','today');if(TDDOWNUM=='1'){APPL.Start_batch="1PM";APPL.Late_end ="1AMtomorrow";}elseif(TDDOWNUM=='2'){APPL.Start_batch="2PM";APPL.Late_end ="2AMtomorrow";}elseif(TDDOWNUM=='3'){APPL.Start_batch="3PM";APPL.Late_end ="3AMtomorrow";}elseif(TDDOWNUM=='4'){APPL.Start_batch="4PM";APPL.Late_end ="4AMtomorrow";}

Page 48: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

48 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

ExampleJavaScripts thatyoushouldhaveinyourrepository§ SettimesbasedondayoftheweekusingSwitch

case'5':APPL.Start_batch="5PM";APPL.Late_end ="5AMtomorrow";break;case'6':APPL.Start_batch="6PM";APPL.Late_end ="6AMtomorrow";break;case'7':APPL.Start_batch="7PM";APPL.Late_end ="7AMtomorrow";break;default:Start_batch="8PM";Late_end ="8AMtomorrow";}

genTime('TD','today');switch(TDDOWNUM){case'1':APPL.Start_batch="1PM";APPL.Late_end ="1AMtomorrow";break;case'2':APPL.Start_batch="2PM";APPL.Late_end ="2AMtomorrow";break;case'3':APPL.Start_batch="3PM";APPL.Late_end ="3AMtomorrow";break;case'4':APPL.Start_batch="4PM";APPL.Late_end ="4AMtomorrow";break;

Page 49: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

49 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

NamingConventions

§ Forsomebuilt-infunctions,includethefunction– GentimeYesterday– ResetResourceAvailability– SetVarSubAPPLB

§ Orincludetheactionoroutcome– RetriggersameEvent– ForceCompleteJob– ReadAPPL_ftfileandgetfilename

Page 50: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

50 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Summary

§ JavaScriptcanprovideforpassing“uptothemomentofjobsubmission”datatoajob

§ JavaScriptisextremelyusefulforpost-processingofjobsandtriggeringadditionalprocessing

§ StoringJavaScriptsintherepositoryandusingsymbolicsinthecommandsenablesa“writeonce,usemany”scenario

Page 51: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

51 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

RecommendedSessionsSESSION# TITLE DATE/TIME

MFX23EBestPractices:CAWLADEArtifactstoMoveAppsthroughtheDevelopmentLifecycle

11/14/2016at4:00pm

JasmineB

MFX141ELLab:IncreasedAgilityandFlexibilitywithWebServicesforCAWLADEandESP

11/15/2016at9:30am

SouthSeasD

MFX30S CustomerUseCase:RealWorldAutomationinRetail11/16/2016at3:45pm

BanyanA/B

MFX136SDeliveringCAWorkloadAutomationfromaSaaSplatform

11/17/2016at4:30pm

JasmineB

Page 52: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

52 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

MustSeeDemos

Innovations:CrossEnterpriseWorkloadAutomationCAWLADE&AEMFandWorkloadAutomation

SeamlessApplicationAutomationAgents&AdvancedIntegrationsMFandWorkloadAutomation

CAConversionasaService

CAWorkloadAutomationMFandWorkloadAutomation

ModernWorkloadAutomation

CAWLADEMFandWorkloadAutomation

Page 53: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

@CAWORLD#CAWORLD ©2016CA.AllRIGHTSRESERVED.53 @CAWORLD#CAWORLD

MainframeandWorkloadAutomation

FormoreinformationonMainframeandWorkloadAutomation,pleasevisit:http://cainc.to/9GQ2JI

Page 54: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

54 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Questions?

Page 55: Pre-Con Ed: Understanding when and how to use JavaScript at the Event, Application and Job Level

55 ©2016CA.ALLRIGHTSRESERVED.@CAWORLD#CAWORLD

Thankyou

Stayconnectedatcommunities.ca.com


Recommended