Paragraph Style
Font Name
Real font size
Apply CSS Class
Custom Links
Zoom
%3cdiv style%3d%22float%3a left%3b line-height%3a 14px%3bfont-family%3a Verdana%3b font-size%3a 10pt%3b%22%3e %3cmeta name%3d%22ProgId%22 content%3d%22Word.Document%22 /%3e%3cmeta name%3d%22Generator%22 content%3d%22Microsoft Word 12%22 /%3e%3cmeta name%3d%22Originator%22 content%3d%22Microsoft Word 12%22 /%3e%3clink rel%3d%22File-List%22 /%3e%3clink rel%3d%22Edit-Time-Data%22 /%3e%3cstyle%3e v%5c%3a* %7bbehavior%3aurl%28%23default%23VML%29%3b%7d o%5c%3a* %7bbehavior%3aurl%28%23default%23VML%29%3b%7d w%5c%3a* %7bbehavior%3aurl%28%23default%23VML%29%3b%7d .shape %7bbehavior%3aurl%28%23default%23VML%29%3b%7d %3c/style%3e%3clink rel%3d%22themeData%22 /%3e%3clink rel%3d%22colorSchemeMapping%22 /%3e%3cstyle%3e %26amp%3bamp%3bamp%3bamp%3bamp%3bamp%3bamp%3bamp%3blt%3b%21-- /* Font Definitions */ @font-face %7bfont-family%3a%22Cambria Math%22%3b panose-1%3a0 0 0 0 0 0 0 0 0 0%3b mso-font-charset%3a1%3b mso-generic-font-family%3aroman%3b mso-font-format%3aother%3b mso-font-pitch%3avariable%3b mso-font-signature%3a0 0 0 0 0 0%3b%7d @font-face %7bfont-family%3aCalibri%3b panose-1%3a2 15 5 2 2 2 4 3 2 4%3b mso-font-charset%3a0%3b mso-generic-font-family%3aswiss%3b mso-font-pitch%3avariable%3b mso-font-signature%3a-1610611985 1073750139 0 0 159 0%3b%7d /* Style Definitions */ p.MsoNormal%2c li.MsoNormal%2c div.MsoNormal %7bmso-style-unhide%3ano%3b mso-style-qformat%3ayes%3b mso-style-parent%3a%22%22%3b margin-top%3a0in%3b margin-right%3a0in%3b margin-bottom%3a10.0pt%3b margin-left%3a0in%3b line-height%3a115%25%3b mso-pagination%3awidow-orphan%3b font-size%3a11.0pt%3b font-family%3a%22Calibri%22%2c%22sans-serif%22%3b mso-ascii-font-family%3aCalibri%3b mso-ascii-theme-font%3aminor-latin%3b mso-fareast-font-family%3aCalibri%3b mso-fareast-theme-font%3aminor-latin%3b mso-hansi-font-family%3aCalibri%3b mso-hansi-theme-font%3aminor-latin%3b mso-bidi-font-family%3a%22Times New Roman%22%3b mso-bidi-theme-font%3aminor-bidi%3b%7d .MsoChpDefault %7bmso-style-type%3aexport-only%3b mso-default-props%3ayes%3b mso-ascii-font-family%3aCalibri%3b mso-ascii-theme-font%3aminor-latin%3b mso-fareast-font-family%3aCalibri%3b mso-fareast-theme-font%3aminor-latin%3b mso-hansi-font-family%3aCalibri%3b mso-hansi-theme-font%3aminor-latin%3b mso-bidi-font-family%3a%22Times New Roman%22%3b mso-bidi-theme-font%3aminor-bidi%3b%7d .MsoPapDefault %7bmso-style-type%3aexport-only%3b margin-bottom%3a10.0pt%3b line-height%3a115%25%3b%7d @page Section1 %7bsize%3a8.5in 11.0in%3b margin%3a1.0in 1.0in 1.0in 1.0in%3b mso-header-margin%3a.5in%3b mso-footer-margin%3a.5in%3b mso-paper-source%3a0%3b%7d div.Section1 %7bpage%3aSection1%3b%7d --%3e %3c/style%3e%3cp%3eCreating a custom execution method can be very helpful in customizing how JAMS runs jobs. It is possible to utilize a technology which JAMS does not interface with out of the box%2c or modify an existing execution method to add%2c or customize functionality. In this guide%2c we will copy an existing execution method and modify how it runs jobs.%3c/p%3e%3cp%3eYou can find a list of the JAMS execution methods by selecting the Management tab%2c and then clicking on the Execution Methods icon.%3c/p%3e%3cp align%3d%22center%22%3e%3cspan%3e%3cimg src%3d%22http%3a//www.jamssupport.com/Uploads/Images/ParsedExecution/DefaultExecutionMethods.jpg%22 /%3e%3c/span%3e%3c/p%3e%3cp%3eFor this example%2c we will be copying the Parsed Windows Command procedure to a new execution method and adding some custom functionality.%3c/p%3e%3cp /%3e%3cp%3eFirst%2c we need to create a new execution method in JAMS. We can add a new execution method by clicking on the Add icon in the above dialog. This will start the JAMS Execution Method Definition Wizard. In the wizard%2c we must specify a unique name. Also%2c we can enter a description of the new method.%3c/p%3e%3cp align%3d%22center%22%3e%3cspan%3e%3cimg src%3d%22http%3a//www.jamssupport.com/Uploads/Images/ParsedExecution/AddExecutionMethod.jpg%22 /%3e%3c/span%3e%3c/p%3e%3cp align%3d%22center%22 /%3e%3cp%3eNext%2c we must specify an Execution Type. We will be selecting Batch.%3c/p%3e%3cp align%3d%22center%22%3e%3cspan%3e%3cimg src%3d%22http%3a//www.jamssupport.com/Uploads/Images/ParsedExecution/ExecutionType.jpg%22 /%3e%3c/span%3e%3c/p%3e%3cp /%3e%3cp%3eThe new execution method will now be added to the execution method list. We can now edit the new definition further. Open the definition and select the Source tab. In Job Module field%2c enter the name of the template library which will be used. We will be creating a new one later in this example called CustomParsed. Also%2c enter cmd as the Default File Extension.%3c/p%3e%3cp align%3d%22center%22%3e%3cspan%3e%3cimg src%3d%22http%3a//www.jamssupport.com/Uploads/Images/ParsedExecution/SourceSettings.jpg%22 /%3e%3c/span%3e%3c/p%3e%3cp /%3e%3cp%3eNow%2c select the Execution tab. In the Command field%2c enter “cmd.exe /c %22%7b0%7d%22”. %3c/p%3e%3cp align%3d%22center%22%3e%3cspan%3e%3cimg src%3d%22http%3a//www.jamssupport.com/Uploads/Images/ParsedExecution/ExecutionSettings.jpg%22 /%3e%3c/span%3e%3c/p%3e%3cp align%3d%22center%22 /%3e%3cp%3eThere are other properties which may be needed for other execution methods. A full list of the available execution method properties%2c and descriptions of the properties can be found here%3a %3ca href%3d%22http%3a//www.mvpsi.com/doc/JAMSClient/MethodsProperties.html%22%3ehttp%3a//www.mvpsi.com/doc/JAMSClient/MethodsProperties.html%3c/a%3e%3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e%3c/p%3e%3cp /%3e%3cp%3eNow that we have created a new entry in JAMS for our custom execution method%2c we need to create a new Job Module in the BaseMacros.xml file. This file provides JAMS with a template for parsing a Job’s command procedure. To add a new entry to the file%2c open the BaseMacros.xml file which is located in C%3a%5cProgram Files%5cMVPSI%5cJAMS%5cScheduler%5cBaseMacros.xml%3c/p%3e%3cp%3eSince we are adding functionality to an existing execution method%2c we can copy the existing macro for Parsed jobs. This is the first Macro entry in the file.%3c/p%3e%26lt%3bMacro name%3d%22Parsed%22%3e %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e %26lt%3bCode%3e %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e %26lt%3b%21%5bCDATA%5bREM JAMS Parsed Macro %26lt%3b%25Symbol%28JAMS.Parameters%29%25%26gt%3b %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e %26lt%3b%26lt%3bJAMS.Source%3e%3e %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e exit %25errorlevel%25 %5d%5d%3e %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e %26lt%3b/Code%3e %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e%26lt%3b/Macro%3e%3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e%3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3eCopy and paste this code back into the BaseMacros.xml file%2c inside of the %26lt%3bArrayOfMacro%3e tags. We will now change the macro to provide our custom functionality. First%2c we need to change the name of the macro to match the execution method’s Job Module property. In this example%2c it is “CustomParsed”. Next%2c we can begin changing the macro. When a job executes%2c the code contained within the “%26lt%3bCode%3e%26lt%3b%21%5bCDATA%5b“ tags will be evaluated by JAMS%2c and then sent to where the execution method properties specify. %3cp%3eJAMS can retrieve data from the job currently executing. This data is then used to execute the job. Data is contained within the %26lt%3b%26lt%3b%3e%3e tags. JAMS can also evaluate and insert other macros%2c which are contained in the %26lt%3b%25%25%3e tags.%3c/p%3e%3cp%3eIn this example code%2c the JAMS.Parameters collection%2c and the JAMS.Source property are being referenced. The objects you can retrieve data from are as follows%3a%3c/p%3e %3ctable cellspacing%3d%220%22 cellpadding%3d%220%22 border%3d%221%22%3e %3ctbody%3e %3ctr%3e %3ctd width%3d%22319%22 valign%3d%22top%22%3e%3cp%3eSystem%3c/p%3e%3c/td%3e %3ctd width%3d%22319%22 valign%3d%22top%22%3e%3cp%3eThe Job or Setup’s JAMS System%3c/p%3e%3c/td%3e%3c/tr%3e %3ctr%3e %3ctd width%3d%22319%22 valign%3d%22top%22%3e%3cp%3eSetup%3c/p%3e%3c/td%3e %3ctd width%3d%22319%22 valign%3d%22top%22%3e%3cp%3eOnly accessible when running a Setup%3c/p%3e%3c/td%3e%3c/tr%3e %3ctr%3e %3ctd width%3d%22319%22 valign%3d%22top%22%3e%3cp%3eJob%3c/p%3e%3c/td%3e %3ctd width%3d%22319%22 valign%3d%22top%22%3e%3cp%3eOnly accessible when running a Job%3c/p%3e%3c/td%3e%3c/tr%3e %3ctr%3e %3ctd width%3d%22319%22 valign%3d%22top%22%3e%3cp%3eSetupJob%3c/p%3e%3c/td%3e %3ctd width%3d%22319%22 valign%3d%22top%22%3e%3cp%3eOnly accessible when running a Setup%3c/p%3e%3c/td%3e%3c/tr%3e %3ctr%3e %3ctd width%3d%22319%22 valign%3d%22top%22%3e%3cp%3eCurrent%3c/p%3e%3c/td%3e %3ctd width%3d%22319%22 valign%3d%22top%22%3e%3cp%3eThe CurJob object%3c/p%3e%3c/td%3e%3c/tr%3e %3ctr%3e %3ctd width%3d%22319%22 valign%3d%22top%22%3e%3cp%3eNode%3c/p%3e%3c/td%3e %3ctd width%3d%22319%22 valign%3d%22top%22%3e%3cp%3eA NodeInfo object%3c/p%3e%3c/td%3e%3c/tr%3e %3ctr%3e %3ctd width%3d%22319%22 valign%3d%22top%22%3e%3cp%3eSource%3c/p%3e%3c/td%3e %3ctd width%3d%22319%22 valign%3d%22top%22%3e%3cp%3eThe Source property provided by the Job%3c/p%3e%3c/td%3e%3c/tr%3e %3ctr%3e %3ctd width%3d%22319%22 valign%3d%22top%22%3e%3cp%3eNotifyEMail%3c/p%3e%3c/td%3e %3ctd width%3d%22319%22 valign%3d%22top%22%3e%3cp%3eThe final list of email addresses to be notified. This is a combination of e-mail addresses from the DefaultNotifyEmail config setting%2c System%2c Setup%2c and Job notify lists.%3c/p%3e%3c/td%3e%3c/tr%3e%3c/tbody%3e%3c/table%3e%3cp /%3e%3cp%3eYou can reference any of the above objects starting by starting with “JAMS.”. So%2c if we want to retrieve a description of the System this job is running under%2c we would use %26lt%3b%26lt%3bJAMS.System.Description%3e%3e in our macro. It is possible to access any public property from any of the above objects. If one of the above objects are not specified%2c the Current object is inserted. So%2c in the macro source%2c %26lt%3b%26lt%3bJAMS.JobName %3e%3e and %26lt%3b%26lt%3bJAMS.Current. JobName %3e%3e would evaluate to the same value. The properties of the above objects can be found in our documentation%2c here%3a %3ca href%3d%22http%3a//www.mvpsi.com/doc/ProgrammerReference/Default.html%22%3ehttp%3a//www.mvpsi.com/doc/ProgrammerReference/Default.html%3c/a%3e%3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e%3c/p%3e%3cp%3eParameters and variable values can also be accessed. If you do not start out the reference with “JAMS.”%2c the value of a Parameter or JAMS variable will be used instead%2c if one is found. So%2c if your job specifies a parameter named “FileLocation”%2c you can access the value from the macro by using “%26lt%3b%26lt%3bFileLocation%3e%3e”.%3c/p%3e%3cp%3eIt is also possible to add formatting to a value. For example%2c we could use %26lt%3b%26lt%3bJAMS.Current.StartTime%28”d”%29%3e%3e to format the StartTime of the Current job in a Short Date pattern. Any format supported by the .NET String.Format method can be used. A listing of these formats can be found here%3a %3ca href%3d%22http%3a//msdn.microsoft.com/en-us/library/fbxft59x.aspx%22%3ehttp%3a//msdn.microsoft.com/en-us/library/fbxft59x.aspx%3c/a%3e%3c/p%3e%3cp%3eMacro tags will insert another macro from within the BaseMacros.xml file. They can be used with any object which supports the IEnumerable interface. In this example%2c the Symbol macro is used. %3c/p%3e%3cp%3e%26lt%3b%25Symbol%28JAMS.Parameters%29%25%3e%3c/p%3e%3cp%3eIt will be inserted once for each of the JAMS.Parameters which are retrieved from the job at execution time. The Symbol macro is as follows%3a%3c/p%3e%26lt%3bMacro name%3d%22Symbol%22%3e %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e %26lt%3bCode%3e %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e %26lt%3b%21%5bCDATA%5bSET %26lt%3b%26lt%3bNAME%3e%3e%3d%26lt%3b%26lt%3bVALUE%3e%3e %5d%5d%3e %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e %26lt%3b/Code%3e %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e%26lt%3b/Macro%3e %3cp /%3e%3cp%3e%3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3eOnce inside of a sub macro%2c you can access the properties of the current object within the enumeration by specifying the property name within angle brackets. So%2c for each parameter in the JAMS.Current.Parameters collection%2c the Symbol macro is inserted. Then%2c the values of the NAME and VALUE properties are retrieved and inserted into the SET line. %3c/p%3e%3cp%3eWhen the default Parsed macro is executed%2c it looks similar to this%3a%3c/p%3e%3cp%3e%3cspan%3eC%3a%5cWindows%5csystem32%3eREM JAMS Parsed Macro%3c/span%3e%3c/p%3e%3cp%3e%3cspan%3eC%3a%5cWindows%5csystem32%3eSET Param1%3dValue1%3c/span%3e%3c/p%3e%3cp%3e%3cspan%3eC%3a%5cWindows%5csystem32%3eSET Param2%3dValue1%3c/span%3e%3c/p%3e%3cp%3e%3cspan%3eC%3a%5cWindows%5csystem32%3eREM Source of Job inserted here%3c/span%3e%3c/p%3e%3cp%3e%3cspan%3eC%3a%5cWindows%5csystem32%3eexit 0%3c/span%3e%3c/p%3e%3cp /%3e%3cp%3e%3cspan%3eNow that we have an understanding of how the parsing works%2c we can modify the default to add some custom functionality. We will be adding a couple of lines to the beginning of the job execution to better log what job is being executed. Make the highlighted changes to the CustomParsed macro we pasted into the BaseMacros.xml file.%3c/span%3e%3c/p%3e%26lt%3bMacro name%3d%22%3cspan class%3d%22Highlight%22%3eCustomParsed%3c/span%3e%22%3e %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e %26lt%3bCode%3e %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e %26lt%3b%21%5bCDATA%5bREM JAMS %3cspan class%3d%22Highlight%22%3eCustom %3c/span%3eParsed Macro %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e%3cspan%3e %3cspan class%3d%22Highlight%22%3eREM Job Name%3a %26lt%3b%26lt%3bJAMS.Current.JobName%3e%3e%3c/span%3e %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e %3cspan class%3d%22Highlight%22%3eREM Job Description%3a %26lt%3b%26lt%3bJAMS.Job.Description%3e%3e%3c/span%3e %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e %3c/span%3e%3cspan class%3d%22Highlight%22%3e%3cspan%3eREM Running under System%3a %26lt%3b%26lt%3bJAMS.System.SystemName%3e%3e %3c/span%3e%3c/span%3e%3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e %26lt%3b%25Symbol%28JAMS.Parameters%29%25%3e %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e %26lt%3b%26lt%3bJAMS.Source%3e%3e %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e exit %25errorlevel%25 %5d%5d%3e %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e %26lt%3b/Code%3e %3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e%26lt%3b/Macro%3e %3cp%3eNow%2c save the BaseMacros.xml file. In order for the new macro to be used%2c the JAMSScheduler service must be restarted. This must be done every time a change is made to the BaseMacros.xml file%2c or the changes will not take effect when job runs. This can be done in Windows PowerShell using the command Restart-Service JAMSScheduler.%3c/p%3e%3cp%3eOnce the service has restarted%2c we can create a new job to test the execution method we just made%2c or change the execution method of an existing job. This property can be found in the Source Options tab of a job definition.%3c/p%3e%3cp align%3d%22center%22%3e%3cspan%3e%3cimg src%3d%22http%3a//www.jamssupport.com/Uploads/Images/ParsedExecution/SourceOptions.jpg%22 /%3e%3c/span%3e%3c/p%3e%3cp%3eNote%3a If you do not see the CustomParsed Execution method in the dialog%2c you may need to hit the Refresh button in order for the newly created method to appear.%3c/p%3e%3cp%3eNow%2c submit the job and view the resulting log file when the job completes. You can now see that the additional information we inserted in the BaseMacros.xml file has been parsed%2c and the additional logging comments have been displayed successfully.%3c/p%3e%3cp align%3d%22center%22%3e%3cspan%3e%3cimg src%3d%22http%3a//www.jamssupport.com/Uploads/Images/ParsedExecution/Log.jpg%22 /%3e%3c/span%3e%3c/p%3e%3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3e%3cspan style%3d%22font-size%3a 4pt%3b%22%3e%3cp%3e%3c/p%3e%3c/span%3eMVP Systems - Support%3cbr /%3ehttp%3a//www.jamssupport.com/KnowledgebaseArticle50017.aspx%3c/div%3e
Design
HTML
Preview