Home

Meta-Update User`s Guide

image

Contents

1. AssignPre Specifies the assignment sections to be applied directly after loading the section s record This is applied before any subsequent Loads Updates or Assignments AssignPost Specifies the assignment sections to be applied directly after completing any updates but before any launches and the next iteration of the section This is applied whether an error occurred or not AssignPostOk Specifies the assignment sections to be applied directly after completing any updates but before any launches and the next iteration of the section This is applied whether only when an error did not occur in the update or any launches This is applied before the AssignInitPost sections Meta Update 160 User s Guide SAY Software Tool House Inc AssignPostErr Specifies the assignment sections to be applied directly after completing any updates but before any launches and before the next iteration of the section This is applied whether only when an error did occur in either the update or any launches This is applied before the AssignInitPost sections AssignPostLaunch Specifies the assignment sections to be applied directly after all launches are invoked if any but before the next iteration of the section This is applied whether only when an error did occur in either the update or any launches T Each of these keywords specifies assignment sections that have either and ARS record or
2. d sfap d trce my script log There are two versions of Meta Update one uses local tracing and produces a trace file in the current working directory of where the program is run Local Tracing The local trace file is called SthMupd Log unless a file name is specified on the a switch SthMupd Log can be found in the current working directory of the Command Prompt or shell where Meta Update was run from This file is appended to with each execution of Meta Update sthMupd log will continuously grow in size It is recommended that you delete the file before the next execution of Meta Update There is no locking mechanism for multiple instances of Meta Update running simultaneously in the same directory This can happen when ARS workflow fires a Meta Update process on the server It is recommended that if Meta Update will be used in workflow or in multiple concurrent instances on a single machine that the Trace server version be used The Trace server must be running For ad hoc runs of Meta Update from a client machine it may be more convenient to use the local trace version When using the d switch a great deal of logging information may be written With or without full tracing a file is created or appended to each Meta Update is run This file will grow in size It is the user s responsibility to remove this file from time to time as appropriate Meta Update 72 User s Guide SAY Software Tool House Inc
3. 1 Arg HpdId Assign Assignment Summary Auto Status Assigned include asg desc ini Router down auto raised by Xxx Description Description The script above is entirely the same as the script below Server ArsDev User Demo Arg HpdId Controls Update Assign Tgt HPD HelpDesk 1 Arg HpdId Assignment Assignment Description w Router down Description auto raised by Xxx Summary Auto Status Assigned Meta Update 98 User s Guide SAY Software Tool House Inc Section Types There are several types of sections used in the ini file These are Main gives the updating ARS server and sign on information Read Servers gives ARS server and sign on information Control specifies the operation you want Meta Update to perform You can iterate through a query or loop and output files and ARS records File defines the format of an external ASCII file that will either be read or written Field defines a set of fields to be associated with an external ASCII file an SQL result set a regular expression pattern Used to specify value transformations and interpretations Assignment contains the actual field assignments to be made to the target form These can include other assignment sections and can reference Look Up sections Look Up offers a non Remedy mechanism for translating data values
4. ccccccccsssceeesseeeeeeneeeeeees 73 S Script Debugging Commande 87 Source Including Files AAA 98 Source Fomat 96 Scripts Developing iinei iirinn 77 SthMupdLic Environment Variable 61 SthScriptPath Environment Variable 60 Sections Control IN Concepts oeeeneeeeeeneeereeererenereeeee ee 33 Types in Concepts arrrrrrvvnrnvrnrrvrnnnvnnennr 32 Select field variable See QyerySal Statement Server Processes Assignment Commande 188 Session Timeouts 2 See Timeouts Set Schema Assignment Commande 196 Simple References defined in Concepts rrronvrnonvrnvrvrnnnvnnennr 28 Sleep Gtoatement cesses 138 Sort See Loop Statement See Query statement Spawn Assignment Commande 175 SQL Lookll e siie ionene 210 Query OI ieii noaie 38 Statements in Control Gechons 109 Operational in Control sections 111 stderr Assignment Commandes 190 RUNNING PE 67 stdout Assignment Commande 190 RUNNING ME 67 Step Step a Script in Debugoger 89 SthMupdLic Environment Variable 61 SthScriptPath Environment Variable 60 String References rnnrnnnnnnannrnnnrnnnnnnnnnrnnnnnnnnnnn 29 String Reference See References String User s Guide SJ Software Tool House Inc T Timeouts Trace Assignment Command TraceTrace Assignment Commande Tracing ARS Client Log switches Local Log File Local Tr engiu us aint eles Message Format Server Tr
5. where nnn nn is a sequence of digits with an optional decimal point decimal portion XXX is an ISO currency code allowed in the field being assigned date is a formatted date value yyyy mm dd hh mm ss See date fields above for more information nnn nn the value part for a functional currency XXX the ISO currency code for a functional currency Examples 123 62 123 62 EUR 123 62 EUR 2005 10 01 14 30 136 89 USD 174 29 CAD 123 62 EUR 2005 10 01 136 89 USD 174 29 CAD It is an error to specify a currency code that is not defined as being permitted for the field As of release 6 3 or ARS this is an error not caught and results in a null assignment to the field Meta Update catches this error and does not attempt the assignment or the update An Error message is produced and the update fails Meta Update 217 User s Guide SAY Software Tool House Inc Numeric Fields Numeric Fields are specified as an optional leading sign indicator and a sequence of digits Integers can only have digits Real numbers may have a decimal point and more digits Numeric constants in assignment sections must be specified in the expected format References from ARS records are always in the correct format References from CSV files must have their values transposed into the expected formats For data is in a CSV file the Subst formatting option can be used to remove thousands separators and to convert the decimal point into a period when req
6. Exactly one or zero iteration statements may be coded If none are coded the section performs its process exactly once producing a single output if coded If an iteration statement is coded the section loops based on the results of the iteration statement loading the values into the specified tag and producing its output if coded as many times as it iterates Query Optional A single Query statement is allowed If coded a query is executed and the records returned from the query are iterated through They are loaded one by one and the assignment sections are applied to a new or retrieved update record As many records as there are returned from the query are produced for the target schema Query SvrTag amp Tag amp Schema amp sort Fld Ascending Descending amp Query SvrTag If coded specifies that the Query is to be run against the specified Read Server Tag As each record is loaded references to the record s fields are made with this Tag Schema This is the name of the ARS form to query sort Specifies a sort order Records are normally retrieved in the sort order specified by the form definition with the admin tool The default sort order is by Request ID which is generally from oldest to newest Query This is an ARS query to be performed The Query format is the same as that which is acceptable in the Advanced Query bar in the BMC User Tool That is field labels and not database names
7. RW Kl RW RW RW RW RW RW RW RW RW RW RW 229 Example Value SQL SQL Server Server 18 7 6 04 Build 002 201101141059 1 0 0 1179711 ARSystem x86 64 Windows Server 2003 D Apps BMC ARSystem ARServer Db 5 ARSystem E Logs ARS a001 log 0 2 1 E Logs ARS a001 log E Logs ARS a001 log N OO CH 008 R2 SP1 10 50 2500 0 X64 OD N Logs ARS a001 log MN mo Logs ARS a001 log CO CO OO OO h 050560C63F6 User s Guide SJM T Software Tool House Inc DS_SVR_LICENSE DS_MAPPING DS_PENDING DS_RPC_SOCKET DS_LOG_FILE SUPPRESS_WARN HOSTNAME FULL_HOSTNAME SAVE_LOGIN U_CACHE_CHANGE G_CACHE_CHANGE STRUCT_CHANGE CASE_SENSITIVE SERVER_LANG ADMIN_ONLY CACHE_LOG_FILE FLASH_DAEMON THREAD_LOG_FILE ADMIN_TCP_PORT ESCL_TCP_PORT FAST_TCP_PORT LIST_TCP_PORT FLASH_TCP_PORT TCD_TCP_PORT DSO_DEST_PORT INFORMIX_DBN INFORMIX_TBC INGRES_VNODE ORACLE_SID ORACLE_TWO_T SYBASE_CHARSET SYBASE_SERV SHARED_MEM SHARED_CACHE CACHE_SEG_SIZE DB_USER NFY_TCP_PORT FILT_MAX_TOTAL FILT_MAX_STACK DEFAULT_ORDER_BY DELAYED_CACHE DSO_MERGE_STYLE EMAIL_LINE_LEN EMAIL_SYSTEM INFORMIX_RELAY_MOD PS_RPC_SOCKET REGISTER_PORTMAPPER SERVER_NAME DBCONF APPL_PENDING Meta Update 230 Server Distributed Mapping Distributed Pending E Logs ARS a001 log sthvmwin2003 sthvmwin2003 1332947367 1332944611 1348325258 1 ENU UTF 8 0 0
8. as the update query Like the backup script the File s fields are copied from the schema and the schema in the query and the file s field s copy is the SArg schemas reference Because the file s fields are copied the file s field 1 is the first schema field or field 1 and this is used in the Update query Meta Update 285 User s Guide SJT Software Tool House Inc The Update is done with the Merge API and with Merge workflow inhibited It is only through the Merge API that core fields may be set such as Request ID Submitter Create Date Note that this restore script will not work with Join forms unless Merge workflow is allowed A write to a join can only write to the database if the filters on that join fire The Assignment section for the ARS Table Update is the same for new or updated records If there are any attachment fields and the backup data indicates that it is non null a string is assigned with two file names original attachment name attachment file C dir xxx xxx prefix ReqId FieldId att Meta Update can process attachment values as references single file strings or double file strings In the case of a double file string the second string is the file in the file system that contains the data of the attachment and the first name is the file name set into the attachment value Because the file is copied from the table a simple copy assignment command will set all fields to th
9. og 0 Distributed Pool 86400 2700 1 2 509 0 AR System Message Catalog Alert Events 1 il User s Guide SAY Software Tool House Inc DISABLE ADMIN OPERATIONS DISABLE ESCALATIONS ALERT LOG FILE DISABLE ALERTS CHECK ALERT USERS ALERT SEND TIMEOUT ALERT OUTBOUND PORT ALERT SOURCE AR ALERT SOURCE FB DSO USER PASSWD DSO TARGET PASSWD APP SERVICE PASSWD MID TIER PASSWD PLUGIN LOG FILE SVR STATS REC MODE SVR STATS REC INTERVAL DEFAULT WEB PATH FILTER API RPC TIMEOUT DISABLED CLIENT PLUGIN PASSWD PLUGIN ALIAS PLUGIN TARGET PASSWD REM WKFLW PASSWD REM WKFLW TARGET PASSWD EXPORT SVR OPS INIT FORM ENC PUB KEY ALG IP NAMES DSO CACHE CHK INTERVAL DSO MARK PENDING RETRY DSO RPCPROG NUM DELAY RECACHE TIME DFLT ALLOW CURRENCIES CURRENCY_INTERVAL ORACLE_CURSOR_SHARE DB2_DB_ALIAS DB2_SERVER DFLT_FUNC_CURRENCIES EMAIL_IMPORT_FORM EMAIL AIX USE OLD EMAIL TWO DIGIT YEAR CUTOFF ALLOW BACKQUOTE IN PROCESS DB CONNECTION RETRIES DB CHAR SET CURR PART VALUE STR CURR PART TYPE STR CURR PART DATE STR Meta Update RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW AAD A 232 0 0 E Logs ARS a001 log 0 0 7 0 AR FB E Logs ARS a001 log 0 60 http sthvmwin2003 8080 arsys 180 ARSYS ARF REGISTRY ARSYS ARF REGIS TRY sthvmwin2003 9999 ARSYS ARD
10. yields false abcdef A yields false abcdef A yields true A string containing all digits is converted into a number when being compared against a number or when being used as a Boolean value by itself A zero length string by itself is considered false Meta Update 166 User s Guide SAY Software Tool House Inc Examples Status if SXn XnCodeS Delete Inactive Status if SXn XnCodeS Delete Active Status if SXn XnCodeS Delete Active Inactive The above statements set the status to Inactive if the incoming transaction code is equal to Delete Otherwise the Status is set to Active The incoming transaction code is read from a File statement with a tag of Xn The field within that file is XnCode Example Notes Notes n Notes Xn Notes Notes if SXn Notes2 W WVn s Notes 2Nn Notes Xn Notes2 Or with a little improvement Notes NNoteslyn Notes Xn Notes Notes Aif Xn Notes2 W amp NM np Notes 2 n Xn Notes2 amp No notes2 data n If the Notes2 field of the Xn record is empty the Notes field will contain the text Notes and the value of the Notes field in the transaction followed by the text No notes data Notes Value from Xn Notes No notes2 data If it is not empty the Notes field will look l
11. 85 User s Guide SJ Software Tool House Inc About Meta Update Break Points A Breakpoint in the Meta Update sense is either gt A control section name and an event gt An assignment section s line number A control section has the following breakable events Init when a section is starting up Term when a section is completing IterInit before an iteration query is run IterNext before an iteration record is loaded IterTerm after the last iteration record is completed Launch before each Launch is evaluated Asg a line number at an assignment section Init Init happens before a section is ready to perform its iteration query and before any AssignInit assignments have been done Term Term happens when all iterations of the section have been processed all termination assignments have been processed and the script is ready to return to the launching section IterInit Happens only once per section call Happens after all the AssignInit assignments have been processed and before the iteration query or open file etc has been executed IterNext Happens once per iteration Happens just after the next iteration record row field set has been loaded and just before any AssignPre assignments are processed Launch Happens once per iterations Happens after all AssignPre assignments are processed and before each Launch is evaluated Asg Assignment statements are line number based and not event based Each assignm
12. Default 0 re read updated record NoMatch D Default Query PplAsg CTM People 1 SCTL LookUpSrcS SPplAsg 1 QueryTarget In this example we want to update the records returned by a query Do Query Hpd HPD Help Desk Query Update Hpd The Update query results must include exactly one record That record is updated and loaded It is an error for the Update query to return more than one record If the Update query returns no matching records you can instruct Meta Update to create a new record with the AssignNew statement This overrides the default behaviour of returning an error The AssignNew specifies a list of assignment sections to be applied to the new create On create you may want to assign values to more fields You can specify the same sections as in the Assign or a different set of sections Assign PplAsg AssignNew PplAsg PplDft In the above example used to load SHR People from an Exchange Post Office extract normal updates use the assignment section Pp1Asg New submits include additional assignments contained in section PplAsg When an Update is processed against a record and that record already exists the fields assigned are compared to their values in the current record If there are no changes by default the update is skipped but counted as successful In some cases this may not be desired A special keyword can be used to override this behaviour
13. Meta Update can also accept date data as the raw ARS date time integer or raw Date only integer These are known as an epoch and julian dates respectively Date formats can be specified in one of three exclusive ways Date epoch Date julian Date Date format Date format is a string containing the following special symbols and any set of other characters acting as component separators and is terminated by a semi colon or wrapped in double quotes yyyy a four digit year yy a two digit year Years equal or above 70 are presumed to be offset by 1900 below 70 by 2000 M a one or two digit month Mm a two digit month Mmm a three character month abbreviation Jan Feb etc Mmmm the full month name January February etc Note case difference between minute and month specifications d a one or two digit day of month dd a two digit day of month ddd a three digit day of year Julian date Meta Update 151 User s Guide SJT Software Tool House Inc h a one or two digit hour Must be followed by a separator character or must be the end of string hh a two digit hour If the hour component is missing 00 00 00 is assumed m a one or two digit minute Must be followed by a separator character or must be the end of string mm a two digit minute If the minute component is missing 00 00 is appended to the supplied hour Note case difference between minute and month specifications s a one
14. The UpdateIfEqual Yes statement is coded in the same section as Update will force the Update to always write the Update to Remedy Meta Update 134 User s Guide SAY Software Tool House Inc Do Update Hpd UpdatelfEqual Yes Assign asg asg Short Description Hpd Short Description In the above fragment the Short Description field is assigned the same value as it already has By default this will skip the actual Remedy update Because the UpdateIfEqual Yes statement is in the Update section the real update to Remedy will fire This can be used to force workflow firing for example Output Statement A single output statement may be coded in the control section if Meta Update is to output either a CSV row more text to a pattern file or a completely new pattern file All loads in the control section are processed before the output is processed An Output can be part of the iteration that is the result of a Query or File or other iteration statement Assignment sections are processed in each iteration and result in a new row being appended to the output file for delimited files such as CSV or more text being appended to a pattern file or that text becoming a new file in a pattern file with the MultiFile option Output Tag File Section FileName The FileName argument is a string expression and is evaluated once when the output is first encountered at the section initialization If th
15. Typ Delimited t Fields 1 In this example each record of the file is loaded and tagged with ExchSrc The column names are taken from the first record in the file The data in the file can then be used as references The file name can be a reference or a constant It must evaluate to a file name valid for the OS The OS user running Meta Update must have read access to the specified file Meta Update 38 User s Guide SAY Software Tool House Inc Loop Loop can be used instead of a query or file Meta Update will iterate through the values specified loading those values one at a time into a reference tag you specify and create or update the same number of target records If your loop value is parsed into six separate values you will attempt to update or create six records in the target form Loops can be performed on string values that are separated by a delimiter while a condition is true on Diary field values on the set of fields and values in a Tag on the set of forms that make up a Join form YYYYY An example of a string value separated by a delimiter could be the User Group List of the user form You could for example create a record for each group in a user s group list A Loop looks like this LoadQ SreTT HPD HelpDesk 1 SArg IDS Loop Diary sTag SSrcTT Notes LoadQ Usr User 1 SArg IDS Loop String sTag SUsr Group Lists Loop
16. rt 9 The name is fixed making an array or hash of such fields These can then be looped through as needed Types of Reference commands Assigning a single value to a named string reference ACmd Cmd Cmd ACmd ACmd Cmd Cmd ACmd Assigning many named values to a single Tag Cmd Cmd SrcFld Cmd ARS Record Cmd Assigning a new Tag as equivalent to a ACmd Assigning the result of a special server Cmd Cmd Assigning the results of a regu ACmd Assigning the result of a client Cmd Reference Reference Reference Reference Reference Reference Reference Reference Reference Reference Reference in memory Reference Reference Reference Reference Reference Reference A single value is assigned to a Tag and field name that real SrcTag schema process prefix Tag Name Value Tag Name QLookUp Tag Name G if Tag Name Section Tag Name Reval Tag Name fmt out Tag Name fmtqry Tag Name val Tag H Value Sec Tag info SrcTag Tag date SrcRef Tag Name ars n existing Tag Tag Name equ PROCESSS call Tag Name exec Tag Name guid Tag Name regex Tag Removing previously assigned references ACmd Cmd Meta Update Reference Reference Tag Tag spawned process to fields spawn process Name delete delet
17. 4912 BC through Jan 1 9999 The value is represented by an integer number of days since the 4713 BC date The time component of a date field is ignored There are no time zone adjustments Meta Update 220 User s Guide SAY Software Tool House Inc Date Time Fields ARS date time fields hold a date and time stamp in a number of seconds from Jan 1 1970 They are always saved in the GMT or UT time zone Meta Update converts ARS Date Time fields into a character string representing the local time on the machine that Meta Update is running on when ever any record with such fields is read Similarly these character strings are converted back when inserting into an ARS field for updating Meta Update date strings are as follows yyyy mm dd hh mm ss yyyy mm dd hh mm ss yyyy mm dd hh mm ss yyyymmddhhssmm date represents current date time time represents current date time daystart represents current date at 00 00 00 dayend represents current date at 23 59 59 Any missing components will be treated as if they were zero one for month and day File records can specify date columns formats if different than above Meta Update then converts from the file s strings into the above Any file date field can be assigned to any ARS date field Diary loops supply the entry date in various different date formats as different references For assignments you ll need to use the normal reference DiaryTag Date which
18. A field is the Tagsre s field name being worked on This iterates through all data fields of Tagsre Specifies that ARS Display Only fields are not to be copied Ignored when the SrcTag the source tag is not a Remedy record May be abbreviated to SkipDO Specifies that source fields which have a NULLS value are not to be copied If used must be the last keyword on the command Skip is followed by a comma separated list of fields to ignore from SrcTag the source tag Specifies a list of fields that are not to be copied The field names are fields of the source tag Field Ids may be used only if the source Tag refers to a Remedy record If you are doing a Merge and especially if you are copying data from another server you may not want the Request Id field field 1 assigned Specify Skip 1 to avoid this If used must be the last keyword on the command Fields is followed by a comma separated list of fields to copy from SrcTag the source tag Specifies a list of fields that are to be copied The field names are fields of the source tag Either Skip or Fields can be used but not both Meta Update 172 User s Guide SAY Software Tool House Inc CoreAssign and Core Fields The meaning of Core fields as applied to the copy command does not include core fields that can be assigned without the use of Merge That is a Copy command with the default NoCoreAssign option will copy these fields Field
19. Active Any query acceptable to the Remedy User Tool can be used With Remedy you must specify field labels or field ids and not field names when describing fields within single apostrophes With Meta Update you can use field labels ids or names in ARS Queries When using Meta Update references only field names or ids are used The query is always done after all the load statements that precede it in the control section Any loads following the Query statement are done after the record from the query statement is loaded but before the Update record is determined Other loads are possible during the processing of the assignments The number of query records returned are loaded one by one and can be referenced by the tag PrdCode in the above example As many new target records are created as there are results returned by the query Loads processed during the assignments are done during the results iteration after the current query result record is loaded and associated with the query tag These loads and the assignments may reference the query tag The placement of the Query or File specification within the control section is significant Only loads specified before the File or Query can be referenced in the File or Query statements Only loads coded after the File or Query can reference items from the File and Query records Note that only one of Query QuerySql Or File may be used in any single control sec
20. Arg RunName 2400000001 Auto Closed For columnar Output Files the Target Field is a field as defined by the file definition section in this script FleDef out csv Type Delimited FldHdr Fields FleDef out csv flds FleDef out csv flds Case ID S Diary User Diary Date Date yyyy MM dd Diary DateEpoch Date epoch Diary Text HpdWorkLogReport asg upd Case ID HpdSre 1 Diary User HpdSrcDiary User Diary Date HpdSrcDiary Date Diary DateEpoch HpdSrcDiary Date Diary Text HpdSrcDiary Text For Output Pattern Files the Target Field are the reserved words String and File This is also called a String target and can be used in the Reference assignment command to build complex strings HpdWorkLogReport asg String Case ID SHpdSre 1 String Diary Entry by SHpdSrcDiary Users String on SHpdSrcDiary Date String SHpdSrcDiary Texts String We For any of the above target and for assignment sections having no output targets a Target Field may be Cmd This is aspecial keywords that allow commands to be specified Assignment Section Cmd Copy HpdSrc DupIgnore CoreAssign amp Skip field 1 field 31 The above example is only allowed when assignment section has a target and that target is one of an ARS schema a columnar file or a string It will copy all matching fields except fields field_1 and field_31 and any fie
21. Category SHpdSrc Type SHpdSrc Item CT lkup Default CTL LookUp Src NoMatch D Default Override List File m Default Default Default Jna na Default Default Default File F CT File CT SArg File Name FileSource SF CT Category S SF CT TypeSg SF CT FileTarget F CT Categorization Tier NE SF CT Categorization Tier 2 amp SF CT Categorization Tier 3 Filelf if SF CT AppSchema amp CHG Change File CT Type Csv Format Excel Fields File CT Fields File CT Fields Status OC OK PC OK Category Type Item AppSchema Asset Class Categorization Categorization Tier 2 Categorization Tier 3 CI Type Product Categorization I Product Categorization Product Categorization Product Name Modell Version Manufacturer Check Tier 1 a r mmm An mn An mn An An In A n nt nm 3 H Oo K N ll r Ut Wt Am amp Simply augments the file with a script wide list and overrides if in both the file and here Items Specifies the LookUp source and target string mappings to fields in the file Only records matching this condition are loaded An assignment statement that references the LookUp section based on the above file The source string was the original record s AppSchema Category Type Hem separated by Cmd Ref MyVars CT_lkup LookUp LkUp CT SHpdSrc AppSchema S HpdSr
22. Cmd Msg I matched Part 1 X part 1 Cmd Msg I matched Part 2 X part 2 Cmd else Cmd Msg W no match S Arg sub j Cmd endif regex parts part 1 part 2 VN nm Trim both Trim both When run the following output is generated SthMupd exe BBB Asg regex 010 ini Do p Model 132 42 Manu DoSplit Msg matched Src Model 132 42 Manu DoSplit Msg matched Part 1 Model 132 42 DoSplit Msg matched Part 2 Manu Meta Update s regular expression handling is through the PCRE libraries PCRE is the Perl Compatible Regular Expression implementation available as a GNU project PCRE can modify the regular expression behaviour by including options between and By prefixing an option letter by a hyphen that option is turned off in the following pattern part The option letters are Meta Update Letter Option Meaning i PCRE_CASELESS If this modifier is set letters in the pattern match both upper and lower case letters m PCRE_MULTILINE PCRE treats the subject string as a single line of characters even if it contains several newlines The start of line metacharacter matches only at the start of the string while the end of line metacharacter matches only at the end of the string or before a terminating newline unless D modifier is set When this modifier is set the start of line and end of line constructs match i
23. Meta Update 155 User s Guide Software Tool House Inc Meta Update 156 User s Guide SAY Software Tool House Inc Assignment Reference Meta Update 157 User s Guide SAY Software Tool House Inc About Assignment Sections Assignment sections are where you specify which fields will be updated with what values for any given Update or Create ARS schema and field set Assignments specify a target field on the left an equal sign and an assignment value on the right Here as an example used to update a Help Desk ticket HpdUpdate asg upd Status Closed Work Log Auto closed in batch process Work Log Arg RunName 2400000001 Auto Closed When Remedy updates or creates a record through the API it is supplied a list of field value pairs on the Create Update or Merge API call In the Assignment sections of Meta Update scripts you build the lists of field value pairs that Meta Update will use on its calls to these API functions Assignment sections let you Reference sets of pre loaded records and load other records Create complex fully nested conditions to control both the values and the fields in the assignments Split data values using pattern matching regular expressions LookUp and translate values using a combination of files queries and SQL queries Spawn external processes or ARS Server processes YY YYY Assignments may also be special keywords that allow commands
24. Statement EE 124 L op SJETTE Me 125 Create Statement mnanannnnnvnnnnvennnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 131 UntilSt tement E 131 Update Statement rrnarnnnnnnnnnvvnnnnvnnnnnnnnnnnnnnnvennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 133 Output Statement rnnannnnnnnvnnnnvennnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 135 Merge Statement rrrnnvnnnnnnnnnnvnnnnvnnnnnnnnnnnnnnnvennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 137 EIERE E LE 137 Sleep Statement ic cccsc cesecesceccesteveesceseeeccettereeeteesenceeeteesentarssncyentecdseseeteniesansedeneseetni 138 Launch Statement cccccccccccescscceccecetecssaieescccecnnevesnsecueseecentue cute cusecuceneceseserdcetiesneeeenseeese 138 To Bae State Ment isisisi ananem aniani danada aiaeei aaas 139 File Sections siiani EE EEEE EES 142 Field Sections euer segeesgereeEe ege renee cence seuerasentessteectten desudestercuecedeuudseuaesstseeeeneiectce 146 About Fields and FormatSe unnnannvnnnnnnnvnnnnnnnvnnnnnnnvnnnnnnnnnnnnnnnnennnnnnnnnnnnnnnnnnnnnnnennnnnnenr 146 Copying Fields from Schemas sxssrnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnenn 147 Field Formals nenene 148 Automatic SQL Select GeneratiOn r rrrsavnnnnnvnnnnvnnnnvnnnnnvnnnnnnnnnnnnnnnvennnnnnnnnnnnnnnnnnnnr 149 Date Fields nmmeemenissndnennnnnnnmds sd anndnnnannmmdd nnmedneandentddnnd
25. The parts of a reference command are Tag This is the name of the string reference to be assigned Any name can be used This is the Tag that this collection of named values will be referenced by Use different Tags to group different information in more complex scripts The Tag itself may be a reference which allows more complex scripts such as configuration driven scripts using arrays of loaded data Name This is the name of the individual field within this Tag References to this Tag and Field Name will return the value assigned for example Tag Name The field may also be a reference Meta Update 176 User s Guide Value Meta Update SVT Software Tool House Inc Some forms of reference commands assign multiple field names to a tag These are identified with a special reserved keyword for the name When the name is specified as a single at sign the value following the reference is treated as an assignment section Any field assigned a value in that section is set as a reference under the Tag specified Specific named fields and values are assigned to the tag that give information about another Tag and Field reference This can be used for example to determine if a field exists in a form Specific named fields and values are assigned to the tag that gives information about a date value This can be used for example to determine the name of the day for a given date Th
26. User s Guide SAY Software Tool House Inc The following table lists the assignments made to the Tag Name Type Meaning Initial Value DateType string Null SNULLS or Null Date valid date Error invalid or unrecognized date IsDaylight bool 1 if the date is in the daylight savings time 0 zone else 0 epoch int The Remedy epoch date in number of 0 seconds past 00 00 at Jan 1 1970 UT year int Year 0 month int Month number 1 12 0 day int Day of month 0 daywk int Day of week with Sunday as 0 0 hour int Hour 0 23 0 min int Minute 0 59 0 sec int Second 0 59 0 The following script fragment will assign a new variable Varc Dte as exactly one year back from the current date Cmd Ref Vnow date S TIMESTAMPS Cmd Ref Varc yr Reval amp SVnow year 1 Cmd Ref Varc Dte amp SVarc year SVnow month SVnow day amp SVnow hour Vnow min SVnow sec The following will do the same but with the date being approximately one year ago Cmd Ref Vnow date STIMESTAMPS Cmd Ref Varc epoch Reval amp SVnow epoch 365 25 24 60 60 Cmd Ref Varc Dte flds regex amp Varc epochs Dte flds Dte Date epoch Conditional Value Assignments to a Tag reference e Cmd Reference Tag Name LookUp Sec Value Cmd Reference Tag Name if If the condition coded evaluate to false no assignment is made If the variable is then referen
27. Work Log Auto closed in batch process Work Log SArg WkTxt 2400000001 Auto Closed Close Date SDATES Note that values must be compatible with the Remedy fields if the target is a Remedy record Enum values can be specified as a numeric value or the Remedy enum label The assignment value can be a constant or a simple reference Assignment Value Constant Keyword Parameter Environment Reference Constant number string quoted string Keyword Keyword values supported NULL applies to all Remedy data types and is an assignment to NULL Causes deletion of attachment fields attachments TIMESTAMPS gives the current date and time and is only available for use with a Remedy time field DATE is equivalent to TIMESTAMP DAYEND current date at 23 59 59 DAYSTARTS current date at 00 00 00 If the value cannot be interpreted a warning is issued and the value is interpreted as a string constant Meta Update 164 User s Guide SJ Software Tool House Inc Parameter Deprecated The n th parameter passed on the command line nnn nnn If nnn exceeds the number of parameters available an error is thrown and the update does not proceed Note that there must be exactly three digits following the Named parameters are self documenting and easier to use These are simply a string Reference with the Tag being Arg by default and the variable name being the parameter defined by the
28. attachment fields in any one form should be handled here with perhaps an error thrown if it is exceeded The remaining assignments Copy Src CoreAssign are handled with a Cop command Meta Update 290 User s Guide Cie Software Tool House Inc Index Meta Update 291 User s Guide SJ Software Tool House Inc Cmd Assignment Commande sssssseeeeeeen 169 Field Gectons 147 date Assignment Commande 186 eval Assignment Commande 187 fmt Assignment Commande 185 include drechve nosiris anpa 96 Including Script Files cece 98 List Files Debugging Command 88 info Assignment Commande ss sesseeeeeee 183 val Assignment Commandes ss sessseeeeeee 185 A Abort Assignment Commande 174 API Meta Update API Veraions 56 Archive Forms Set Schema Assignment Commands 196 Arguments Meta Update Usage ecn 65 66 Arithmetic Expressions Assignment Commande 187 Bleu 194 Named Constamts 194 Operators sssini anea eias 193 Random Number function s e 195 Random Number Geedmg 195 Using in Assignment Commands 193 ARS records Assignment Commande sssseseeeeeeeeee 190 Assignment Commands AttaChSave asonnonrnnonrnnnnvnnonrnnenvnrener 174 Sections in ConcCents 33 Set Schema Commande 196 Trace Commande 197 Assignment Commands 169 TEE 187 Mot 174 Arithmetic Evpressions 187 Arithmetic Expressions
29. firing or choosing not to fire all Merge filters or the Submit and Modify API like the BMC User Tool minus all Active Links Update allows you to specify a query to determine the update record You can specify different assignment to create a record and to update a record Once the record is updated it is reread if it will be needed further in the script Create causes a new record to be added to a form You specify the assignments to be applied Once the record is created it is reread if it will be needed further in the script You may also choose to create columnar or pattern files as an output of a section The full power of Meta Update may be used to load multiple records and use data from all these loaded records in the files you create Pattern files are text files and can be emails XML files or formatted reports Columnar files can be fixed length or CSVs A Meta Update command can Launch other commands For example a command may iterate through a Query after each record from the Query is read and after each output record is reread it can then Launch another command which can data from the current query record and current output record to query and output more records 26 User s Guide SAY Software Tool House Inc References With the BMG Visual Studio or the former Remedy Administrator tools you specify field references by wrapping either the field id or the field s database name in dollar signs SStat
30. migrations or operations on your ARS data Throughout each section different assignments are processed at different events All assignments can be conditional and many assignment commands are available to allow your administrator exquisite control over the assignment process Assignments You can programmatically based on all data in memory decide to do an update or not decide which schema and which record to update decode which fields are to be updated and which values are to be assigned to which schemas The assignments are feature rich They v Are fully conditional supporting a structured if facility v Can use local script variables v Use arithmetic operations v Use pattern matching regular expressions to split up values v Copy matching field ids across two records v Fire external processes on the local processor v Fire special ARS Run Processes on the server for example to generate a Guid or use Business Time v Can use lookup translation facility from internal lists spreadsheets SQL or Remedy forms v Issue Messages and abort processes when detecting data errors v Have full rich robust logging and error tracking facilities v Reference external pattern files to build long text strings using a set of data records across different servers and ARS schemas and ARS SQL rows or files or script variables Meta Update 21 User s Guide SJ Software Tool House Inc All assignments are
31. regex Name regex Meta Update Reference Tag Name regex regex Value This is a keyword and must be coded exactly as shown This causes this assignment to assign several implied named strings to the specified Tag A Perl compatible regular expression is specified in regex and the supplied de referenced value is tested against this regular expression The regular expression itself may also contain references This is useful when the regular expression is dynamic depending on other script or record variables The Tag s field rc is set to 1 when the pattern is matched or to 0 when the pattern is not matched No match does not cause an error You should test Tag rc before relying on the substrings extracted from the pattern All pattern specified output strings are extracted and set in the Tag under a name represented by the extracted string s index starting at 1 If Name is specified and not na a field section is processed and extracted values are transformed according to the field section s format specifications Additionally variables with the field section s field names are set in the Tag A field ematch can be specified as the first field If so specified this contains the whole string that matched the complete expression This is a Perl Compatible regular expression It will be used to match against the value given and extract any matching substrings from that value 189
32. the first record returned by the query will be the record specified If QueryMax is coded the total number of records returned by the query will be limited to the number given The values can be integers or references that evaluate to integers If missing the default will be the first record returned by the query The special integer 999 999 999 can be used to override a server based limit on servers above release 7 It is unnecessary but possible to set this in a Meta Update script Meta Update by default will continue issuing queries automatically until all results are exhausted These keywords can be used to limit the number of records processed by a single job allowing you to start multiple jobs with different QueryStart values In this example of a script we will run 4 simultaneous jobs with 2 5k per job Main Arg start Arg max Arg qry Do Query Src HPD Help Desk SArg qry QueryStart SArg start QueryMax SArg max To fire the jobs we might use a batch file like this start SthMupd d i jl log example ini Do start 00000 max 2500 qry 1 1 start SthMupd d i j2 log example ini Do start 02500 max 2500 ary 1 1 start SthMupd d i j3 log example ini Do start 05000 max 2500 ary 1 1 start SthMupd d i j4 log example ini Do start 07500 max 2500 ary 1 1 Meta Update 121 User s Guide SJT Software Tool House Inc QuerySql Statement A QuerySq statement is like a Query statement ex
33. this field to extract those records written by any one application The text is the actual text of the trace message and is entirely application dependent Meta Update 76 User s Guide SAY Software Tool House Inc Firing from Workflow Meta Update may be fired from workflow as Run Process or Set Fields PROCESS filter or active link When firing from workflow on the server the environment is that of the ARS server process It is prudent to code a script or batch file in the workflow and then have that script or batch file set up the environment for the run invoke Meta Update and possibly do some termination activities The environment generally includes a path to the executable and to any required shared libraries or dlls other environment variables parameters and the working directory As workflow is fired at independent times it is possible for multiple copies of Meta Update to be running simultaneously If so the Server based tracing version is highly recommended to properly serialise log files Meta Update 77 gt User s Guide SJT Software Tool House Inc Developing Scripts Normal Meta Update runs will report script errors with an E level message echoed to the console That message will print the script file name section line number and if appropriate the keyword being processed 114159 531 E Do asg init AssignInit apply was aborted in file FD SupGrp Ren ini asg init Cmd line 74
34. user Specified the main ARS server s login user that Meta Update will be running under Note that this user is generally an administrator password XXX Specified the ARS user s password May be plain text or encrypted with SthLicUpd cmd Other switches help Summary usage instructions Meta Update 64 User s Guide SJ Software Tool House Inc Usage Help Text Meta Update Version 5 56 x64 for ARS lib 8 1 2 c Copyright 1996 2015 by Software Tool House Inc www softwaretoolhouse com Function SthMupd runs a Meta Update script at the specified section against a BMC Remedy Server Function SthMupd runs a Meta Update script at the specified section against a BMC Remedy Server See http www softwaretoolhouse com for the User s Guide and Licensing Synopsis SthMupd switches script file section script arguments The script file and section must follow each other Switches and arguments have the form switch value The script can include named arguments which are specified by using the script s argument name as the switch followed by the value for that argument The script should explain its usage when run with Meta Update with no switch arguments script file is the Meta Update script to run may be found in the path like Environment Variable SthScriptPath section a section to process in the script file Do for samples switches for logging Warni
35. using lists CSV files ARS Queries SQL queries or procedures When you fire Meta Update you pass it a single Control section s name This control section also lists any assignment sections to be applied to the target update record and other control sections through the Launch statement Think of this section as a main or entry point to a script A script can be coded with multiple starting sections Consider for example these entry points in the same script that either iterate or not and then all launch the real worked section Ppl Del ini Del One p hwu Ppl Del ini Del File p del list 42 csv Ppl Del ini Del Ory p WE ee 42 Only those sections following within the run of a Meta Update script are syntactically checked For example if the first control section launches a second control section conditionally and that condition is not met then that second section will not be syntax checked as it was not fired Meta Update 99 User s Guide SJT Software Tool House Inc Main Section The Main section is requ ired and declares the Remedy sign on information if not entered on the command line This example is used by the samples Main Server Port User Password ENV ArsSvrAdmin ENV ArsPort ENV ArsUsr ENV ArsPwd The above environment variables are set by a Windows batch file SthLic cmd or a Unix shell script SthLic sh This batch file sets the envir
36. val f1 val f2 with embedded and undoubled quotes val f 3 In fact the CSV if it had all embedded quotes doubled would look like this val f1 val f2 with embedded and undoubled quotes val f3 Meta Update will assume a doubled quote followed by a separator has a single quote as the last character of the field value The value for field 2 for either of the above two CSV example would be val f2 with embedded and undoubled quotes Finally consider this record where the single quote appears as the character before the end of the line Meta Update in this case will assume that that quote terminates the field and the record a b c some text some more text with a new line The value of the field will be Meta Update 153 User s Guide SJT Software Tool House Inc some more text The effect is that this record will be truncated and the next record will be read incorrectly The command script itself could declare an error in these cases by ensuring a field value that cannot be null is not null in any assignment section Ensure the field tested follows the field that may contain these values with embedded new lines and quotes Asg Cmd if Finp NON NULL FIELDS W Abort E Incomplete or badly formed CSV record Finp CSV KEYS Meta Update 154 User s Guide SAY Software Tool House Inc Assignment Reference
37. we will use the Merge API and write records to the underlying normal forms The class form as well as query qualifications are passed on the command line Main Arg Arg ReadServer PrmReq PrmReq PrmReq PrmReq PrmReq PrmReq Form Query prod Function Will transfer CMDB records from production Usage SthMupd S ScriptFx Do Form form Query query where form is a BMC CORE BMC xxx class form and query is a qualification on the form Default BMC CORE BMC ComputerSystem Default 1 1 prod Tag prod Server SENV ArsProdServer User SENV ArsProdUser Do Query Launch prod SArg Form SArg Do Join Src Query Do Join Loop Launch Join SrcI Arg Forms Do I Do I Query Update Merge AssignNew Assign prod SrcIr SreI Schema TgtIr SrcI Schema 179 Yes NoWorkflow Do I asg Do I asg ITO SSrc VSSra 17987 1798 Do I asg Cmd Copy SrcIr CoreAssign If the above script were called as follows Meta Update 130 Main sets script arguments and sets up 2 connections a prod server and the target server Environment variable ArsSvrAdmin is the target server rsSvrProdAdmin Ege i prod server Do issues a Query on the BMC Class Join form given by the program arguments Do Join loops through each normal form in the class join Do I issues a query on each normal forms of the cl
38. you tell it which section is the first section to read in the script file This is like a Main in a program A Meta Update control section and gives information about the operation you want Meta Update to perform ultimately causing records to be added updated or merged in an ARS server lteration A section can perform its function exactly once or can iterate through a set of records or values applying its output each iteration Iteration may be based on An ARS query A Direct SQL Query through the ARS API A columnar ASCII file A list of values in a string A diary field value The set of fields in a Tag or record A while loop VVVVVVV In the cases of Files and SQL you can set up interpretation and translations of the data For example an ARS time field from a direct SQL column or a file column can be interpreted and assigned to time and character fields resulting in a proper time stamp value An Iteration may be terminated prematurely when an Until condition is true The control section specifies the ARS output operation Meta Update Output will perform Each section s iteration will cause exactly zero or one output an update create or merge of an ARS record or file A sections output May do nothing so that it s assignment sections can fire gt May always create a new ARS record gt May create a record or update an ARS record based on a query creating one if the gt v u
39. 64 OS Windows Server 2003 SERVER_DIR D Apps BMC ARSystem ARServer Db DBHOME_DIR SET_PROC_TIME 5 EMAIL FROM ARSystem 17 SQL LOG FILE E Logs ARS a001 log M 4 gt DAR INFO 83 mal m SS 100 mm eer Meta Update 261 User s Guide S z H Software Tool House Inc Meta Update solution Development time Mi fifteen minutes Meta Update is copyright c 1996 2012 by Software Tool House Inc www softwaretoolhouse com This is a Meta Update script that simply writes the automatic AR_INFO values to the screen It simply loops through the fields of the automatic Tag AR INFO and outputs a CSV row for each to the passed CSV file This Main section gives script arguments and server info A single argument is required the name of the PrmReq 1 Function output file PrmReq This is a Meta Update script that simply writes AR_INFO PrmReq d values from the Server to a CSV file in the form PrmReq Name Value PrmReq DB TYPE SQL SQL Server PrmReq VERSION 7 6 04 Build 002 201101141059 PrmReq PrmReq Usage PrmReq SthMupd SCTL ScriptFx Do p out file PrmReq where out file is the output file CSV PrmReq ArgNm outf 14 Do This is the main entry point of the script It iterates through all the fields of the AR_INFO tag an automatically defined tag containing all Server info and for each ouputs a CSV row in the specified fil Loop Fields 8 AR INFO 4 T
40. A normal debugging session comprises setting various breakpoints within the script continuing execution until the breakpoints are reached examining references and field values and then resuming or aborting script execution Additionally a conditional Break command may be coded in an assignment section of a script that will cause a breakpoint when the condition is met and debugging is enabled Meta Update 83 User s Guide SJT Software Tool House Inc Entering Debug Commands At the Meta Update debugger prompt you enter debug commands by specifying the command any command arguments and then ending the command with a new line The last command entered of a subset of the commands is automatically repeated when the enter key is pressed with no command entered If there is no such command saved or an invalid command was entered help text is printed outlining the available commands Further help is available by using the Help command and specifying the command name you want more help on All Meta Update debug commands may be abbreviated C gt SthMupd v g ArSchema Rpt ini Do fle ArSch csv qry RE Meta Update Version 5 56 x64 for ARS lib 8 1 2 c Copyright 1996 2015 by Software Tool House Inc www softwaretoolhouse com 211900 140 q Server 5 sthvl 211900 140 q User 4 Demo 211900 140 q Port 2501 42 Do at Do ln 42 Init Mupd Dbg gt help The Meta Update script debugger supports th
41. ARS table name that will be queried It may be a reference An AssignPre section for example could determine a table to update and set the name of the updating schema in a script variable sort a Specifies a specific sort order List the fields to be used in the sort by name or Id and optionally follow a field by A or Ascending or D or Descending to specify the previous field s sort direction The set of fields may include references An sort SNULLS evaluated by expanding a reference causes no sort to be applied to the query Note that if an sort is not specified the Remedy schema specifies a default sort and this is implicitly used Qualification Specifies the Query Qualification that will be passed to Remedy Qualifications may include script references Generally any qualification acceptable to the advanced query bar of the User tool is acceptable The Qualification may include Remedy field names between single quotes Meta Update will replace these with field Ids when the default field label is different then the field name The qualification string is similar to one that you would enter when issuing a query in the advanced bar with the user tool Any literal s must be doubled or escaped Meta Update reference substitution on the query qualification is done This can be in any part of the qualification including the Remedy fields between single quotes Field Ids field label
42. Arg value of the Main section Environment Deprecated An environment variable set before Meta Update is executed aaaaa If the named variable aaaaa is defined in the environment its text value is used If it is not found a warning is issued and the aaaaa is used as Keyword missing the terminating The Environment is available as a reference in the pre defined tag ENV To assign an environment variable s value simply use the reference form as in this example Path ENV Path Reference Tag Field Tag is a previously loaded ARS or file record or a named collection of strings Field is the name or ID of one of the Tag s form s fields The field in references does not have to be of the same type as the field being assigned It must be of a compatible type If a conversion is not possible the operation fails Field Field Id Field Name Field ID a long numeric Remedy Field Id Field Name The Remedy ARS Field database name Using NULLS is not the same as not assigning a field Not assigning a field allows Remedy to choose that field s default value on a create record On an update the value is not changed Diary entries are always appended to on an update Conditional Assignments Any individual assignment or can be made conditional by preceding the assignment value by an if construct This includes the special assignment commands There are two styles of ifs Meta Update 165 User
43. DoLaunch failed 3416 801 E Do One 0 record OK 1 records with errors total 1 3416 801 E IniRdo of Q00 TblRpt User ini Do failed with 3 3416 801 i Statistics 3416 801 i Sections 1 3416 801 i Maximum section depth 1 3416 801 i Singleton Sections 1 errors 0 3416 801 i Output Schemas 0 3416 801 i Output Schema records 0 created 3416 801 i Output Schema records 0 updated with 0 skipped 3416 801 i Outputs OK 0 3416 817 i Outputs Errors 0 3416 817 i Outputs Aborts 0 3416 817 i Input Errors 0 3416 817 E error some errors occurred Check for errors above this message 3416 817 E terminating unsuccessfully in 0 sec Meta Update 79 User s Guide SAY Software Tool House Inc Script Debugging Meta Update 81 User s Guide SJT Software Tool House Inc Script Debugging Meta Update 82 User s Guide SAY Software Tool House Inc What Is Script Debugging When running Meta Update in debugging mode you can gt View your script s source lines gt Set and manage breakpoints gt View references gt View help on the debugging commands available When running Meta Update with the debug switch Meta Update will load the script file and then present you with the debugging prompt You can then set and clear breakpoints and begin or continue execution or single step through the script The debugger is part of the Meta Update binary and is available on all supported platforms
44. E Logs ARS a001 log oOo OO Oo STHVMWIN2003 ARAdmin 500000 10000 1 0 0 1024 390601 1 1 390603 1 1 390620 2 12 390621 5 16 390635 2 8 390680 2 2 1 sthvmwin2003 Application Pending User s Guide AP_RPC_SOCKET AP_LOG_FILE AP_DEFN_CHECK MAX_LOG_FILE_SIZE CLUSTERED_INDEX ACTLINK_DIR ACTLINK_SHELL USER_CACHE_UTILS EMAIL_TIMEOUT EXPORT_VERSION ENCRYPT_AL_SQL SCC_ENABLED SCC_PROVIDER_NAME SCC_TARGET_DIR SCC_COMMENT_CHECKIN SCC_COMMENT_CHECKOUT SCC_INTEGRATION_MODE EA RPC SOCKET EA RPC TIMEOUT USER INFO LISTS USER INST TIMEOUT DEBUG GROUPID APPLICATION AUDIT EA SYNC TIMEOUT SERVER TIME SVR SEC CACHE LOGFILE APPEND MINIMUM AP VER MAX AUDIT LOG FILE SIZE CANCEL QUERY MULT ASSIGN GROUPS ARFORK LOG FILE DSO PLACEHOLDER MODE DSO POLLING INTERVAL DSO SOURCE SERVER DS POOL DSO TIMEOUT NORMAL ENC PUB KEY ENC PUB KEY EXP ENC DATA KEY EXP ENC DATA ENGR ALG EN SEC POLICY ENC SESS H ENTRIES DSO TARGET CONNECTION PREFERENCE PRIORITY ORACLE QUERY ON CLOB MESSAGE CAT SCHEMA ALERT SCHEMA LOCALIZED SERVER SVR EVENT LIST Meta Update RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW 231 SAY Software Tool House Inc 390680 128 7200 1 300 1348555192 0 0 0 0 1 1 D Apps BMC ARSystem ARServer Db arfork
45. Guide Quotes double escape delete Lf unix nt escape delete Nulls Std NULL XXX Subst yyy XXX Trunc nnn WordChars delete escape DI XXX WordCharsAdd XXX WordCharsDel XXX SAY Software Tool House Inc Indicates that values containing the quote character have that character either quoted or escaped Delete is not applicable for input files Quoted values can span lines All line feeds are converted to single lt If gt s in internal ARS values For external values such as output files if this format is not specified the default will be unix or nt based on the platform that the job is being run on Specifies the conversion for Null empty values in the file std indicates that the Remedy keyword NULL will be substituted 7 Indicates that an empty string will be substituted Note that in Remedy as assignment of NULLS is not equivalent to an assignment of an empty string Specifies simple character based value substitutions Multiple Subst keywords may be coded They are effected in the order coded The slash in the above example is a separator character It can be any character not in either the pattern or substitution strings In the pattern string a leading circumflex indicates that the value must begin with the pattern to be considered a match Similarly a dollar as the last character of the pattern says that the value must match the pattern
46. Notes n Notes Xn Notes Notes if SXn Notes2 Ww amp N pee Notes 2 n Xn Notes2 amp No notes2 data n LookUp Assignments LookUp assignments allow a data value to be translated without having any extra ARS tables LookUp Section Src Value Section Specifies the LookUp section that gives the source and target values for the look up It also specifies any default value and match failure options See LookUp Sections below for more information Src value This is the value that will be looked up It is a string reference If this value is found in the LookUp section the value associated will be assigned If this value is not matched a default value can be assigned the assignment to the field can be skipped or the processing for this update Meta Update 168 User s Guide SAY Software Tool House Inc can be aborted These actions are specified in the LookUp section s NoMatch statement Like all assignments a LookUp can be made conditional Example Status LookUp AsgLookUp Xn Status AsgLookUp Active Current Deleted Inactive Cancelled Inactive Assignments Commands Special commands can be included in assignment sections These are identified with the field name cma Like all assignments these special commands can be conditional Cmd Copy Cmd if amp Copy Assignment commands allow assignments to script variables of str
47. Out f flds Out f flds cmd Copy Tbl 1 Sql Fields used to name the SQL fields rather than 1 2 3 name viewname schemaid Let s say the sch qry argument is name like HPD The second section Do2 is launched once for each table returned from the SQL query against arschema Let s say one of the tables returned is HPD Help Desk When Do2 is launched a query returning all records will be run against HPD Help Desk and each record will be copied to an output file The Tag for the Output will resolve to HPD_Help Desk and the file name will be suffixed by HPD Help Desk csv As this will be the first time this combination is encountered a new CSV file will be created and it will contain all the fields in the Incident schema Now et s say one of the tables returned is HPD Worklog When Do2 is launched a query returning all records will be run against HPD Worklog and each record will be copied to an output file The Tag for the Output will resolve to HPD Worklog and the file name will be suffixed by HPD Worklog csv As this will be the first time this combination is encountered a new CSV file will be created and it will contain all the fields in the Incident s Worklog schema Meta Update 136 User s Guide SAY Software Tool House Inc Merge Statement Merge Off Merge Yes Merge No AllowNull No SkipPatternMatch No Workflow The
48. Server Tracing An alternative communication based trace facility is available for high use applications With this server based trace facility the machine administrator manages the detail of the messages captured and the size and number of trace files Tracing is controlled independently of any application using it Trace Configuratio Trace Daemon ft J A f H UNIX Windows Message Named Queue Pipes _ X End Trace Control em e g AN Appboabon LY meme A d Administrator Application N Application All client binary executable names that have the server based tracing included are suffixed with Trc Meta Update for example would be SthMupdTrc exe If the trace daemon is not running the same local trace file SthMupd log is created or appended to The following binaries are supplied with the server based tracing facility trcdaem exe This is the trace server itself It should be started automatically when the machine starts trectl exe This controls the trace daemon allowing the tracing levels to be set switching to the next generation of trace file and shutting down the trace server trcecho exe This utility adds records to the trace file and can be used in shell scripts or Windows command files Note that Meta Update must be invoked with a a switch for any debug level traces to be sent to the trace daemon The trace daemon must also be set to capture the level
49. Software Tool House Inc ACmd if SArg Idl ACmd Abort E Usage p idl id2 n amp where idl is the starting id amp and id2 is the ending id Check in our second id was coded Cmd if SArg Id2 II Cmd Ref MyVars OQry VI SArg id1 Cmd else Cmd Ref MyVars Ory WI gt SArg id1 AND amp NI lt SArg id2 Cmd endif Cmd Msg D Qry S MyVars Ory gt String sections These are used when a section uses the Output to create a pattern file asg pattern String Record Id SSrc 1 SSrc 1798 LoadQ SrcReq SHR People 1 SSrc 1 String Requestor Id SrcReq 1 SSrcReq 179 include pattern file for this language File if V Lang en asg pattern sub en ptn String Di String Generated Stimes Meta Update 159 User s Guide SAY Software Tool House Inc Using Assignment Sections Assignment section names are specified in the command sections with various Assign keywords They are also specified in Include assignment commands This example is a command section that specifies three different assignment sections HpdUpdate asg init HpdUpdate AssignInit Update AssignNew AssignNew Assign HpdUpdate asg create s HpdUpdate asg upd HpdUpdate asg init HpdTgt amp HPD Help Desk amp vir SArg ids HpdUpdate asg create HpdUpd
50. Type SrcPct 5 SrcPct Item Here are example references using the QuerySql above Query SrcSvr CI amp Category SPct 3 AND amp Category SPct 3 AND amp If the example QuerySq launched a section with the next example Query the effect would be to process all of the distinct Items in the Asset database and then for each of those Items process the set of Assets that have that categorisation Note at most one and only one iteration statement QuerySql Query File Of Loop may be coded in a command section File Statement A single ri le statement may be coded in the control section Meta Update will read the specified file record by record For each record in the file Meta Update will e Load that record and associate that data with the supplied tag e Query for an update record e Apply the assignment sections to create or update a record in the target schema This will result in the same number of new records added to or updated in the target schema as are in the file File Tag DefSec FileSpec Tag specifies the name that will be associated with the fields of each file s records This tag is used in references DefSec specifies the file sections that define the characteristics of the ASCII file FileSpec This is the actual file name and path It is a string reference File F OutLook fDefExchg SENV Rmdy work exchg Arg fname cvs File F OutLook fDefExc
51. User s Guide SAY Software Tool House Inc In accordance with the Perl convention the first character is treated as a delimiter and the expression is considered complete at the next such character See Using regular expressions below for more information Value This is string that the regular expression matches and extracts substrings from Assigning values to an ARS record Cmd Reference Tag Name ars amp SvrTag Schema G init ars This is a keyword and must be coded exactly as shown This command is used to make assignments to a single ARS record as identified by the Tag If Tag has not been encountered before or if the optional init is coded it is allocated with no field values Tag The name that this record s fields will be referenced by This cannot be used directly in an Update assignment but can be used in normal references and in the Copy assignment command Name This is an assignment section that will be applied with this record as a target If this section causes an error or issues an Abort this assignment will also be aborted or be in error Name can be specified as na which causes no assignment section to be processed Name can be a string reference SvrTag This is an optional ReadServer Tag As with all Read Servers the is required It specifies the server that the schema is loaded from Schema This is the name of the ARS Schema or form that the record will belong to This can
52. Using 193 Ee EE 190 Client Processes AAA 190 Conditional Aeslonments 187 EEN eebe EE 170 Elte EE 170 Meta Update Index 292 Date Information eeen 186 Double References AAA 183 Double References AAA 185 Format values eeens 185 elei EE 173 Message junker 175 Reference n ungmnnsudanntunamsdr 176 Variables AAA 180 Regular Evpressions 189 191 Server Processes mrrrrrrvrnanvrnvrvrnnnnrnennr 188 EE 175 Tag Equivalence AAA 188 Assignment Sections Update Juneau seier green 133 assignments CONCEP S 22 dacers se acensaeeibeceayevatbaeeaaeasseeeeneds 28 Assignments elle 21 AssignNew Gamples eene reeeneeereeeneeee 277 AttachSave Assignment Commande 174 Auditing 0 070 DEE 139 B BackTrace Debugoing Commande 88 Breakpoints ADOUT EE 86 Command in Geint 83 Setting while Debugging ssseeseeseeesees 91 C Cache LookUps KOywordS AA 213 Client Processes Assignment Commande 190 Command Prompt Ideal Properties cceseccceeseeeeeeeeeeres 70 Commands Set Schema Aeslonments 196 Trace Assignment Commande 197 Concepts Assignments Sections sseeeeeeeneeeeeeeee 33 Control Sections rrnnvnnnnrnnnnvnnnnrnnnnvnnnnnne 33 Create Laken 41 Debugging ieor 83 Examples oniinn 43 Flowchart in Concepts s s s 35 teren eege eu age stees ee Eeer Eug 33 LAUNCH siicadicsaissaveiceassdcasessavavadeaanaaiaceas 34 43 OUUU iieo eese id nina
53. a File Using an assignment section to prepare a query string Using an assignment section to convert a date from a normal format to an integer for an SQL query Using a Read Server In a LoadQ and a QuerySal Specifying an Update query Using the Copy assignment command Using a Launch YYYY YYY Meta Update 274 User s Guide SJT Software Tool House Inc Meta Update script p Main Specifies the script s tag ip eg L a and login for the production User Demo r ReadServers Main Prod server Ar ONM inp EST fle Names three arguments ArgNm mod date AArgNm m Panes _ All arguments are required IdLog g idlogs Main Prod Tag Server Dev02 prod copy Declares the format and field User Demo Port 3201 lg for the passed CS Fle Tbl Er Type Delimited FldHdr The file s first record Format Excel contains the field names Fields Fle Tbls Flds which must match these fields Fle Tbl Flds bl table name in ARS TblSql table name in SQL view IdFld 1 in SOL ModFld 8 in SOL This is the called section It QueryText E SQL query text iterates through the file s rows SvrSync Date Processes the passed CSV file of tables to synchronise File Ftbls Fle Tbl j ae SArg inp csv fles The AssignPre section Is AssignPre asg Mk Qry run after the next file record Launch Tbl Sync is loaded but before any Launches are processed asg Mk Q
54. a new file so that that new file can be then Logging and processed by Meta Update once the data errors are corrected problem resolution Each ARS record read loaded created or updated is optionally written into an id log file You can request and validate parameters passed as arguments You can interpret validate and transform data from files or SQL queries pattern extraction Regular Expressions Meta Update processes your assignments You can apply conditionals in the assignments or even in determining to make an update You can programmatically based on all data in memory decode which fields are to be updated and which values are to be assigned Meta Update 22 User s Guide Software Tool House Inc This image outlines what Meta Update lets you do Iteration 2 Query File SQL Loop iterate through ARS SQL or file records Diary entries parsed mL strings loading and creating Environment i A ARS records Variables SZ Program Arguments Loads Load and tag records using loaded ARS data In your Query Assignments Assign constants passed program Fie arguments script variables loaded records fields Use full conditionals change target schemas translate values Remedy Database Meta Update processes Meta Update Command Scripts These are simple ASCII files that resemble Windows 3 1 INI files In them with a few simple words and
55. a reference to the value you want to assign In the above examples we ve assigned three constants and one ARS keyword Two were text fields the last a date field The first Status was actually assigned the value 1 Assigned is validated against the definition of the Status field in the target schema HPD HelpDesk These assignment statements would be equivalent if the default view of form HPD HelpDesk defined attribute Assigned for field Status as the second value Status Assigned 7 Assigned Status 0 7 0 The 7 is the ARS field id for the reserved Status field The value 1 is the normal value associated with Assigned in the Attributes tab of the Status field s properties in the ARS Admin Tool Only those fields that you code in your assignments are used to update or create the target form s record When you create new records you ll need to ensure that all required fields are assigned values Of course Remedy server workflow fires On submits especially workflow may cause additional fields to be updated In addition workflow may reject the update with an error message Meta Update 28 User s Guide SAY Software Tool House Inc Assignment References In addition to constants Meta Update can use references in assignments These are references to data loaded from possibly different ARS schemas from fields in an ASCII file from LookUps from parameters pas
56. and Field that is passed to it Cmd Reference Tag info SrcTag SreFld info info requests a specific function The SreTag and SrcFld can themselves be references info causes the Tag to be assigned a specific set of fields depending of reference passed SrcTag this can be a Tag loaded in your script or a reference that will evaluate to a Tag that is loaded in your script If only the srcTag is supplied only those names appropriate to the SrcTag record that is loaded SrcFld This can be a field name defined by the srcTag record or a reference that will evaluate to such a field name If the srcTag is an ARS record the SrcFld may also be specified as a field id When a SrcFid is specified the field and value specific assignments are set Note that if you are only interested in the value when the SrcTag and SrcFld are themselves references then the val assignment will return that single value The following table lists the assignments made to the Tag Name Type Meaning Initial Value DefinedTag bool Tag is defined 0 DefinedField bool Field is defined 0 Type Undefined ARS Tag type Undefined File SQL String TypeSchema Regular Join ARS Schema Type nm View Dialog Vendor Join bool TypeSchema is Join 0 Joinl string Join schema 1 a Join2 string Join schema 2 View bool TypeSchema is View 0 ViewName string the database view name E ViewKey string the database key field request ar id Vendor bool Typ
57. archive form Consider this example where we want to validate that a root request and all its children exist in alternate or archive forms If any child is missing there is no point continuing This request has failed the validation So say you may have sections querying all of the Incident s children on the real forms and a LookUps to check the Archive forms When the first case of a missing child is found there is no point continuing any of the queries for this incident s children so a flag can be set and all Launched sections would complete up to but not including the section that looped through the Incidents That section would then iterate to the next Incident In this example the flag V DoS is initialized to True and set false when a Work Log for this incident is not found in the archive form Do Query Inc HPD Help Desk qry AssignPre Do asgPre Launch if SV Do Do WL Launch eif V Do Do delete The Until stops the processing of this Incident s Work Logs Do asgPre gPre as soon as a Work Cmd Ref V Do 1 Cmd Ref V gotIncArch LookUp Log record is Lkp Inc Arch Inc 179 discovered missing Cmd if V gotIncArch HOR an ENE Tarm Ref V Do 0 Do WL Query WL HPD WorkLog If a Work Log is Incident Number Inc Incid nt Number missing from an Until V Dos Archive form we set AssignPre Do WL asgPre the V Dos
58. are used Field Ids can be used when labels are not available of are multiply defined in the form Of course full reference substitution is available Examples Query Prod amp SKOTT amp HPD HelpDesk amp 1 SArg TT IDS Query SrcTT amp HPD Help Desk amp Assigneet SSrcTT AssigneeS AND amp Status lt Resolved QuerySql Optional A single QuerySql statement is allowed If coded a query is executed and the records returned from the query are iterated through The returned SQL rows are loaded one by one into the Tag specified and the assignment sections are applied to a new or retrieved update record As Meta Update 113 User s Guide SJT Software Tool House Inc Loop Merge Meta Update many records as there are returned from the query are produced for the target schema The QuerySql returns a set of record with each record containing a set of fields These fields can be referenced by either an integer or a field name The field name is defined is a special Field section This also allows data conversions to be specified from the native SQL data types into the ARS types See Field Sections below for more information on specifying field value transformations The QuerySql may be run on the target server or on any read servers It is passed through the Remedy API to the Remedy server and executes the query using the Remedy server s credentials Th
59. assignment sets these same variables If these variables are needed by the script they should be saved in script variables CTL LookUp Src The source string from the LookUp assignment CTL LookUp Set when a Look Up is successful to contain one of these values Default The string was not found the default was returned List Found in the internal List File Found in the external File Query Found in and loaded an ARS record QuerySql Found in and loaded an SQL row Meta Update 200 User s Guide SAY Software Tool House Inc Keywords These keywords have special meaning in a LookUp section All other keywords become source and target strings of an internal Look Up list Default Optional The value to return if the LookUp string is not found CTL LookUp Src may be used to return the LookUp string itself Default NULL NoMatch Optional Specifies the message level when the LookUp is not found as well as the action to be taken Default E Error Order Optional Specifies the Order of LookUp lists to be searched Use any of the words in the default order below arranged in the order that the LookUp will be processed Default List File Query QuerySal File Optional Specifies that an external CSV file is to be used to load a table of LookUp value pairs A File specifies a text file including any Meta Update references that is copied into the target named string or pattern file record File Fi
60. assigns an equivalent Tag so that fields and references are entirely equivalent using either tag This is useful when assignment sections are included and made to act on different records Name is interpreted as a previously defined Reference Tag Server Processes Assigning results of ARS Server Run Process Cmd Reference Tag Name guid prefix guid This is a keyword and must be coded exactly as shown This causes this assignment to assign an ARS GUID as per the special run process Application Generate GUID lt GUID prefix gt executed on the target server A zero one or two character prefix may be passed as an argument A one character prefix is suffixed with an underscore No prefix results in ID being used Meta Update 188 User s Guide ACmd exec SAY Software Tool House Inc Reference Tag Name exec process arguments This is a keyword and must be coded exactly as shown This causes this assignment to assign the results of the special run process coded on the statement along with any parameters required for that special process For example Cmd Ref X Guid exec Application Generate GUID AA would be equivalent to Cmd Ref X Guid guid AA Similarly calls can be made to any of the Special Run Processes available and listed in the table at the end of the BMC ARS System 7 x Workflow Objects documents Regular Expressions Assigning match and extracts to variables ACmd
61. automatically converted to the right type ARS keywords can be used Attachments are no problem They can be loaded from files or from record references With the BMC ARS Administrator Tool you specify references by wrapping a field id or database name in dollar signs For example References SRequest ID Meta Update extends the concept of a reference so that you can refer to many different records at once A Meta Update reference has two parts a Tag that identifies the desired record and a field within that record For example SSrcTbl Request ID STgtTbl Request IDS SArg Operations The Tag portion can refer to and the field portion can refer to a Remedy record a field database name or field id an interpreted SQL row a column or interpreted field an interpreted File record ailes interpreted field a Diary field entry the string User Date Text a named collection of strings assigned variables When processing files SQL queries regular expression pattern extractions value interpretations may be applied For example in an Value SQL query ARS date fields which are integers can be interpreted as Interpretation date fields You can request and validate parameters passed as arguments You can interpret validate and transform data from files or SQL queries pattern extraction Regular Expressions When processing columnar files any source records resulting in errors can be written into
62. be lost upon its completion Meta Update 251 User s Guide SAY Software Tool House Inc When executing the shell script source it by prefixing the command invocation with a dot as follows gt SthLic sh On Windows simply execute the batch file normally gt SthLic cmd SthLic cmd help Function Sets license and authentication environment variables for Meta Update Meta Query Meta Schema and Meta Delete Licenses expire Wed Jun 5 7 43 52 2613 Usage SthLic cnd sur where sup is one of cent linux 764 Examples SthLic cmd cent The sthLic help command will list all licensed servers and alternate names for the servers If the command has already been issued that is if the appropriate environment variables are already defined the command will report the currently set server In the above example a single server is licensed and it has two alternate names given for the convenience of SthLic users Meta Update 252 User s Guide Cie Software Tool House Inc Samples Meta Update 253 User s Guide Sak Software Tool House Inc Meta Update 254 User s Guide SJT Software Tool House Inc Samples The following examples can be used as learning vehicles and are included in the distribution package The distribution may be downloaded from the web AR Schema Report This simple script creates a CSV listing the tables in an ARS server and the
63. be in error Only appropriate for input files Type Type Type Field Format Meta Update Required Delimited For Delimited files the second parameter specified the set of characters that can be used as the delimiters These should not occur in the data values unless the values are quoted The delimiter itself can be specified as a reference The optional FldHdr keyword indicates that first row of the file contains the names of all the fields Pattern MultiFile For Pattern files the optional MultiFile keyword may be appended This Causes every Output to generate a new file The name is dereferenced each time the file is to be opened It should dereference into a different file name Optional for Delimited Required for Fixed and Output files Not used on patter files This specifies the field section for the file That field section defines the names and positions for each column of the file For Delimited files not having the Field statement implies FldHdr That is if there is no field definition for a file the first row of the file must contain the fields If both Field and FldHdr are coded for input files the fields of the file are ordered as they are in the file Missing fields have the value NULL Extra fields are ignored Optional This specifies a default format for all fields in the file The format tells Meta Update how to interpret the value of the file s field on input a
64. be specified as a constant or a string reference init This is an optional keyword If coded the record will be initialised to the empty record That is a record containing no field value pairs and having had no assignments If this keyword is not specified this section s assignments add to the record Several of these commands can be used to accumulate values in the record Meta Update 190 User s Guide SAY Software Tool House Inc Client process stdout and stderr files Assign to a Tag Cmd Reference Tag spawn process arguments spawn This is a keyword and must be coded exactly as shown This command is used to make assignments to three specific string names on the specified Tag re the spawned process returned integer stderr the stderr output console errors of the command if the process succeeded this is generally empty stdout the stdout output console of the command The process must be on the path when Meta Update starts The process cannot have redirection operators for stdout and stderr These are appended by Meta Update These are temporary files that will be automatically deleted after the command runs If desired the placement of Meta Update s stdout and stderr redirects may be controlled by use of the redir string If missing from the text to spawn the redirects are added to the end of the command text If there are multiple lines they are concatenated into a single
65. character with the exception of a single String assignment New lines from pattern files are copied as is The assignment value for the string keyword taken as a string reference Example String The ID of the record is tSMT IDS String The submitter is tSMT Submitters The assignment value for the ri 1e keyword is a file specification valid for the OS This file contains simply the text of the string with substitutions as above Example File pattern txt The file pattern txt contains The ID of the record is NESMT IDS The submitter is tSMT Submitters Reference Tag Name Reval real Value This assigns the result of an arithmetic expression to Tag and Name See Arithmetic Expressions below Reference Tag Name Gfmt out Value Format This assigns the result of a field format applied to a value to Tag and Name See Formatting Values below Reference Tag Name fmtqry Value SrcTag This takes the string Value and replaces fields between dollar signs with those found in the SrcTag and assigns the new string to Tag and Name Field IDs can be used if the SrcTag is a Remedy record If a field is not found it is not replaced 181 User s Guide S z H Software Tool House Inc The following example Cmd Reference Tag Name fmtqry amp W Incident Number SIncident Number amp Sre assigns a string to Tag and Name like this Incident Numbe
66. columnar file containing a single header row and a row for every record added or updated in the Meta Update run and every record queried or loaded from a file IdLog fname Overwrit Append The file name can use substitution from parameters and environment variables and is in the form of a string reference see below One of the two keywords Overwrite or Append can be coded following the filename The default is Append The produced file can be imported into Excel and looks like this Time Server User Schema ID Op Op2 Status The records are produced in the order that the queries and updates are done Time is only resolved to a second On updates and ARS queries the full Schema name is identified and the ID of the record is specified unless a create operation failed On updates of Join forms the record id is blank Note that on a Join form it is the workflow that creates underlying records when desired A submission to a join form with no workflow defined succeeds but causes no database updates In the case of a file there is no User the Server is the file name the ID is the record number the Schema is by default the first 20 bytes of the record itself This value may be changed when defining the file Op contains either Update Create or Read Op2 contains Merge if and only if a Merge operation was done Status can be one of Ok the operation completed successfull
67. each section in sequence quickly The script file parameter is the name of the file containing the Meta Update controls and the target record assignments It must exist and read access must be permitted for the user running Meta Update The ArSvr ArUsr ArPwd and ArPort parameters will override similar parameters in the Main section of the script file If they are not coded in the assignment file they are required on the command line If arsvr is coded the ArUsr ArPwd are also required and ArPort is required if the listed server does not use Port Mapper The command line arguments cause the equivalent script file keywords to be overridden and ignored Generally one would code these in the file and let the operating system s file security prevent unauthorised access to that file This would keep the ARS User and password secure In the script these may be set to environment variables or other references The p is simply a separator from the previous server user parameters and all the following parameters These next parameters can be referenced in the script file They can be referred to as 001 002 and so on or they can be named and referenced by those names These passed arguments can be used as keys in loads or as text in queries and assignments Wrap long values in quotes according to your shell as needed Using Positional Arguments Deprecated Following the script and section a p switch is used as a script Argument
68. fields in the source CSV are ignored For an output file Fl1dHdr causes the field row to be produced on open The field order is as specified in the field section Meta Update 142 User s Guide SAY Software Tool House Inc File Def Type Delimited t FldHdr Type Fixed Type Pattern MultiFile Field Field Def Format Csv Excel Overridden Merge format Quote c No LineSpan Trim XXX trailing leading Field Def Field 2 Formatting comment for Delimited files Field 1 10 Formatting comment for Fixed files File Section Keywords Type Delimited FldHdr Required Default none Fixed Pattern Multi Output only Specifies the type of file that will be read or written Fixed format files have fields but no field header in the file and each field has a starting and ending column number Fields may overlap Delimited files are typically comma separated values CSVs that many software products export and import The delimiter may be specified as a reference The first row of the file may be the names of the fields and is specified by the keyword FldHdr Pattern files are used for output only and are plain ASCII text with no fields defined The keyword Multi indicates that a new file is created on each output Field section Default none Specifies a section name that describes the fields of the file Required
69. for output files and for both output and input fixed files Optional for input Delimited files Not permitted for pattern files Format Csv Excel Overriden Merged format spec Default see below Specifies a default format spec for all fields of the file Overridden or Merged indicates what should be done with a field format spec The default is Merged that is both the file and field format spec will be merged to interpret the field ErrorFile filename Default none Specifies the name of a file may be a reference that will contain an exact copy of the input file records that caused an error in the script Any error in any launched section will result in the record being added Formatting is not applied to records in this file Meta Update 143 User s Guide SJT Software Tool House Inc FieldsRequired all field Default none Specifies a set of fields that cannot be NULL on either input or output When a record is read that has a NULL in one of these fields an error is thrown and the record is placed in the ErrorFile if one was specified The script does not get a chance to work with this error record FieldsInFile all field Default none Specifies a set of fields that must be present in the file Normally if a field is declared in the script and the actual file does not include that field all values for that field return NULL With this keyword such a file will
70. formatted Diary values simple character strings are invalid as a Diary value Merge Yes Merge No AllowNull No SkipPatternMatch No Filters AllowNull Allows NULL assignments to required fields 114 User s Guide SAY Software Tool House Inc SkipPatternMatch Allows assignments to fields even if the assignment fails the fields pattern matching specifications NoFilters is only available in Meta Update for version 6 3 of ARS It causes all Merge filters to be turned off for the single Meta Update job running The defaults are NoAllowNull NoSkipPatternMatch and Filters If the defaults are required you can simply specify Yes to tell Meta Update the Merge itself is required For documentation and completeness it is recommended that all options always be specified UpdateIfEqual The default action of Meta Update is to skip a record update if the values being assigned are equal to the current database values This can be used to override this default If UpdateIfEqual Yes is coded an update will occur whether or not the values being assigned differ from the current values This is useful for causing filters set on Modify to fire UpdatelIfEqual Yes No Update Indicates that this is an update and supplies the query to be used to determine the update record It must not be coded for creates Update Tag Schema Query If the section contains a Query and the query results are to be upda
71. full host name is checked against the IP stack and the licensed domain name is matched against the true host domain name Stand alone machines that do not return a domain name cannot be licensed through the site licensing facility All licenses carry a term date support options the highest release that may be freely upgraded to The licensed releases of Meta Update will run against a licensed server until the term date is reached Meta Update evaluation licenses do not limit Meta Update in any way Full functionality is provided in an evaluation license for the term Meta Update 242 User s Guide SJ Software Tool House Inc Specifying the License Key The license key can be given to Meta Update in the following ways Inthe environment variable SthMupdLic gt Inthe script file s Main License keyword This can be a reference to an environment variable gt Ina control record on a form on the ARS server Specifying the License Key with Environment Variables On Windows environment variables may be set on a single DOS session for a specific user s complete Windows sessions or for all users Windows system environment To set a single DOS box s environment open a Command Prompt then use the set command to assign the License Key to the expected environment variables For example set SthMupdLic QF143G6 PL95SQ If you do have a site license there are two more environment variable you may want to set SthSi
72. messages are echoed to the console These messages tell you what section is working on what record and lists outputs to ARS tables These messages are also captured in the trace logs An example E Dta _wrk gt SthMupd exe AAA Create Launch ini Do p 426 429 Meta Update 53544 53544 2312 312 53544 78 53544 78 53544 890 53544 92 53544 968 53544 968 53545 03 53545 03 53545 03 53545 03 53545 03 c H H H H H H H H Version 5 56 x64 for ARS lib 8 1 2 Copyright 1996 2015 by Software Tool House Inc www softwaretoolhouse com 53545 125 i 53545 53545 125 187 i 53545 187 53545 234 53545 234 53545 234 53545 234 53545 234 53545 234 53545 234 53545 234 53545 234 53545 234 53545 250 53545 250 53545 250 53545 250 53545 250 53545 250 53545 250 SR i a i i i i i i ER i ER i a i i ER i E Dta _wrk Meta Update Do One Do One Launching 1 of 2 CreRec2 from if SArg Id2 DI CreRec CreRec2 Do One Schema in file AAA Create Launch ini CreRec2 Schema line 103 is deprecated ignored CreRec2 Ory 1 of 3 A first record CreRec2 Qry 1 of 3 Merged schema Test Id 000000000004474 OldId CreRec2 Ory 2 of 3 and now only seconds lat CreRec2 Qry 2 of 3 Merged schema Test Id 000000000004475 OldId CreRec2 Qry 3 of 3 A second entry made a few CreRec2 Qry 3 of 3 Merged schema Test Id 00000000000447
73. not empty and refers to a field section and automatic variable is set which holds the select fields separated by commas This is gathered from the fields in the section When fields are the result of complex SQL expressions those expressions may be coded in the field section with Sq1 This variable is CTL Sec SqlSelect The query string is similar to one that you would enter when issuing a query in a set fields action dialogue with the BMC Administrator Tool except of course that the query may return multiple records and these will be iterated through in the control section The query may be tested the Meta Query Text substitution in the query qualification is done Wrap references in dollar signs Literal s must be doubled or escaped If a dereferenced Query string contains equal and not equal comparisons with NULL that comparison will be replaced with is null or is not null respectively This qualification example should help clarify DbField STag Ars Field or DbField lt gt STag Ars Fields Meta Update 122 User s Guide SJ Software Tool House Inc If the value of Ars Field in the record referenced by Tag is NULLS the qualification can become DbField SNULLS or DbField lt gt SNULLS This of course would not match what is wanted so the above QuerySq qualifications will be changed to DbField is null or DbField is not null Examples QuerySql SqlRe
74. of tracing desired The trace daemon uses a configuration file to specify both communication parameters and file handing and other trace daemon operational options Meta Update 73 User s Guide SJT Software Tool House Inc All trace clients such as Meta Update or sthMupdTrc exe for example need to access this file to read the communication parameters The location of this file is given by an environment variable On UNIX the trace daemon uses the POSIX message queue facility The daemon should be run at a higher priority or lower nice value than any of its clients to prevent messages being lost Further system parameters should be adjusted so that the message queuing is not a performance bottleneck Under normal production usage without the d switch very few messages are sent to the trace daemon and so performance is not generally an issue On Windows Name Pipes are used to implement the inter process communication This will generally not require any system parameters to be changed to affect the performance The trace daemon performance is not generally a bottleneck on Windows systems Note that to capture a level of trace messages beyond the minimum both v The trace daemon is configured to include the desired trace level or by using the trace control program the desired trace level is on and v The program will have been run with the a switch specifying the desired trace level An environment variable is use
75. one of Query QuerySql File Of Loop may be used in any single control section Performance Considerations A Query result limit may be imposed through a Remedy server configuration setting Server Information Platiom Timeouts Loenser I Corfaaston Log Fies Database Parts and Queues Advanced Sowce Contiol Serve 0 specifies Users Prompted Fot Login fey Preference d Max Entnes Retumed By Gettust 0 Server TableFieidChukSee i000 oo Servet Language FACWESTERN UreEmalNottiesFion Jap uaen 34 Minamiatn API Version D Din Home Fon HosePaas sl Max Number ot Passwd ere lr HetReqedtiDGickSae I unlimited Meta Update will retrieve all query results by issuing a Remedy call to get the next chunk of results until all the results are retrieved Once a set of Query results are retrieved Meta Update will retrieve the data for those results in blocks of 100 records Each iteration of the section will load the next record from the current block until that block is exhausted It will then retrieve the next block from Remedy This reduces accesses to the Remedy server to once per 100 records and 1 per query chunk with a Remedy Server maximum or 1 if unlimited Meta Update 120 User s Guide SAY Software Tool House Inc Additional Keywords The following optional keywords may be included in a control section that has a Query statement nnn nnn QueryStart QueryMax If QueryStart is coded
76. or other criteria Meta Update 108 User s Guide SAY Software Tool House Inc Keywords amp Statements A control section can use these types of statements to gt Operational control Meta Update s behaviours gt Load allow loading of additional records This is superseded by the LookUp facility and use is discouraged gt Iteration automatically iterate through the rows of a Query QuerySql File values extracted from a string or diary field or on any condition gt Output update an ARS record or add a row to an output file gt Launch call another Meta Update control section to query and update more records gt Assignment specify assignment sections to be called at various points in the cycle of a control section gt IdLog specify an IdLog to automatically create CSVs on a section s events This table specifies all Control Section statements Operational statements Sleep Used to slow down the operation of Meta Update Status Alters or inhibits the default status message while processing a file or query TimeOutNormal Alters the ARS Defined Normal Operation timeout value TimeOutLong Alters the ARS Defined Long Operation timeout value Load statements LoadQ Specifies a query that results in a single record to be loaded Iteration statements File Indicates that this operation will process an ASCII file Point to the file definition
77. or two digit second Must be followed by a separator character or must be the end of string ss a two digit second If the second component is missing 00 is appended to the supplied hour Aora the string AM or PM will modify the hour specified This string is case insensitive If a one digit component is specified it must be followed by a separator or if not the month by the end of the value string The minimum date component must include year month and day or year and Julian day Two digit years are not recommended Examples Default date format Date Field Date yyyy Mm dd hh mm ss OS 390 Julian date Date Field Date yyddd American date format Date Field Date Mm dd yyyy hh mm ss European date format Date Field H Date dd Mm yyyy hh mm ss ARS Date values Date Field Date epoch Numeric Fields Numeric fields should be specified without thousands separators and with a period as the decimal separator If the numeric field in the CSV has a different format Subst formatting can be used to transform it to the expected format For example say the numeric field in the file is 1 983 217 97 for thousands separators and for the decimal point Numeric Field Subst Subst By applying the above Substitutes in order the above value is transposed into 1983217 97 Similarly a value of 1 234 567 89 will be transposed into the 1234567 89 by this
78. processed in whatever order they are specified in In the case of a Diary field that order is from least recent to most recent In the case of a string it is simply the natural order of the contents of that string In the third example the expression is evaluated and if true the the sections assigments and outputs are executed In this case no tag is specified and no values are loaded In the fourth example the Loop is executed for every field defined by the SrcTag An Ginfo reference command is assigned to the sTag In the final example the Loop is executed for each form defined by the specified Join form An info reference command is assigned to sTag Until Any iteration statement may be controlled with an Until statement An Until statement specifies a condition that if true causes the section to stop processing the iteration The iteration is stopped without an error as though the end of the iteration was reached If you need to stop with an error issue an Abort command in an assignment section such as the AssignTerm So for example a While loop can be an Until loop Loop Loop if 1 Until V quits Meta Update 40 User s Guide SAY Software Tool House Inc Output Create You must tell Meta Update whether you want to update an existing record or create a new record If you are always creating a new record in every iteration of a section you code a Create The create specified
79. rnnavnnnnnvnnnnvrnnnvennnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 264 Closed Ticket Replicator rrrnvrnnnnvnnnnnvnnnnvnnnnvnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 268 Server Delta Copy eege EEEEEEE cusseuennecesterscetaesnedeetectie 274 ARS Table Backup and Restore rrnnsvnnnnnvnnnnvnnnnvennnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 279 INdeX i ae 292 Meta Update 7 User s Guide SJM Software Tool House Inc Introduction Meta Update 9 User s Guide Software Tool House Inc Meta Update 10 User s Guide SIV Software Tool House Inc Introduction Thank you for selecting Meta Update With Meta Update creating repeatable imports migrations and batch operations on your ARS data is a snap Don t bother with the API Meta Update provides a quick robust reliable auditable method of harnessing the power of the API without any programming at all Legacy App S 9 S Production Data Migration Meta Update 11 User s Guide SLAM Software Tool House Inc Data Challenges gt Ever had trouble setting up an ARS data migration GGGA From one server version to another From one release of ITSM to another From ITSM 6 or 5 or 4 to ITSM 7 From a bespoke ticketing and asset system to another different bespoke application to an ITSM implementation gt Ever had trouble importing data into an ARS application v v G GA
80. sample one to back up a table and the other to restore a table Meta Update Script Output files s EE foes file Attachment fields S a att csv re S i Semen S Table Backup amp Restore SA SthMupd exe SvTbl ini Do p WebScr bkp20111231 WebScr a SthMupd exe LdTbl ini Do p WebScr bkp20111231 WebScr a To back up any ARS table run the SvTbl ini script passing as arguments the table name and a backup file prefix The restore script will take as input the same table name and same file prefix The backup script will generate these files gt a single csv containing all data from each field of the passed table gt if and only if there are attachment fields in that table a CSV of the field names and field ids for these attachment fields gt a file prefixed by the passed prefix for each attachment The restore script will process these files as a set gt a single csv containing all data from each field of the passed table gt if the attachment fields CSV exists will read these attachment fields and ids into a script array gt if there are attachment fields and the data CSV indicates a non null attachment a file saved by the backup script will update the attachment content and have the original attachment name This script introduces more complex features of Meta Update The script demonstrates Query Output Field Loops Output files based on schemas Schemas and Queries passed as arguments extr
81. section is first used The FileSource string specifies file fields and other constants and is used to build the table of source strings that will be used in the LookUp Any Meta Update references are evaluated once when the file is loaded Meta Update 205 User s Guide SJT Software Tool House Inc FileTarget Filelf Meta Update As each record is loaded it is placed into the File Tag specified You can then use that Tag in the string reference This simple example uses a single column of the file as the list of source strings FileSource STag Fldl Src1 In this example the source strings are made up of two file columns and a separator FileSource STag Fldl Srel Tag Fld2 Src2 Similar to the FileSource value use this to specify how to build the returned LookUp string from the fields in the file This setting is evaluated once only when the file is loaded and the LookUp section is first referenced In this example the source and target strings are each made of two file columns and a separator FileSource FileTarget oll Wn Am Tag Fld Src1 Tag Fld Src2 Tag Fld Tgtl Tag Fld Tgt2 This specifies a condition that if true causes the record to be inserted into the LookUp tables If false the record is ignored The condition may use the File Tag for the file record s reference In the CSV below we may want to exclude all records that are not for the CHG Change applic
82. solving the types of problems listed above All are error prone involved and expensive to develop Changes to mappings and value interpretations are expensive and slow In order of performance and efficacy they are 1 SQL Very dangerous to the integrity of the ARS database and workflow Bypasses all ARS security safety and workflow mechanisms Difficult and costly to develop Requires a specialised resource By far the highest performance 2 API Given a competent API programmer this method yields performance approaching the direct SQL option and far better than the next options Drawbacks are that ARS API programmers are a rare resource time between changes and delivery are typically quite long communications between the ARS developer and the API developer may be difficult 3 Export Import Merge filters This method should yield reasonable performance though slower than the API It is generally a complex ARS development project in and of itself and may rival the API in development expenses Much manual effort is needed in the extraction and importing of the data and this is prone to error Failures are difficult to track and resolve Record creation and modification dates are set to current run times and not the historical times required The same is true of status history and modification users There is no facility for parsing through a diary field s entries 4 User Tool The fact that this can be done is amazing in and
83. specified for each update If an AssignNew iS coded when an Update is used and the update query results in zero records this indicates that a new record is to be created It lists the assignment sections to be applied for this condition If it is not coded no update is done when the update query returns no records The above keywords specify optional assignment sections The different keywords indicate when during the execution of a single command section the assignments will be processed These are used in more complex scripts Assignment sections so specified have no Remedy targets and are generally used to set script variables or launch external processes Only the following assignments can be made in these sections Cmd Reference Cmd if else endif Cmd Include Cmd Spawn Cmd Abort Specifies the name s of the assignment section s to be applied when a command section first starts This is generally used to assign initial values to variables When a section is launched iteratively each new Launch will process these assignments Specifies the name s of the assignment section s to be applied once just before the section is ended If a section is launched iteratively then each time the section completes and is ready to return to the section will have these assignments processed Specifies the name s of the assignment section s to be applied before the next iteration of any Query or File statem
84. string reference Quote this value if needed This is the format specification It can be a string reference Quote this value if needed Consider that you have an SQL column containing a Remedy time stamp value You add a number of seconds to it and want to convert it to a date to be assigned to another Remedy field This code fragment will do that Cmd Cmd Ref V NewDate eval sql cDate SV Secs Ref V NewDate fmt SV NewDate Date epoch Say you want to substitute the Remedy Dropdown list word for an integer you could do the following Cmd Ref V DropName fmt sql Dopval amp Subst 0 New amp Subst 1 Open amp Subst 2 etc Date Information assigning date information The date command assigns a specific set of fields describing the single date reference in local time Cmd date date Meta Update Reference Tag date date date is used to give information such as the day of week and the epoch value of any date into a specific set of fields into the specified Tag which can be a reference this can be any Meta Update recognized date This can be a reference that evaluates to such a date Meta Update dates are of the form 1999 12 31 23 59 59 When a date is read from a Remedy Time Stamp or Date field Meta Update converts that date into the above format Dates from files or SQL fields may be converted by value interpretation 186
85. the BMC Import Tool can t handle are not a problem CSV s with values having embedded new lines stray undoubled quotes or different delimiters Loops may be based on diary entries of a diary field allowing you to create records for each diary entry for example Delimited strings for example looping through a User s Group Permissions field allowing you to validate and generate individual ITSM People Permission Records A set of defined fields of a schema for example looping through all attachment fields to place the attachments on the file system An arbitrary condition being true a while to process data until a condition is met in any of a set of records The set of schemas making up a join Assignments are made to create or update ARS records and in more complex scripts to use references as variables Meta Update has a rich set of assignment commands including a fully nested if then else a Look Up facility regular expression pattern matching and extraction an include facility and other commands 25 User s Guide SJ Software Tool House Inc Output Update Create Output Launch Meta Update A Meta Update command does not have to but can make an ARS output that is an ARS data record change A non iterating command can output a single record An iterating command can output a single record in each iteration Output can use either e the Merge API like the BMC Import Tool
86. the Va Fnm Va Max F AttFldNm tag We use references i PG Maza miiy Be the fields to be assigned to build an array File declarations the two input CSV files Inp f att saved by SvTbl ini schema s attachment fields Inp f att Type Delimited FldHdr Format Quoted always Quotes escape lf escap Fields Inp f att flds Inp f att flds AttFldNm AttFldId Meta Update 288 User s Guide SJT Software Tool House Inc Do Load Loops through the given CSV created by the companion script updating in the target table with the value of the first CSV field Request ID being matched against 1 We need to use Merge like the Import Tool so that we can assign core fields like 1 etc For Joins remove NoWorkflow from Merge We know the number of attachment fields their names and ids so if the attachment fields are non null they are assigned with their original file name and th xpected file system nam The remaining field values are simply copied from the CSV row File Src We use the reference Sr Inp f 1 to indicate the first CS SArg F inpS csv S Update Tot field which will be Request Arg schema ID Entry ID and so on 1 SSro 1 AssignNew Do Load asg Assign Do Load asg You cannot use NoWorkfld Merge Yes NoWorkflow sm on Join forms Do Load asg This is the assignment to the ARS record from the CSV file with the sa
87. to be specified This example will assign all fields in the target schema with the values from the source record and schema server user with matching field ids The source record was associated with the Tag HpdSrc as a result of a Query Load Update or Create These source and target schemas do not have to be the same or even on the same server Assignment Section Cmd Copy HpdSrc DupIgnore CoreAssign amp Skip field 1 field 31 Assignment sections may be broadly classed as gt An update to or create of an ARS record or an output CSV file record These assignment sections are used to specify the field value pairs that will be used in an update or create to a single ARS record to the form specified in the Controls Creates Or Update statements or a create of additional row of a CSV as declared in the calling section s File statement gt Sections with no ARS or CSV targets These are specified in the command section to fire at specific times such as Initialization after the iteration record is loaded after the output is performed after launches are performed and at termination They are used to set script variables and invoke external programs or server processes This example examines the passed arguments and creates a query that will result in either one record or a range of records asg script init f We should have at least a single id as an argument Meta Update 158 User s Guide SJT
88. use pattern matching and extraction regular expressions to set up a series of named string variables under a tag corresponding to the extracted values For example you could split a status history field into its individual components and generate dated records from those components Finally when assigning references and through the use of assignment commands reference tags may be used as arrays For example a configuration file or query may be completely stored in an array of tags and that array may then be processed over and over again Meta Update 27 gt User s Guide SJT Software Tool House Inc Assignments Meta Update performs field assignments that you code and uses them to update or submit a new record in an ARS form cmdl asg new Status Assigned Assignment Group Web Team Description Automated ticket entry Assigned Date STIMESTAMPS You tell Meta Update the target form for the field assignments in the Update Of Create statement of the command section Meta Update then uses the schema to convert the assignments as needed You specify the assignment sections to process in the command section as well Cmd1 Update HpdUpd HPD HelpDesk 1 SArg Id AssignNew cmdl asg new cmdl asg Assign cmdl asg Cmd2 Create HpdNew HPD HelpDesk Assign cmdl asg new In the assignment section the left side of an assignment is a Remedy field name or id The right side is
89. validate the above license with that ARS server Main Server ENV ArsSvr User ENV ArsUsr Password ENV ArsPwd Port ENV ArsPort Script Output Msg Schema object search admin Id 1173 Recs 1 Msg Schema object search details Id 1174 Recs 80710 Msg Schema object search ref Id 1175 Recs 808783 Meta Update 258 User s Guide Cie Software Tool House Inc Meta Update solution Development time R fifteen minutes File Rpt RegTablesRecCounts ini Function Test connecting to a server through environment vars ArsSvr server ArsPort port set to 0 for no server ArsUsr user ArsPwd password set to for no server SthMupdLic must be set for the above server Change History see bottom of file Main gives the connectivity arguments for the primary update ARS Server In this case we code the connectivity info using references of environment variables When these variables are not defined connectivity errors result Use v on the Meta Update command to see values used for the ARS Connection Set the Server and both connectivity and Server 9 1 ArsSvr authentication parameters User ArsUsr as references to Password ArsPwd S S environment variables ke Z GG SS Port ArsPort License pic up from SthMupdLic environment variable This script coded License value is over ridden by the environment variable Command line a
90. value supplied to the Merge may be a reference By default that is without a Merge statement or with a Merge Off statement Meta Update uses a Submit or Modify API operation Workflow set on Submit and Modify fire You can tell Meta Update to use Merge similar to the way the ARImport tool operates Only workflow that fires on Merge will be executed by default Using Merge with any value but off tells Meta Update that you want to use Merge You can also use a Merge option to inhibit all filters including those set to fire on Merge Use this option with caution For example when the output is to a join form only workflow set to fire on Merge will allow the real underlying records to be updated A write to a join form without underlying workflow causes no database update When a record is being updated or when a field id is explicitly included in the update the setting corresponding to Update Old Record with New Records Data is always used Status Statement A single status statement may be coded in the control section Its function is simply to issue status messages while processing a File or Query These are informational messages sent to the log file and copied to stderr Status 1 RecCtr Rec 72 The above is the default status specification used if none is coded The status message is repeated every record The text of the associated message comprises the current record number from either the query or file a
91. was closed The customer s business process stated no further work could be done on a closed ticket As such a mechanism would be needed to create a new ticket from the old ticket selecting work history records and emails Requirements A Perl callable ticket replicator was needed It would create a new open assigned ticket containing the emails the work history with a few extra generated records identifying the email to the closed ticket It would copy pertinent data from the old ticket The new ticket would be created assigned to the resolving group of the closed ticket The two tickets would be linked for a GUI facility to allow ticket chains to be followed The closed ticket would need to be updated with the new ticket s id This image shows the schemas and records of a single ticket Source Trouble Ticket TT Id Hi TT Email TT History Meta Update 268 User s Guide Software Tool House Inc The dashed lines in this image show the desired updated and created records Last Closed ee l 2TktidClosedNext Trouble Ticket P ke zm mm rm E TT Id TT History Meta Update p m we vm mm we ee wm 269 User s Guide SJT Software Tool House Inc Meta Update solution Main Server User ArgNm ArgNm PrmReq TT Copy Schema LoadQ Create Merge Assign Launch Launch Launch Launch asg TT New Status TktIdClosed TktIdClosedNew C
92. 249 User s Guide SJT Software Tool House Inc SthLicUpd Maintenance Utility This utility can be used to encrypt ARS passwords and to generate an SthLic cmd and SthLic sh scripts based on license files found in a specified file The utility is available on all supported platforms and may be run in prompt mode where it will ask you for all needed information Alternate names ARS Server IPs Ports Users and Passwords can be set ARS Passwords by default are encrypted The SthLicUpd exe utility will generate only one of the sthLic cmd and SthLic sh files as appropriate for the system that it is being run on Files produced by SthLicUpd containing encrypted passwords are not transferrable across platforms or users You have the choice to encrypt the ARS User s password Usage Function SthLicUpd is used to modify a Meta Update SthLic sh Modes SthLicUpd can be run in different modes Prompt will scan license files prompt for needed info and generate a new SthLic sh Pwd will encrypt a single ARS user s password or modify your SthLic cmd file s passwords Synopsis SthLicUpd exe mode switches where mode is one of Prompt or Pwd Prompt Run in interactive mode to scan licenses can supply lics and out arguments Pwd Will encrypt ARS users passwords switches are as follows licpath path The path for the license files must be a directory out file The output path and file name Default for out is SthMup
93. 33 40 Output Files 0 00 ec eee eeseeeeseeteteeeeeeetenes 42 User s Guide NJ DO ALG EE 41 Conditions LAUNCH diiseni eienen 138 Reference Assignment Commands 187 Continue Debugging Commande 90 Control Sections duer 33 Control Section Create in Concepts 41 Examples in Concents 43 Flowchart in Concepts 35 Launch in Concepts 43 Operational Giatementst 111 Output Files in Concerte 42 Output in Concepts 40 Update in Concepts 41 Control Sections GONGEPIS summen eksen 20 Keywords icine ieee 109 Operational Gtaiements 109 Statements arrnronrnnonvnnonrnnenrnnenrrnrnvnnennr 109 Control Statements G 10 0 EE 135 gen edd circle 118 Until eel eh aah ies 131 Update seccina erep onanii 133 UpdatelfEqual AA 134 Copy Assignment Commande 170 Core Fields 173 Coreheelgn 173 NOCoreAssign eccceeceeeereeeteeeeneees 173 Er E 170 D date Assignment Commande 186 Debugging ABDOU deg eenegen ee 83 Backtrace Commande 88 Break Commande 91 Breakpoints About 86 Commande nee 87 Continue Commande 90 Line Numbers About 85 List Commande 87 List Files Commande 88 Next Commande 89 Print Commande 89 Promptsasseinmsnsnmveigete imijintnig 84 Quit Commande 90 Delimiters 0 0 See Loop Statement Double anchor Loop Statement Developing SONDIS Sissies ei ALEN 77 Distribution V lu 49 dorine la o EE 48 Meta Update 293 SJT Software Tool House Inc E Environment Run MM Esiosa oaea ei 56 Runn
94. 6 OldId CreRec2 Ory eof 3 record OK 0 records with errors total 3 Do One Launching 2 of 2 CopyRec2 from if SArg Id2 CopyRec CopyRec2 Do One Updates in file AAA Create Launch ini CopyRec2 Update0 line 98 is deprecated Use AssignNew CopyRec2 Ory 1 of 3 A first record CopyRec2 Qry 1 of 3 Merged schema Test Id 000000000004477 OldId CopyRec2 Qry 2 of 3 and now only seconds lat CopyRec2 Qry 2 of 3 Merged schema Test Id 000000000004478 OldId CopyRec2 Ory 3 of 3 A second entry made a few CopyRec2 Qry eof 3 record OK 0 records with errors total 3 Do One I record OK 0 records with errors total 1 Statistics Sections 3 Maximum section depth 2 Assignment Sections 6 Singleton Sections 1 errors 0 Queries 2 Query records 6 errors 0 Output Schemas 0 Output Schema records 6 created Output Schema records 0 updated with 0 skipped Outputs OK 6 Outputs Errors 0 Outputs Aborts 0 Input Errors 0 terminating successfully in 1 sec gt 68 User s Guide The 24h local time SAY Software Tool House Inc Message type to the millisecond E Error W Warning i Information Section s iteration type and count and for Loops the Loop type One Qry n of m Sql n of m Fle rec n Lp n of m Dry Control Section being processed 153544 312 Do One 153544 312 Do One Launkhing 1 of 2 CreRec2 from if SArg Id2 D
95. BC RE GISTRY ARSYS ARDBC REGIST RY sthvmwin2003 9999 ARSYS ARDBC ARREPORTENGINE ARSYS ARDBC ARREPORTE rm 60 2041 101 utf 16 VALUE TYPE DATE User s Guide 6 3 7 0 Meta Update HOMEPAGE_FORM DISABLE_FTS_INDEXER DISABLE_ARCHIVE SERVERGROUP_MEMBER SERVERGROUP LOG FILE FLUSH LOG LINES SERVERGROUP INTERVAL JAVA VM OPTIONS PER THREAD LOGS CONFIG FILE SSTABLE CHUNK SIZE SG EMAIL STATE SG FLASHBOARDS STATE SERVERGROUP NAME SG ADMIN SERVER NAME LOCKED WKFLW LOG MODE ROLE CHANGE SG ADMIN SERVER PORT PLUGIN LOOPBACK RPC CACHE MODE DB FREESPACE GENERAL AUTH ERR AUTH CHAINING MODE RPC NON BLOCKING 10 SYS LOGGING OPTIONS EXT AUTH CAPABILITIES DSO ERROR RETRY PREF SERVER OPTION FTINDEXER LOG FILE EXCEPTION OPTION ERROR EXCEPTION LIST DSO MAX QUERY SIZE ADMIN OP TRACKING ADMIN OP PROGRESS PLUGIN DEFAULT TIMEOUT EA IGNORE EXCESS GROUPS EA GROUP MAPPING PLUGIN LOG LEVEL FT THRESHOLD LOW FT THRESHOLD HIGH NOTIFY WEB PATH DISABLE NON UNICODE CLIENTS FT COLLECTION DIR FT CONFIGURATION DIR FT TEMP DIR FT REINDEX FT DISABLE SEARCH FT CASE SENSITIVITY FT SEARCH MATCH OP RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW 233 SAY Software Tool House Inc AR System Customizable Home Page 0 0 0 E Logs ARS a001 log 1 60 0 D Apps B
96. Concepte 39 QU EE 118 User s Guide SJT Software Tool House Inc 601 1 10 SE EE 37 QuerySa CONCEPTS rrarnrrnnnrnnnvrnnrnrnnrnrnnrrnnrnrene 38 Defined in Concepts arrnrrrrrrnvrnennrn 38 MEY POS usett erter 33 Ea esses disease dne 131 Defined in Concepts sarnrnrrrrnvnnennrn 40 J Join Loop Statement Example P 130 K Keywords in Control Sections rrrrrnvrnrnvrnrnnrnennnn 109 L Launch IN CONCEPTS 0 eeeeeeeeeeeeeeeeeeeeeneeeeteeeeeees 43 Launch CONCEPTS ee eeececeeeeeeteeeeteeseeeteeeteeertaee 21 IN CONCEPTS eee eeeeeeeeeeeteeeeteeeeeeeeeteeeeeees 34 Launch Welte EE 138 License Meta Update License Key 59 Line Numbers rernnannnnnnrrnnnnnnrnnnnnrnrnnnnen 85 List Debugoing Commande 87 List Files Debugoing Commande 88 Load statement ranrnrrnnnonnrrnnrrnnrrnnrnnnnr 117 Loads defined in Concerts 31 Logging ARS Client Log Switches seeseeeeeeeeee 71 Local Log File 65 Local Tracing 72 Message Format neccen 75 Server Trachmg 73 Switch Geitnmges 70 The d Switch 71 Tracing Locally seeen 72 LookUps ele suisse 198 204 Automatic Tags rrrnornrnrnnrrerernrrnervnrnnernn 200 Coaching 213 Flen 205 Keywords rmesnrnenvrnnnnrnenvrnnnnrnenrrernvrnennnne 201 Rief vare uemenasnersjusste 209 Q erySgl siiraks terini iesirea 210 Reference Assignment Commands 187 MVD TE 199 Loop Iteration in Concepts arrrnonrrronvrnrnvnnennr 39 Loop Sta
97. Debug2 logging As above but includes Debug2 logging and ignores any Trace assignment commands in the script Inhibits echoing of specific logs to the console but does not affect the logging file Verbose Equivalent to d qas All field structures queries and data values are logged Development switches 6 Single error mode Stops execution of the script when the first error is encountered 0 Debugging more Enters the Meta Update debugger Server switches file Note that servers and authentication may be specified on the command line in the script or default to the environment variables set by the SthLic cmd batch Defaults for the Main server when not coded on the command line or in the script are the environment variables ArsSvrAdmin The server name or IP ArsPort The server port Use of the port mapper is the default and can be specified with zero ArsUsr The ARS user that Meta Update will be running under Note that this user generally has administrator rights ArsPwd The encrypted or plain text password of the ARS user that Meta Update will be running under server XXX Specified the main ARS server May be an IP or machine name May also point to a specific server of a load balanced server group port XXX Specified the main ARS server s port number Zero is the default and indicates that the port mapper is used
98. ENC_PUB_KEY_INDEX CURRENT_ENC_SEC_POLICY ENC_LIBRARY_LEVEL NEW_FIPS_ALG FIPS_ALG FIPS_PUB_KEY WFD_QUEUES VERCNTL_OBJ_MOD_LOG_MODE MAX_RECURSION_LEVEL FT_SERVER_NAME FT_SERVER_PORT VERCNTL_OBJ_MOD_LOG_SAVE_D EF SG_AIE_STATE MAX_VENDOR_TEMP_TABLES DSO_LOG_LEVEL DS_PENDING_ERR REGISTRY_LOCATION REGISTRY_USER REGISTRY_PASSWORD DSO_LOG_ERR_FORM ARSIGNALD_LOG_FILE FIRE_ESCALATIONS RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW 235 SAY Software Tool House Inc Disabled Disabled Disabled Standard Disabled 0 0 1 0 0 AR System Log ALL 0 0 60 0 86400 2700 0 2 Invalid Option Disabled Disabled 0 1 Disabled Disabled 0 Disabled 1 0 AES 128 RSA 1024 0 25 0 0 1 0 Distributed Pending Errors 0 E Logs ARS a001 log User s Guide S H T Software Tool House Inc PRELOAD_NUM_THREADS RW 20 PRELOAD_NUM_SCHEMA_SEGS RW 300 PRELOAD_THREAD_INIT_ONLY RW 1 7 6 CREATE_WKFLW_PLACEHOLDER RW 0 MFS_TITLE_FIELD_WEIGHT RW 1 MFS_ENVIRONMENT_FIELD_WEIGH RW 1 T MFS_KEYWORDS_FIELD_WEIGHT RW 1 COPY_CACHE_LOGGING RW 0 DSO_SUPPRESS_NO_SUCH_ENTRY RW 0 _FOR_DELETE USE FTS IN WORKFLOW RW 1 MAX ATTACH SIZE RW 0 DISABLE ARSIGNALS RW 0 FT SEARCH THRESHOLD RW 10000 REQ FIELD IDENTIFIER RW REQ FIELD IDENTIFIER LOCATION RW 1 FT SIGNAL DELA
99. EONLY and ARTIMEONLY Hour hh displays the hour with a leading zero Second ss displays the second with a leading zero Minute mm displays the minute with a leading zero ii Meta Update 222 User s Guide SAY Software Tool House Inc Table 2 ARDATE Field Descriptors for Windows When the value is from a reference to an ARS field the date needs to be rearranged for the query in the appropriate manor The following sample code will take a date field reference and create a new field to hold an ARS query date value in the German format Cmd Ref V asg Date split regex amp 0 91 LO 97 7 LQ 91 10 91 3 0 91 ER ARSCH be Ty SRecXx Create Dates Cmd Ref V Date Fff amp SV dy SV mn SV yrs SV hr SV mm SV sss asg DoPpl yr yr mn dy hr mm ss iow wt we eo nm Im In nn 0 You can include the above assignments in an AssignInit processed before a Query and the reference the date as V Date Fff instead of RecXxx Submitter Meta Update 223 User s Guide SAY Software Tool House Inc Attachment Fields In Remedy there are two attributes for an attachment value the name of the attachment and the file name of the attachment With the Remedy GUI through the User tool or a browser assigning an attachment sets both the name of the attachment and the file name equal Saving an attachment allows you to create a file of any name With Meta Updat
100. Errors may be caused by different things Syntax errors ARS reported errors such as unrecognised schema names or field names or labels LookUp or Load failures User Aborts Meta Update has several switches that will aid in script development which would normally not be used in production runs e single Error With this switch any error in any section will stop the run We recommend you use this switch when you develop and test scripts You will generally not want it on production runs V Verbose This prints all query qualifications and results to the console and to the log file We recommend you use this switch when you develop and test scripts You will generally not want it on production runs n null This switch prevents any ARS updates or creates This is only useful for the most simple of scripts as generally launched sections depend on access to a previous sections updated and reread record reference d Logging Debug This should not normally be needed Itis intended to be used when using Meta Update support It provides complete debug level information on the job and generates masses of logs You can also specify you want ARS client logging with this switch See Tracing above for more information g Script Debugger This invokes the Meta Update script debugger The script debugger allows you to set breakpoints and single step though your scripts operation You can get debugging help print your script examine references cont
101. F inp the output file name Output Tags Max init num attachment fields to 0 Va Do set to true if file SArg F inp att csv exists JR mae ve ae Note different command to R k g determine file existenge n Cmd Ref Va Do 0 8 cmd if SCTL OS UNIX Windows and Unix Note ACmd Ref V spawn if f SArg F inpS att csv command amp then echo OK redir amp fi The echo produces cmd else OK lt 1 gt or OK lt cr gt 41f gt Coma JE Ye Co pawn in V stdout s w just if exist Arg F inp att csv eho OK j _ check for a leading Cmd endif Cmd if SV stdoutS OK Cmd Ref Va Do Cmd endif Meta Update 287 User s Guide SJT Software Tool House Inc Do Att Flds The SvTbl companion script generated an attachment fields CSV We are only Launched if this file exists We set number of attachment fields for the Update assignments Input Tags Va Max number of attachment fields Output Tags Max number of attachment fields Fnml 2 field name array 1 n Fidl 2 i field id array 1 n F Inp f att SArg F inpS att csv AssignPre Do Att Flds asg Do Att Flds asg For each field increase the number of fields and set it in the Va Fnm and Fid arrays Increment va Max r Cmd Ref Va Max Reval SVa MaxS 1 Cmd Ref Va Q Do asg FF vu This assigns a series of Do asg FF field value pairs to
102. File and Update statements Meta Update 117 User s Guide SJT Software Tool House Inc There is no distinction between loads in a control section and loads in an assignment section other than the fact that the loads from the control section are processed first The query and update are then processed resulting in one or two more loads Then the assignments may use all loaded data from either section The Loadg statement has been superseded by the more powerful LookUp facility Note that the LookUp facility can also be used to Load records and has advantages over the Load including caching the records using the first record when multiple records are returned and allowing no matching records If a Load query returns zero records an error is thrown Query Statements A Query statement is used to iterate through a query result of records For each record other records may be created or updated and other control sections may launched and assignment sections may be processed All results from a query are processed even if the server limits the number of records returned The starting record returned by the results and the maximum number of records returned by the results can be controlled if desired There are two types of Query statements Query and QuerySql Both types use the ARS API to return results A single Query or QuerySqi1 statement may be coded in a control section When the ouery or QuerySq1 statement i
103. Flowchart rrvrnnnnvnnnnnvnnnnvnnnnvnnnnnvnnnnnnnnnnnnnnnvennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 35 LET Log EE ME en 36 OE EEE EEE EE EE T 37 UCR Y SON EEE EE EE EE EE 38 EEE EE EE EN EE 38 LOOP ernn 39 UMi EE EE EE EE 40 UTE EE EE EE EE EE EE 41 OG gt EE EE SE 41 Update ee ebe SEENEN EENS det 41 OUT EE EE EEE EES dee 42 Launch siiin aa 43 Control Section Examples rrnnvnnnnnvnnnnnvnnnnvnnnnvnnnnnvnnnnnnnnnnnnnnnvennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 44 Example Migrate any Table runannvnnnnnnnvennnnnnvnnnnnnnvnnnnnnnvnnnnnnnnennnnnnvennnnnnvennnnnnnennnnnne 44 Installing Meta Update srernnnnnvnnnnnnnvnnnnnnnvennnnnnvennnnnnvennnnnnnnnnnnnnnennnnnnnennnnnnnennnnnnnnnnnnnnnennnnnnnennnnnne 47 Expanding The Distribution rrsannvvnnnnnnvennnnnnvennnnnnvnnnnnnnvennnnnnnennnnnnnnnnnnnnnennnnnnnennnnnneennnnnne 48 Complete Installation rsnvrnnnvnnnnnvnnnnnvnnnnvnnnnvnnnnnvnnnnnnnnnnnnnnnvennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 49 Distribution Copntente egdesgutetegte deeg ege NEE Eed EE 50 Running KO E crenssteesentece censuacecenntsercrenesteesenteeetecuescreenstcercreneste 55 Run Time ENVIRONIMOM Sic 2e coerce cect cetcecee chewed dee centecececuenteeenstset chesendeesestsurcrendseresntcceerenusee 56 BMC Remedy API VersionS rrravrnnnavnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnennnnnnnnnnnnnnnnnnnnnnn 57 Program e E 58 The License Keeser 59 Environment variables rennnnnnvennn
104. From a series of CSV files representing complex data trees From CSV files that Excel or the import tool can t handle containing embedded new lines and field values with embedded undoubled quotes From CSV files where the query to determine the update record is complex From CSV files where the target update form changes for each row in the data From fixed length transactional files records gt Ever had trouble getting data transformations right v T Assigning the right Status values based upon a different set of incoming values and more complex conditions Selecting the fields to be updated based upon incoming transaction data queried data read data Setting the values based upon incoming transaction data queried data read data Assigning values to reserved fields like Create Date and Submitter gt Ever wanted to adjust correct merge and change the ARS data that you have v v v Ever needed to combine two clients foundation data records Ever wanted to rename or split up support groups Ever needed to automate the importing of foundation data into the ITSM suite gt Ever had trouble creating an ARS API program v v Ever wasted time talking with a non ARS programmer Waited when making assignment or form logic changes for the programming development cycle before seeing the results Meta Update 125 User s Guide SAY Software Tool House Inc Solution Options There are four basic choices to
105. Guide SJT Software Tool House Inc Sv Att Struct This section saves the field names and ids of any attachment fields into a special CSV processed by the companion script Input Tags Src The source record Output Tags V First we want to execute once only V gotAtt says we have attachment fields Loop Fields Att Src Type Attachment Output TgtS amp Out f struct amp If there are no attachment SArg F out att csv d Assign Sv Att Struct asg fields the loop is executed AssignInit Sv Att Struct asg Init zero times no file is created and gotatt is not set true S CH SC ae E OEN No matter if there are any attachment fields or not we Sv Att Struct asg want to set First false ACmd Ref V gotAtt AttFldNm Att FieldName AttFldId Att FieldId Out f struct This declares the output CSV file listing the attachment fields Type Delimited FldHdr Format Quoted always Quotes escape lf escap Fields Out f struct flds Dut f struct flds AttFldNm AttFldId Meta Update 283 User s Guide SJT Software Tool House Inc Sv Att Input Tags sre Output Tags Att Loop Fields Att Type Attachment AssignPre Sv Att asg Sv Att asg Here we ar idl id2 fid att where idl to hyphens and fid An easy way to change Cmd Ref V regex Cmd AttachSave V AttPth SV Re Sv Att asg regex This field li
106. House Mupd_5 56 bin C Program Files SoftwareToolHouse Mupd_5 56 bin64 This bin and bin64 directories contain all required binaries exe and libraries dll for Meta Update and associated utilities You must use the bin directory on 32 bit computers and we recommend you use the bin64 directory on 64 bit computers It is recommended that this path be added to the system Environment Variables for use by a Server and in the User s Environment Variables for workstations All Meta Update binaries print usage instructions when entered with no arguments Meta Update 50 User s Guide SAY Software Tool House Inc The Meta Update distribution contains the following binaries for both 32 bit and 64 bit architectures File SthMupd exe SthMupdTrc exe SthMqry exe SthMsch exe SthMdel exe SthLicUpd exe SthTrcDaem exe Meta Update Contents Meta Update using local trace This single executable is Meta Update It appends to a single log file SthMupd Log on each run Meta Update using global trace This single executable is also Meta Update with a communication based for logging facility It will either behave as SthMupd exe or if the SthTrcDaem exe process is running see below will send its logs and messages to that process SthTrcDaem exe can be configured and controlled Note that Meta Query Meta Delete Meta Schema are also offered in this trace faci
107. I CreRec CreRec2 153544 781 Do One Schema in file AAA Create Launch ini CreRec2 Schema line 103 isy eprecated ignored 153544 781 CreRec2 Ory 1 of 3 A first record Each iteration shows data from the Query A script source file reference giving the section keyword Meta Update Sql File Loop record row or data For Queries this is the Administrator programmed query results generally the Short Description field and line number 69 User s Guide SJ Software Tool House Inc Ideal Command Prompt Properties Software Tool House recommends that for the convenience of the Meta Update script developer the Command Prompt have a wider and deeper buffer and that Quick Edit mode be set This applies to the UNIX shell as well ca Cmd Box Properties di c Cmd Box Properties Options Font Layout Colors Options Font Layout Colors Window Preview p Cursor Size Display Options Screen Buffer Size amp Window Width Full Screen Height Command History Edit Options Window Size Buffer Size IV QuickEdit Mode Width Number of Buffers 2 IV Insert Mode Height IV Discard Old Duplicates WARNING Screen buffer size will Window Position require 1 MB of memory per window Left Top IV Let system position window On Windows click the Command Prompt Icon on the Title Bar select Properties and ensure that QuickEdit Mode is on and then increase your Buf
108. MC ARSystem confiar cfg 1000 0 0 0 1295305780 390626 0 6171296 1 oOo CO CH 1 E Logs ARS a001 log 0 600 1 100 200 1000000 0 D Apps BMC ARSystem ftsconfiguration colle ction D Apps BMC ARSystem ftsconfiguration conf A OO User s Guide SAY Software Tool House Inc 7 5 Meta Update FT STOP WORDS FT RECOVERY INTERVAL FT OPTIMIZE THRESHOLD MAX PASSWORD ATTEMPTS GUESTS RESTRICT READ ORACLE CLOB STORE INROW NEXT ID BLOCK SIZE NEXT ID COMMIT RPC CLIENT XDR LIMIT CACHE DISP PROP USE CON NAME IN STATS DB MAX ATTACH SIZE DB MAX TEXT SIZE GUID_PREFIX MULTIPLE_ARSYSTEM_SERVERS ORACLE_BULK_FETCH_COUNT MINIMUM_CMDB_API_VER PLUGIN_PORT PLUGIN_LIST PLUGIN_PATH_LIST SHARED_LIB SHARED_LIB_PATH CMDB_INSTALL_DIR RE_LOG_DIR LOG_TO_FORM SQL_LOG_FORM API LOG FORM ESCL LOG FORM FILTER LOG FORM USER LOG FORM ALERT LOG FORM SVRGRP LOG FORM FTINDX LOG FORM THREAD LOG FORM RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW RW 234 a about above across after again against all al most alone along already also although alway s among an and another any anybody anyone anything anywhere are area area A5 s around as ask asked at away f Ku b back be became because beco me been before began behind bei saggy 60 1000 0 0 00 NOOGUOO gt 147483647 1 50 3 ardbcconf dll
109. Meta Update 281 User s Guide SJ Software Tool House Inc Do AssignInit asg I Query Src The ARS Schema is a SArg schemas sv Qual ____ _ __ reference As is the Query Output Tgt qualification amp Out amp SArg F out csv lt W W W Y The output file name is the Assign asg passed prefix appended with Launch if SV First Sv Att Struct csv Launch if V gotAttS Sv Att Out f This declares the output CSV file Type Delimited FldHdr Format Quoted always Quotes escape lf escap Geet EE The ARS Schema s fields dre eee i a copied into the output file Cmd Copy S SArg schemas definition asg I This initial assignment section initialises script variables Input Tags Arg Ptn or a query string Output Tags V First do Attachment File output one time V gotAtt table has attachments set Sv Att Struct V Qual 1 1 or the passed query string V AttPth the attachment path Cmd Ref gotAtt 0 Cmd Ref First 1 Cmd Ref A Qual 1 1 GCmd Ref AttPth SArg F out Cmd if SArg qry Ref V Qual SArg qryS asg This is the assignment to the CSV file Because all fields from the table and CSV file match we just issue a copy This single command cmd Copy Src 4 assigns all fields from embedded line quotes as speg Meta Update 282 User s
110. Output For ARS output you specify an output form or schema You can choose to always create a record or you can specify a query for an update record and create new records when no records match and or update matching records You can use Merge if desired even optionally turning off filters set to fire on Merge Of course you specify your assignments for any outputs and for any script variables After the output record is updated or created it is reread if needed This loads a fresh copy after ARS workflow has fired This then enables subsequent references to use any fields of the updated record Launch Finally after a newly updated or created record is reread you can launch other nested control sections That control section s statements can use the data loaded queried created or updated in the previous sections in all of its substitutions Because output records are reread you can use fields like Request IDs Instance Ids Group Lists Diaries or even attachments This nesting of sections which can be made conditional is what gives Meta Update its power over the API with significantly simplified development For each record of an import file any number of output records in any number of different forms may be created Each import record can select which form to create a record in With a few simple words your ARS administrator can create chained nested data scripts that can be used in automated imports
111. Output statement may gt create a single file always appended to gt create a set of files appended to at different times gt create a new file on each iteration of the section Fields can be defined for columnar files as well as field transformations Fields can be copied from Schema This is useful for generating complex reports where data is gathered from multiple forms and records Meta Update 42 User s Guide SAY Software Tool House Inc Launch Meta Update allows you to follow chains of linked records One control section can launch other control sections which can in turn launch still others For example let s say you have the following tables Organisation f many Sites 1 many Services You want to write a script to invalidate all Services belonging to an Organisation You write a Meta Update control section that queries for the single Organisation record you wish to invalidate services for This control section launches a second control section that queries for all sites associated with this Organisation That second control section processes a set of Site records and for each of those Site records launches a third control section that queries for all services associated with that single Site record being processed That third control section invalidates the Services records for each Site of the Organisation Here is a simple file that will do this Org Query Org Organisation 1 001 Lau
112. RS Server s server configuration file ar conf Or ar cfg It is given by the Server Name value On ARS Systems from release 7 0 onward this setting is available under the user tool when signed on with a User having the Administrator group permission From the standard Home form click the AR System Administration Console link From the Administration Console expand the System and General branches of the menu then click the Server Information item Once the Server Information form comes up click the Platform tab dy User AR System Administration Server informatinn Medify ee L few ph Amon tram ie SN il Teil Bl wi Server Information Pistons Twessete License Contgeastion Log Files Osteon Porte and Queue Advanced Zorte Cormel Geram Everts Connector Settings Cumeer Typer CA Geren V rten Oo mp Sete Disc D Vood AnavetDo Hadare intet Pertam Operating Sytem Windows NT 52 Serem Nome Aline etre Seren Tive 20080102 14 52 93 If an ARS Server is unnamed the short host name is used as the server name Meta Update 241 User s Guide SJT Software Tool House Inc Meta Update may also be licensed on an enterprise wide basis by matching the ARS Server s domain name With an Enterprise license Meta Update may be run against any ARS server whose host name matches the licensed domain name For enterprise licensing the ARS server s reported
113. S that Meta Update is running on a On Windows one could set the script path like this set SthScriptPath E Projects ITSM Scripts D Apps STH samples 1 Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer Wikipedia Meta Update 60 User s Guide SAY Software Tool House Inc On LINUX one could set the path like so export SthScriptPath Projects ITSM Scripts Apps STH samples Note the difference in the path and directory separators Subdirectories in the paths are not searched However if the script passed to the command line contains a relative path that relative path will be checked against the SthScriptPath and the first matching file will be opened API Retry Environment Variable A Meta Update job normally returns any errors received from the ARS server during any of its API calls and cancels the single record it was processing It would then continue with the next record It is useful to protect the Meta Update run from a server timeout crash or restart Meta Update can retry some API calls to the server based on configurable ARERR codes a maximum number of retries and a delay between retries The environment variable SthApiRetry may be used to specify these retry settings Without this environment variable all API calls that fail cause an error in Meta Update that can result in a record being lost not found or the Meta Up
114. SCII file That file also specifies query text that can be appended to the programmed modification date query The following is a sample file Tbl TblSql IdFld ModFld QueryText Names five file columns R People shr people request id modified on gt The fifth value is null PD HelpDesk hpd helpdesk case id modified on R Audit shr audit request id Appended to programmed Schema 1 V HPD HelpDeskV query isolates the Help Desk associated records for R Association shr association request id a run with this file modified on Schema 1 vet TZ Interestingly multiple jobs can be simultaneously to take advantage of the ARS server s multi threading This could be extended to several machines Each job would specify independent sets of dependent tables Script Overview The Main section will define the source server It will also change the date into a format suitable for an SQL query The called command section will process the passed CSV file It will not make any outputs itself but instead launch another command section That launched section will in turn issue an SQL Query on the table named in the CSV anda date with any optional query text appended That query section will actually do an SQL query to prevent ARS timeouts as generally the modified by field is not indexed It will iterate through that list updating any records it needs to This Script Demonstrates Processing a CSV with
115. SHAN Software Tool House Inc Software Tool House Inc Meta Update User s Guide 2015 Software Tool House Inc Release 5 56 Updated 2015 Sep 30 SAY Software Tool House Inc Preface Audience This document is intended for Remedy ARS Administrators and developers It is expected that the reader will have knowledge of the Remedy ARS system and be familiar with workflow development It would behove the reader to be familiar with his ARS server s platform and scripting tools Limitation of Liability This program is provided as is We are in no way liable for any losses arising from your use of this program the sample scripts or the documentation It is your responsibility to evaluate this program It is your responsibility to backup and protect your data It is your responsibility to evaluate your use of this program for any particular purpose This manual does not represent a commitment to maintain any syntax or operation nor is it warranted to be complete or accurate Copyrights This program and this manual are copyrighted 1996 2015 by Software Tool House Inc Meta Layer Meta Update and Meta Extract are trademarks of Software Tool House Inc ARS Remedy ITSM CMDB are registered trademarks of BMC Corporation Solaris is a registered trademark of Sun Microsystems Inc Windows is a registered trademark of Microsoft Corporation PCRE Perl Compatible Regular Expression library is copyrighted 1997 2006 b
116. Script Arguments Arg Arg name Default xxx Default none Arg Arg name Default xxx Specifies a field that will be referenced in the script body in the tag Arg This will correspond to an argument on the command line when this script was invoked If the argument default value is not specified in the script the argument will be required on the command line and an error will be thrown Any script usage text PrmReq will be displayed You may specify as many Arg keywords as needed by the script It is recommended that a minimum of one argument be mandatory and that script usage information be supplied with the PrmReq keyword ArgNm ArgNm is deprecated and is treated as Arg The Default keyword is not available PrmReq text Default 0 PrmReq text Specifies usage text presented when any required arguments are not supplied All sample scripts will present usage instructions when run without arguments These will explain the script function default and required arguments and example runs Meta Update 101 User s Guide SJT Software Tool House Inc Script Initialization ReadServers Section section Default none A list of other ReadServer section names which will be used in the script See ReadServer sections below Sessions will be established to the main server and all servers in the sections specified by this statement Queries and SQL queries can be run against
117. See Field Formats above for more information This is used to create an in memory ARS record from the specified schema The name field is interpreted as an assignment section When needed for an update this in memory ARS record can be assigned to an update record val This is used to do a double dereference so that the tag and name are themselves references This is similar to using info for the assigned name as described above but only extracts the value of the references regex This is used to apply a regular expression to a value and perform substring extraction from that expression The Name field is interpreted as a field section to name the extracts substrings If matched the Tag will contain all fields of this section The special name rc is assigned 1 indicating the regex was matched or 0 indicating it was not The Name may be specified as na indicating that fields are not defined and numerical references will be assigned to the tag for extracted strings Regular expressions may themselves have references Meta Update uses PCRE for evaluating regular expressions Meta Update 178 User s Guide Examples of Tags and Names MyVars MyVars MyVars rt FleCfg Schema rt MyVars i DoExtraWorkLogRecord SkipAuditLog i RequestIdField TotalRecs SAY Software Tool House Inc Note that in the last two lines the Tag being assigned is dereferenced Examples could be rt HPD Help Desk and
118. Should use references within the loaded query record to create the target string QueryTarget CTL LookUp Src amp SQry Tag fldi lename QueryMul ti Optional when Query used Default is Error Specifies the action to take when multiple records are returned by the ARS query when the LookUp is done Values are Error and First If First is selected the first record that matches is loaded into the Tag and the LookUp return string is made fusing that loaded record QuerySql Optional Specifies that an ARS SQL Query will be loaded and used to derive the returned string if matched A QuerySql specifies an SQL query that should return exactly one row The CTL LookUp Src reference can be used in the Query The full features of the QuerySql statement are available This includes the field value interpretations and transformations QuerySql Ory Dwl Tag na Select fld val from QRY Schema where fld test SCTL LookUp _Src and Status 2 RR MS KS Meta Update 202 User s Guide SAY Software Tool House Inc QuerySqlTarget Required when QuerySq1 is used Specifies the string to be built as the LookUp return value when the LookUp query matches a row Should use references within the loaded query record to create the target string SQL columns are numbered starting at 1 or field names can be used if defined on the QuerySql statement Que
119. The order keyword controls the order in which the lists are searched LookUp Section Default XXX NoMatch 7 Ze Se Be St If a list is coded in Lo Default Skip Error the section the LookUp Val 2 val controls the list LookUp Val 2 Val 2 search sequence Query TagSvr Tag Schema Query QueryTarget S QueryTarget Tag Tgt 1 Tag Fld 4 lt _ used to build a QueryMulti First Error LookUp return string from the fields in the record and other references Query Specifies that an ARS Query will be used to select a record with which to build the returned string The Query is coded exactly as in a Command Section see Query Statements above If the Query matches a record the Tag is used to hold the loaded Meta Update 209 User s Guide SAY Software Tool House Inc values These remain in memory until the next LookUp using the same LookUp section is processed QueryTarget Specifies how to build the string that will be returned when the Query matches a record Fields in the loaded record may be used to construct the returned string That string can also use other references and the CTL LookUp Src reference QueryMulti This is an optional value than can be one of two keywords Error or First The default is QueryMulti Error Normally the Query specified should return exactly one record If multiple records are returned this allows you to continue by loading the fi
120. Txxx This is the real output of the script This Assignment a message to the console Command issues a BCmd Msg W Schema SArSch 1 t t t Id SArSch 2 t t t Recs V Counts LkUp Count returns a single string the value of the single SQL column from the single SQL row select count 4 from Txxx We are passed the arschema schema id and simply do a select count on that schema id s T table QuerySsql ArSchCnt na select count from TSCTL LookUp Src QuerySqlTarget SArSchCnt 1 Meta Update 260 User s Guide Software Tool House Inc AR Server Info Report This simple script outputs a CSV containing the fields and values of the predefined AR_INFO Tag This Tag is automatically defined for every Meta Update script and is the ARS Server Information The script demonstrates gt How to use environment variables to specify the server gt How to process a fields Loop gt How to use Output to create a CSV Requirements There are no requirements for this script and no server performance ramifications Setting Up The Environment This script uses the default environment variables for connectivity as set by SthLic cmd or SthLic sh Script Output Value DB TYPE SQL SQL Server SERVER LICENSE Server FIXED LICENSE 18 VERSION 7 6 04 Build 002 201101141059 ALLOW GUESTS 1 USE ETC PASSWD 0 XREF PASSWORDS 0 DEBUG MODE 1179711 DB NAME ARSystem HARDWARE x86
121. Up is used again the list that was read is used again and no more file reads happen gt An ARS Query or SQL Query The selected record if found is Loaded A result string is made from the fields of that record The Loaded record can also be used by the rest of the script If the Query returns no results it is still possible for the LookUp to succeed through another source listed above These records may optionally be cached so that if the record is found once for a source string and that same source string is applied to the same LookUp section the same record will be returned without executing the Query Caching of records is not on unless specified The default behaviour is to not cache records With caching in a LookUp section the time required to access the server can be eliminated significantly reducing the time required for a data operation A special reference is set to indicate the results of the LookUp This reference can be queried to determine that there is a loaded record available for use An SQL statement opens up the power of SQL functions to translate a value Any and all of the above sources may be used in a LookUp section Automatic Tags The LookUp section sets automatic CTL variables each time it is used in a LookUp assignment Two variables are automatically set These are used to specify the LookUp source string within the LookUp section itself and to specify where the return string was found Each LookUp
122. While exp Loop Fields sTag SrcTag Loop Join sTag BMC CORE BMC Mainframe In the first example a Help Desk ticket is loaded into the Tag SrcTT The Notes field a diary field is parsed and each entry in that diary field is iterated through When the entry is loaded the following references are made available to the section sTag User the login name of the user who made the diary entry sTag Date the date of the entry yyyy mm dd hh mm ss sTag DateMdy the date of the entry mm dd yyyy hh mm ss sTag DateDmy the date of the entry dd mm yyyy hh mm ss sTag Text the entry text The Date value is useful for assignments This is the format that Meta Update expects for date variables The DateXxx values are useful for ARS Queries which require that the date be formatted according to the machine s locale In Windows this is set at a machine level On Unix the local may be controlled by environment variables The C locale a default is refernced by DateMdy In the second example a User record is loaded into the tag Usr The Group List field is parsed based on the semi colon seperator specified into a set of single groups Each of those groups is interated through When each group is loaded the following references are made available sTag Text the single group id as a string Meta Update 39 User s Guide SJ Software Tool House Inc A sort may be specified if desired otherwise the entries will be
123. Y RW 10 ATRIUM SSO AUTHENTICATION RW 0 OVERLAY MODE RW 1 FT FORM REINDEX RW 7 6 04 DS LOGICAL MAPPING RW Distributed Logical Mapping DB_CONNECTION_TIMEOUT RW 30 ATRIUMSSO LOCATION RW ATRIUMSSO USER RW ATRIUMSSO PASSWORD RW SUPPRESS DOMAIN IN URL RW 0 RESTART PLUGIN W USE PROMPT BAR FOR W ATRIUMSSO_KEYSTORE_PATH RW ATRIUMSSO_KEYSTORE_PASSWOR RW D CTL Schema Tag Any Remedy form queried loaded or updated by a script causes a new tag to be created This Tag holds information about the form The Tag created includes the read server tag if the load or query was from a read server and the schema name itself including spaces and special characters Regular Join View Dialog Vendor bool TypeSchema is Join 0 string Join schema 1 si string Join schema 2 ARS Schema Type Meta Update 236 User s Guide Meta Update bool string string bool string string bool integer string integer integer bool string string bool bool TypeSchema is View the database view name the database key field request id TypeSchema is Vendor Vendor name identifies the plugin supplying the table Vendor Table is selected when defining the table to ARS Set true unless the schema has defined max length of the request id field 1 as 1 implying no zero fill Length of the request id field 1 almost always 15 even in those cases where ARS indicates a maximum length of 1 indicat
124. a Subst field specification Meta Update 280 User s Guide Cie Software Tool House Inc Meta Update script Meta Update sample script file Meta Update is copyright 1996 2011 by Software Tool House Inc File SvTbl ini Part of the sample scripts for Meta Update wo scripts used to save and restore any ARS tables data This is the Save script See LdTbl ini for the restore script his Save script will save all records into a single CSV and attachments into files prefixed by the passed argument The main section gives sign on info and declares Script arguments required and usage info Server ArsSvr Server connectivity and Port ArsPort gu authentication set from User I ArsUsr environment variables Password E ArsPwd PrmReq Function PrmReq Two scripts used to save and restore ARS tables PrmReq This is the Save script PrmReq f PrmReq Usage PrmReq SvTbl ini Do p tbl outp qry ArgNm schema ArgNm F out This is the main entry point and called routine This section reads through the given table creating the output CSV file A Query is executed on the source table and the output file record record is created using an assignment copy command Once only a section that saves a CSV of attachment files is launched If there are attachment fields a section is launched each record to save those attachments to the file system
125. a Warning but continue the assignments Meta Update 175 User s Guide SAY Software Tool House Inc When a Spawn command is used in an assignment and that Spawn succeeds these cTL references are automatically set CTL Spawn_Cmd The executed command This reference is set when any Spawn is encountered CTL Spawn rc The executed process return code This reference is set to 1 when a Spawn is encountered and set to the spawned processes return code when the spawned process completes These variables need to be assigned to be saved Reference Command The Reference command allows you to assign a value into a named string reference That named string reference can be used anywhere any reference can be used after it has been assigned This is a very powerful facility allowing you to implement more complex batch functions with Meta Update A string reference is similar to a Remedy record The Tag identifies a set of named values akin to fields So if you assigned the value xyz to a field called Text in a Tag called MyVars you would get xyz from this reference MyVars Text Each Reference command assigns one or more such named values to tags or can refer to an assignment section where the left hand targets of assignments become named values The general format of the Reference command is this Cmd Reference Tag Name Value The word Reference may be abbreviated to Ref
126. acimg Switch Geitmges Type Sections in Concepnts U Until statement Meta Update 296 Defined in Concepts arrnronvnnonrnnonvnnenrenen 40 Update About Concerte 41 Update Gtaiememt eneee 133 Assignment Sections arrnnrnrnronvnnrnrnnrn 133 UpdatelfEqual Giatement 134 V Value interpretations ue 22 Versions Meta Update Program Versions 58 W Workflow Running Meta Update from eee 77 User s Guide Cie Software Tool House Inc Meta Update 297 User s Guide
127. acting and loading attachments YYYYY Running the script The package is in the distribution and may also be downloaded from the script library The package contains a def file for the form _Test It also contains data saved by the sample save script that can be used to populate the _Test table To validate these scripts simply run the backup against a single record generate a report of all data from this record delete the record run the restore generate a second report from this Meta Update 279 User s Guide SJT Software Tool House Inc record and do a difference of the two reports There should be no differences between the two reports SthMupd SvTbl ini Do p Test test 1 000000000000001 SthMqry f S Test 1 000000000000001V gt rpt before txt SthMdel Test 1 000000000000001 SthMupd LdTbl ini Do p Test test SthMqry f S Test 1 000000000000001 gt rpt after txt diff rpt before txt rpt after txt Backup Script Overview Do is the main command section and issues the query against the passed table Each record is assigned to the tag Src An Assignlnit is used to initialize script variables and formulate a default query string 1 1 if the script was not passed a query qualification Do will output a record to a CSV for each record it processes It will not change any values other than encoding any embedded quotes and line feeds The assignments to the output CSV ar
128. ad and associates that record with the specified Tag A Load statement consists of the keyword Loado and a three part value plus an optional read server reference LoadQ amp SrvTag Tag Schema Ory e The SvrTag if coded indicates that this record will be loaded from the server specified as a Read Server with the matching Tag e The Tag is used as references to the loaded record s fields in assignments to the target record in other Loads in Queries Launches and Updates e The Schema is the ARS form on the server to read from e Theory is a query string whose result must return one and only one record Any field in the loaded record s form can be assigned to any field in the update assignments Meta Update does automatic type conversions A loaded record s field can also be used as a Key in a subsequent load or inside a query string Two loads with the same Tag is an error Loads are processed in the order coded This order may be important as a field from a loaded record may be used to load another record All loads specified in the control section before the Query File and Update statements of that section are processed before the Query File and Update statements The Query File and Update statements can use data loaded in the preceding loads Load statements specified after Query File and Update statements are processed after these statements and can use the data in the results of the Query
129. an output file record or pattern output targets Assign Required for all sections that have output Update Create Output keywords Specifies the assignment sections to be applied when an update record is found or a new ARS or file record is to be created AssignNew Only used with an update Optional Specifies the assignment sections to be applied when no update record is found This will cause the Update to create a new record if the Update query returns no records AssignOpen Only used with an output Optional Specifies the assignment sections to be applied when the file is first opened or for pattern files when the next file is being opened AssignClose Only used with an output Optional Specifies the assignment sections to be applied when the file is closed at the job end or for pattern files when the current file is being closed just before the next file is opened Meta Update 161 User s Guide Sak Software Tool House Inc Assignment Targets Assignment sections are applied to target ARS records target columnar files target pattern files or with no target at all The general format of an assignment is Assignment Section Target Field some value For ARS records the Target Field is an ARS Database Field Name or Field ID belonging to the target schema HpdUpdate asg upd Status Closed Work Log Auto closed in batch process Work Log
130. ant of x acsch x inverse hyperbolic cosecant of x Note that 1 degree 0 0174532925 radians The rand function uses the standard OS implementations of rand As such the limitations associated with the standard random number generators are inherent in the Meta Update generator The function is seeded with the current time at the start of the Meta Update job This is true even if the random number function is not used in the script The first 100 random numbers are discarded as part of the seeding process Seeding and the discarding of the first 100 results is automatic but can be inhibited with the RandSeed No directive in the Main section If seeding is inhibited each run of Meta Update will produce the same sequence of random numbers Meta Update 195 User s Guide SAY Software Tool House Inc Set Schema Command The Set Schema command allows you to alter some form parameters Currently only the Archive settings for a form may be set The Set Schema Command alters the definition of the specified form This is not a data operation This requires Admin privileges and should be used with caution cmd Set Schema Archive Schema Name SrcTag Set This must be coded exactly as shown and indicates a Set command Schema Must be coded as shown and indicates that a form property will be changed Archive Must be coded as shown and indicates that a form s archive property will be changed Schema Name This is a
131. are Tool House Inc Diary Fields Diary Field values can be one of two types a character string or a formatted diary field string A formatted diary field string contains diary field entries including a time stamp a user and the text of the entry These are referenced by using a loaded record s diary field data When a diary field contains a formatted diary string no concatenation is permitted That string can only be used in a new create not an update The actual update is made using the Merge API after the record is created normally Normal strings can be assigned to diary entries on both new creates and updates They can also be concatenated in the Assignments file In these cases the string the current time and the user that Meta Update signs on with are appended as a new entry to the current diary field contents Meta Update 216 User s Guide SAY Software Tool House Inc Currency Fields Currency Fields can be specified as a specially constructed string This is the same whether the currency field value is in an import file or used in a literal assignment The field definition on the form plays a role in the assignment of currency fields To specify a currency field the minimum required is a decimal numeric quantity If desired all functional currencies may be specified as well as a date for the conversion of the functional currencies The syntax for a currency field value is nnn nn XXX date nnn nn XXX J
132. ass join and updates the records on the target server User s Guide SAY Software Tool House Inc SthMupd exe CmdbXfer ini Do Form BMC CORE BMC Mainframe All mainframes no matter what datasets would be transferred from the production server to the target server The following output might result Do Qry 1 of 1 BMC CORE BMC Mainframe RE7269hqy0lmna6y0lqa Do Ory 1 of 1 Launching Do Join Do Join Lp 1 of 3 BMC CORE BMC Mainframe Do Join Lp 1 of 3 Launching Do I Do I Ory 1 of 1 BMC CORE BMC Mainframe RE7269hqy0lmna6y0lqa Do I Updated BMC CORE BMC Mainframe RE7269hqy0lmna6y0lqa Do Join Lp 1 of 3 BMC CORE BMC ComputerSystem Do Join Lp 2 of 3 Launching Do I Do I Ory 1 of 1 BMC CORE BMC ComputerSystem RE7269hqy0lmna6y0lqa Do I Updated BMC CORE BMC ComputerSystem_ RE7269hqy0lmna6y0lqa Do Join Lp 1 of 3 BMC CORE BMC BaseElement Do Join Lp 3 of 3 Launching Do I Do I Ory 1 of 1 BMC CORE BMC BaseElement RE7269hqy0lmna6y0lqa Do I Updated BMC CORE BMC BaseElement RE7269hqy0lmna6y0lqa Do Join Lp completed 3 records OK Do Ory completed 1 record OK w Create Statement A single Create statement may be coded in the control section if Meta Update is to always create new records with every iteration Note that generally it is better to code an Update so that when the same script is run the pertinent records are updated rather t
133. at the end of the string If both are specified the value must match completely The and character must be escaped if they are part of and begin or end the pattern string Truncate the value Applied last Specifies the conversion for the non printable characters of the value The set of values considered printable WordChar can be adjusted from the default If not specified the default action is delete The default set of characters comprises the letters the numbers the underscore the hyphen the period the dollar sign Adds a set of characters to the list of characters considers a WordChar Removes a set of characters to the list of characters considers a WordChar Automatic SQL Select Generation Fields may be used in a QuerySql1 statement These fields offer value interpretation for the columns returned by that SQL query and must be specified in the same order as the fields in the Querysq1 select Meta Update 149 User s Guide SJT Software Tool House Inc Meta Update provides a feature to simplify the select statement and to ensure that the order of the fields declared in the field section and columns selected in the SQL query match When a field section is used in a QuerySq1 statement the fields in the field section are concatenated together separated by commas so that a select statement can use this symbol for the list of fields following the select An additional feature of a field dec
134. ate asg upd HpdUpdate asg upd The specific Assign keyword or command semantics implies a target In the above example both the AssignNew and Assign sections HpdUpdate asg create and HpdUpdate asg upd will apply to an ARS record in the HPD Help Desk form In these assignment sections the fields of the HPD Help Desk form are assigned values and the assignment commands may be used as needed Similarly if the section uses an Output to create ASCII files values will be assigned to the fields The AssignInit section has no target Only the assignment commands may be used in these assignment sections There are no fields to be assigned values The following keywords may be coded in a control section to specify assignment sections Any number of sections can be coded with any keyword and the same section may be coded with many keywords Each of these keywords specify assignment sections that have no output targets The different keywords are used to specify the point during the section process that the assignment sections will be used These assignment sections because they have no target ARS schema or Output file only allow the Cmd and LoadQ pseudo fields as the assigned fields AssignInit Specifies the assignment sections to be applied before processing begins for the section AssignTerm Specifies the assignment sections to be applied after processing ends for the section and the section is about to be closed
135. ation Filelf if STag AppSchema amp CHG Change 206 User s Guide This more complete example is described below Ji l Software Tool ouse Inc This image is of a sample CSV from an ITSM 6 to ITSM 7 Migration script describing all CTI Product Model conversions Different slices of the same file were used in different LookUp sections i D FEST AA DM SCHEUREN EEE GE He GC nir HH na aa aa FEN LA HUMBERT veeeye RAR RA e DEL ee 3 NW eg iH Jeatumatre Deg vearetrutare see HOG Change Tontenewe Era Fre ina Bei oss reg Tletiteren Eerste Urea EE PEERETEREREST P723 PEET gi F EN aE Hi Bates Hat SERIES 4 I H iil mn A Gah i Jainisiaiainnin aan EC i E Metz Update i 207 RER vr LESE NPE EE EEG i d o User s Guide SVT Software Tool House Inc This LookUp section will take as an ITSM 6 root request s AppSchema and its Category Type and Item and will return a new Categorization Tiers 1 2 3 from the ITSM 7 Suite The source string was the original record s Category Type Item separated by The returned string is the new Categorization Tier 1 2 3 Cmd Ref MyVars CT_lkup LookUp LkUp CT SHpdSrc
136. aults to 1 Examples Sleep 2 Sleep 2 5 The first example pauses 2 seconds after each iteration of the section The second example pauses 2 seconds once after every five iterations of a section TimeOutNormal nnn Optional If coded sets the API Session Timeout for Normal Operations to a number of seconds These operations include most single record operations such as reading and updating Remedy ARS records The number can only be increased from the default 120 seconds Example TimeOutNormal 300 This increases the timeout for single record operations to 5 minutes This can be used when filter activity takes more than the default of two minutes or for slow connections to the server Meta Update 111 User s Guide SJT Software Tool House Inc TimeOutLong ClientType nnn Optional If coded sets the API Session Timeout for Long Operations to a number of seconds Long operations are those that are multi record such as ARS or SQL queries The number can only be increased from the default 300 seconds Example TimeOutLong 1200 This increases the timeout for queries to 20 minutes nnn Optional If coded sets the Client Type Setting the Client Type can be used in testing scripts to exercise client specific filters Example ClientType 11 Set the Client Type to that of the Mid Tier Load Statements The Loadg statement is supported but has been superseded by the more p
137. ber of records per file When this number is reached the trace file will be closed and the next trace file will be opened TreLvl the starting trace level See trcctl exe for more information about the levels and their meanings TrcTme a normal trace client is presumed to live for a short time between issuing traces Long lived processes may have larger amounts of time between traces This specifies the maximum amount of time between calls for the trace daemon to consider that the client program has failed or been aborted without a proper shutdown When this time is reached an error trace message will be added to the trace file and client resources will be freed ErrLog specifies a single file that will collect R and E messages This file will always grow It is the administrators responsibility to remove the file on occasion ScOpen can be used to run a single command file or shell script It is passed the version number of the file just closed and the fully qualified file name In the above example when the trace switches say it was on 19 and is now on 20 a command will be run in the system as follows cmd c trcerrm cmd 19 e tre trace 19 See www softwaretoolhouse com for more details and for the Trace User document Trace Format A trace record looks like this hhmmss nnn f Opid Prog text The hhmmss nnn is the time that the record was created by the application Note that trace records may appear out o
138. bers List Sec list contents of a section List Sec Kwd list only a single keyword and value Examples 1 100 will list the source script at line 100 1 2 20 will list source at line 20 in file 2 1 asg new HPD will list the complete asg new HPD 1 asg new HPD Status will list the Status assignment in at Do ln 42 Init Mupd Dbg gt Meta Update 87 User s Guide S z H Software Tool House Inc List Files Use ListFiles to print your scripts source file name and file indexes Mupd Dbg gt help listfiles The ListFiles command lists all source files and file indexes of the source script lf ListFiles n list file names and indexes When using multiple source files with the include directive each file is given an index number from 1 upwards Line numbers are displayed and entered as either ix num where ix is the file index or a single line number being the combined line number for the script with all included files folded in The optional argument causes the single file name referenced by the given index to be listed at Do In 42 Init Mupd Dbg gt listfiles 1 gt 100 Hpd ini 2 gt 999 IncludesNV000 Jctl Sync ini 3 gt 999 Includes 100 CfgUpdFlag ini at Cfg asg 35 1 35 Asg Mupd Dbg gt BackTrace Use BackTrace to print the list of sections launched to the current execution position From the Help BackTrace command Mupd Dbg gt help bt A Launch BackTrace reports w
139. bjects to Import D rane EB Fame Uf Fam Des EG SotusinTookiousn Q Actwe Links ig Fom Data fis amp Active Links GA Escalators sui F es Og Actwe Link Guides STH SubmiterSet 4 Fite Guides G Excalstore Applications QJ Active Link Guides Packirg Lett Fite Guadas Manus Datitused Matree Detrbuted Pooli Appice sors Packing Lists Menus BP Tu ce lt lt Ben Web Services DN Distributed Mamer Datrbuted Pools Flashboerdt DN Pasbosd Vansbie a fe kee ants at S Feieren cn te besnaten Save Delete Excess Fields bom Destination Servet I Delete Excess Views from Destination Server Handle Conticting Typer Display Contiict Epo L i en You can control access to Meta Update by controlling access to the Software ToolHouse form This form has the following structure Application Text 32 Section Text 32 Keyword Text 32 Value Text 255 Application Section and Keyword must be unique The field Ids are not important The License key consists of an uppercase alphanumeric string with hyphens Itis stored ina record of the Software ToolHouse for where Application is Meta Update Section is NULL Keyword is License Value is the license key supplied to you Meta Update 245 User s Guide Sak Software Tool House Inc Meta Update 246 User s Guide SJT Software Tool House Inc ARS User Password Encryption Meta Update 247 User s Guide Sak Software To
140. ble Cmd Reference V Tag NERE Cmd Reference V Fld Status Cmd Reference V Sta val SV Tag SV Fld If the field is an attachment only the attachment s file name value is set The actual attachment cannot be assigned using this facility Formatting Values assigning a single value by transforming with a format You can use a format assignment to transform a value according to a format string Format Strings are used in field declaration to interpret SQL or CSV columns or as an output transformation for CSV columns See page 148 Field Sections in Script Reference for detailed information on format strings There are two forms of a format reference assignment command Meta Update 185 User s Guide SAY Software Tool House Inc ACmd ACmd imt fmtout Val Fmt Reference Tag Name fmt Val Fmt Reference Tag Name fmtout Val Fmt These are keywords and must be coded exactly as shown f mtout causes the transform to behave as though the field were being prepared for an output CSV file f mt causes the opposite that is the field is being interpreted for internal use This can affect dates for example Gfmt of a date always results in an internal date and time stamp which can be used in ARS assignments and date reference assignments fmtout on the other hand can yield a wide variety of strings for a date This is the source value It can be a
141. ble The script demonstrates gt How to use environment variables to specify the server gt How to process a QuerySql gt How to use Output to create a CSV gt How to code a LookUp returning an SQL function The script s real function is to demonstrate how you can code the ARS server connectivity arguments so that they are coded as environment variables This way if you want to use the same script across several environments you need only change a few environment variables Requirements We don t need to do much in the script itself as we want it to demonstrate how to code the ARS server connectivity and authentication arguments referencing environment variable so that we can run this script easily across multiple ARS Server environments So to add a bit of useful function we ll list the regular tables from arschema along with the current number of records they hold Setting Up The Environment In Windows the environment variables may be set on a single DOS session for a specific user s complete Windows sessions or for all users Windows system environment To set a single DOS box s environment open a Command Prompt Then use the set command to assign the expected environment variables For example set ArsSvr 192 168 1 10 set ArsPort 0 set ArsUsr Demo set ArsPwd set SthMupdLic QF143G6 PL95SQ When you run the script the script will connect to the ARS server as specified by the above environment variables and
142. c SqlFlds amp select distinct amp Category Type Item amp from BMC BMC AssetBase SqlFlds Category Type Item Note that the following query is entirely equivalent to the above QuerySql SqlRec SqlFlds amp select distinct amp SCTL SqlFlds SqlSelect amp from BMC BMC AssetBase References to SqlRec could then be coded as Query ShrCat SHR Categorization amp Category SSqlRec Category AND amp Type SSqlRec Type AND amp Item SSqlRec Item Or in assignments as Category SqlRec 1 Type SqlRec Type Item SqlRec 3 Another example QuerySql SrcSvr SrePct SrecPct amp select Request Id Instance Id amp Category Type Item from select distinct item from SArg Schema amp where AssetLifecycleStatus 5 and amp BMC DataSet BMC ASSET amp SrePct RequestID InstanceID Category Type Item Meta Update 123 User s Guide SJT Software Tool House Inc In the above example records of 5 fields or values will be retrieved These fields are can be referenced in two ways 1 simply by their column numbers starting from 1 as in the BMC Administrator or 2 by the field names in the SrcPct section For the ouerySq1 above the fields of each SQL row can be referenced as SrcPct 1 SrcPct RequestID SrcPct 2 SrcPct InstancelD SrePct 3 SrcPct Category SrcPct 4 SrcPct
143. ced an error will be thrown You may get around this by assigning a default value first as in the following example ACmd ACmd Reference Tag Name Initial Value Reference Tag Name if Meta Update 187 User s Guide SAY Software Tool House Inc Arithmetic expressions Cmd Reference Tag Name Geval real exp eval This is a keyword and must be coded exactly as shown This command assigns the value of an arithmetic expression to the Named variable real This is a keyword and must be coded exactly as shown This causes the expression to be evaluated as a floating point real number Value This is an arithmetic expression It can contain references parentheses arithmetic operators and basic functions Normal arithmetic precedence rules apply and can be changed by the use of parentheses The result of the expression is an integer if the real keyword is not coded The interim processing of the expression is done with real numbers and the value is rounded up to the nearest integer With the real keyword there is no rounding The floor function may be used to implement rounding References that result in the value NULL are treated as 0 Please see Using Arithmetic Expressions below for details on the arithmetic operators and functions supported Equivalent Tags Assigning a Tag as another Tag Cmd Reference Tag Name G equ equ This is a keyword and must be coded exactly as shown This
144. cept that instead of supplying a Remedy Table and Query an SQL query is provided and that query is passed through ARS onto the database A single QuerySql statement may be coded in a control section When the ouerysq1 statement is coded Meta Update will issue the supplied query using the ARS API function and for each record returned in that query will e Load that record and associate that data with the supplied tag e Perform any AssignPre section if coded e Perform and Update query if coded and e Apply the assignment sections to create or update a record in the target schema This will result in the same number of new records added to or updated in the target schema as was returned by the query QuerySql amp SrvTag Tag Sec Query The statement has three parts with an optional reference to a read server The Tag is the name that Meta Update will recognise as a reference to the current record in the result set The Sec specifies a section that is used to specify column names and value translations as per a Fields section of a File See below for more information on the Fields section The Sec may be empty or na Both mean the same and there will be no column names and no data value transformations for the record denoted by the Tag In this case the field names are integers much like assignments with the Administrator Tool The first column selected has the name 1 the second 2 and so forth If Sec is
145. ctly after completing any updates but before any launches and the next iteration of the section This is applied whether an error occurred or not AssignPostOk Specifies the assignment sections to be applied directly after completing any updates but before any launches and the next iteration of the section This is applied whether only when an error did not occur in the update or any launches This is applied before the AssignInitPost sections Meta Update 110 User s Guide SAY Software Tool House Inc AssignPostErr Specifies the assignment sections to be applied directly after completing any updates but before any launches and before the next iteration of the section This is applied whether only when an error did occur in either the update or any launches This is applied before the AssignInitPost sections AssignPostLaunch Specifies the assignment sections to be applied directly after all launches are invoked if any but before the next iteration of the section This is applied whether only when an error did occur in either the update or any launches T IdLog statements IdLog Specifies an IdLog file for a set of events and conditions Also specifies the formats and assignments for an IdLog file Operational Statements Sleep s n Optional If coded specifies a number of seconds to pause every n iterations of a section If n is missing it def
146. cur for each Salesltem satisfying the query condition on the ProductCat form Running the Uupdate query during the iteration of the results from the ProductCat form will retrieve the actual Salesltem ID to be updated When you use a File the record you want to update must be loaded from a query You ll need to load the update target record by issuing a query based on data in current record of the rile This query is meant to find the target record ID It must return one and Meta Update 41 User s Guide SJT Software Tool House Inc only one record File ExSrc ExchangeFileDef Update Tgt SHR People Email Address SExSrc email Assign UpdPeople AssignNew AsgNewPeople ExchangeFileDef File d dta ArsTemp exchange dat Type Delimited t FldHdr Here an MS Exchange Post Office extract will be processed Each SHR People record with the same email address as in the extract with changes in the data basing assigned will be updated If there is no SHR People record with the email address one will be created The FldHadr in the file definition section s Type indicates that the first file record contains the field names This is typical in Excel spreadsheets and in Exchange server extracts Output A Meta Update control section can also be used to create output ASCII files either columnar like a CSV for example or text files like emails XML or HTML pages A single
147. d These assignment sections can be used to load records load configuration values validate the environment fire processes and so on Please see the Assignment reference below for more information The Meta Update License may be specified in the Main section of a command file as an alternative to using environment variables or using a form on the server There are two types of licenses Server and Site Site This is the name the Site for a site license It must be specified exactly as was specified when the site license was requested Domain This is the Domain suffix for a site license It must be specified exactly as was specified when the site license was requested License This is the password for either a server or a site license It must be specified exactly as was specified when the license was requested If a site license is being specified both the Site and Domain will be required Meta Update 105 User s Guide SJT Software Tool House Inc Examples Main PrmReq Usage Ge TtId TT ID PplId PPL ID Arg Tera Arg Pplid In the above example in subsequent references the TT ID parameter may be referenced in an assignment statement Xxx Arg TtId Or an expression Xxx if SArg TtId A11 SArg TtId Meta Update 106 User s Guide SAY Software Tool House Inc Read Server Sections Read server sections identify additional ARS Servers that can be que
148. d specified with the output keyword There are only two fields available as an assignment s target field These are String and File Each string assignment specifies a single line of text and is automatically terminated with a new line If only a single String is encountered in an assignment process then the new line is not implied A File specifies an ASCII text file to be read and copied into the target named string or pattern file record Any Meta Update references in the body of the file are resolved 163 User s Guide SAY Software Tool House Inc Assignments The assignment section specifies the Remedy fields to be updated and the values to update those fields with The assignment section can also Load and Loado statements These are processed after the main section s entire Load statements are processed and can use the record loaded by the Query Or File Or Update statement In the assignment section these are processed in the order encountered An assignment section consists of keywords which are Remedy Field de or Database Field Names in the target schema the one being updated or file fields in an output columnar file or the special target field names String and File for output pattern files Field Assignment Value Processing an assignment for the same field twice causes concatenation as in this example It only makes sense for text and diary fields Status Closed
149. d Join loops ignore any sort Tag assignments A String loop sets only a single named value into the Tag Text The text of this iteration s string A Diary loop sets several named values into the Tag Text The text of this iteration s diatry entry User The user value for the entry Date The date the user made the entry Date The date the user made the entry yyyy mm dd hh mm ss DateYmd ge formatted like yyyy mm dd hh mm ss DateMdy ja formatted like mm dd yyyy hh mm ss DateDmy pia formatted like dd mm yyyy hh mm ss DateI e Remedy timestamp value nnnnn A Fields loop sets the named values defined by the info Reference assignment command See page 183 for the complete list into the Tag FieldName The name of the field of this iteration Value The actual value of that field ValueLength The length of the above string A Join loop sets the named values defined by the info Reference assignment command See page 183 for the complete list into the Tag Schema The name of one of the Normal Schemas making up the Join Note that the field values of Qinfo will not be filled in Meta Update 127 User s Guide SJT Software Tool House Inc Examples In the following discussion we describe examples of a Loop statement coded in the Do Loop section of this script Do Query SrcTT HPD HelpDesk 1 SArg IDS Launch Do Loop Do Loop Loop Diary sDiary SrcTT Notes Loop String Tags i SU
150. d by the reserved tag ENv The field name is the environment variable name Environment variables like all other field names are case sensitive Loop String Pth SENV PATHS The above example loops for every directory in the PATH environment variable As another example the environment variable ArsGlobals 5 could be used to load a site specific set of values and keys to other records LoadQ Tag Schema 1 SENV ArsGlobals Meta Update 62 User s Guide SAY Software Tool House Inc The Command Line A Meta Update command at a minimum specifies the Meta Update script and the starting section within that script That script may require arguments and Meta Update accepts built in switches for example to run the debugger or increase logging detail To maintain compatibility there are two forms of Meta Update command lines that can be given The older deprecated command line uses unnamed positional script arguments coded in the order of the script s Arg statements and following a p place marker gt gt gt SthMupd exe 090 SvrAdmin 220 SwLogs ini Do p tstl I terminating successfully in 2 sec The new command line uses named arguments that can be coded in any order before or after the script and section gt gt gt SthMupd exe 090 SvrAdmin 220 SwLogs ini Do log tstl I terminating successfully in 2 sec Either form of the command line may be used on any script Software Tool H
151. d by the trace daemon and all trace clients This environment variable specifies a trace configuration file The environment variable can be set in Windows as a system wide variable Set TrcIni c etc conf SthTre cfg The configuration file must exist It is an ASCII file created with Notepad or vi for example and follows the format rules for a Meta Update command file but with no section names It can have these variables Trace facility configuration file for sth m3 file e etc conf trace ini Environment variable must be defined system wide TrcIni e etc conf trace ini QueueKey etc conf trace ini TraceFile e trce trace GenMax 99 RecMax 500000 TrceLvl dasfp2 TrceTme 30 ErrLog e ltrclerror log ScOpen cmd c trcerrm cmd QueueKey is used on Unix platforms only The message queue is opened using the specified file s i node as the key On Windows this parameter is ignored TraceFile specifies the fully qualified prefix for the trace files The string specified is suffixed with xx where xx is the current open trace file Meta Update 74 User s Guide SAY Software Tool House Inc GenMax specifies the maximum number of trace files to produce Specifying 99 for example would mean that a maximum of 100 files named e tre trace 01 02 99 could exist at the same time After trace 99 is filled up trace 01 will become the current file RecMax specifies the maximum num
152. d sh in the bin directory that contains SthLicUpd exe that bin directory is also the default for finding license files Miscellaneous switches d Specifies full tracing See http www softwaretoolhouse com for the Meta Update User s Guide Prompt mode will find all available lic files in a single directory and ask for any needed information It will then generate a new SthLic cmd or SthLic sh file These files will set the environment variable for ARS server connectivity and authentication which all Meta Update utilities will automatically pick up Meta Update 250 User s Guide A Pk Tool h HR Inc Password mode will simply allow you to encrypt any number of ARS User passwords You can then use these encrypted password strings in any of the Meta Update utilities to authenticate to the ARS server Sample Prompt Session e Administrator CN gt FEN d f SthLicUpd exe Pwd SthLicUpd Version 1 lt c Copyright 1996 26012 by Software Tool House Inc wwn softwaretoolhouse com Enter the password you d like encrypted Use for none Enc JS FUMUE 6GDPG4 BEUTAGC MUCP M Would you like to end this session Y gt Using the generated SthLic cmd or SthLic sh files On Unix the generated file must be set to be executable To do so enter the following command gt chmod X SthLic sh The shell script needs to be Sourced or any changes made to environment variables will
153. d source ticket and the newly created open these sections are called TT Orig Upd This section links the ne Update the original closed TT with the TT on the old one using the Newly Opened TT ID Merge API Query UpdOrig TT TT TroubleTicket vr Meer T dClosed Merge Yes Update UpdoOrig TT Assign TT Orig Upd l TT Orig Upd 1 zTktIdClosedNew Ke Action Log Email received after closure New TT created Action Log New TT 1 Action Log n This section copies all the source emails to the newly created ticket This is a TT Email form Merge is used to Schema eee prevent notifications Query Src_TT E TT Email amp Ticket ID Sre_ TT 1 Update Upd TT E TT Email Ticket ID S New TT 1 AND Date Sent Src TT E Date Sent Assign TT EmailUpd i S Updated TT EmailUpd The newly created ticket id is Merge llowNull SkipPatternMatch assigned and all remaining fields from the old email are copied Ticket ID New TT 1 Cmd Copy Src TT E DupIgnore CoreAssign Meta Update 271 User s Guide SJ Software Tool House Inc The Main section The PrmReg specifies that three arguments are required A better one might be 3 TT Closed Copy ini copies a closed TT to a new unassigned TT usage SthMupd exe TT Closed Copy ini TT Copy p MTT ID sre IdLog where TT ID sre the clo
154. d text for each iteration to a single text file or to create a new output file each iteration and have the contents of that record and of course all variables which could have been a loop of records used in the creation and naming of the new file Fixed format files have fields defined in the script that are always a specified length Transaction files UNIX script output and input files tend to be fixed format Fields can overlap Excel generated CSV files are the most common of delimited files Delimited files have columns that are variable in length and may be null They have a separator character between the column values They can have quotes around the values and if quoted the values can contain embedded carriage returns and line feeds Fields cannot overlap For Output files field values with embedded line feeds may cause some tools such as Excel or the BMC Remedy Import Tool to interpret the line feed as a record end Fields with line feeds can be changed through using the line feed options in field formats The first record of a delimited field can contain the field names as in most Excel generated CSV files For an input file if a field header row is specified and fields are specified in the File Section of the script that defines the file then only those fields that are in the script file are defined and available to the script If a script field is not in the source CSV that field will always have the NULL value Extra
155. d when a field is output to a file row including the IdLog Formats may be used to interpret dates substitute or remove characters handle line feeds handle embedded quotes YYYY Copying Fields from Schemas Fields may also be copied from ARS Schemas A simple Copy command can specify an ARS server and form whose fields will be included in the file Cmd Copy ReadServer Schema NoDisplayOnly Skip field field The ReadServer is optional and refers to a ReadServer Tag The Schema may be a constant or a string expression that evaluates to a Schema name If the keyword NoDiplayonly is specified Display Only fields are not included as part of this file If this is missing all fields are added to the file s field section Skip allows you to specify a list of field names or field de to not include in file Examples Meta Update 147 User s Guide SJT Software Tool House Inc FieldSection ExtraField Cmd AnotherExtraField Or FieldSection ExtraField ACmd AnotherExtraField Field Formats format Copy ITSM6SVR HPD HelpDesk format Copy ITSM6SVR MyVars Schema Any field can have special interpretations applied either in addition to the interpretations applied to all fields in the file or overriding those applied to the whole file Note that field sections used referenced by non files have no global formats applied The format
156. database manipulation at all It cannot bypass workflow Meta Update 18 User s Guide SAY Software Tool House Inc Meta Update Scripting A Meta Update run specifies a script file to run That script can take arguments load configuration records load value translate tables and perform operations on your Remedy data A script file is a sectioned INI file similar to Windows and Linux INI files Data operations and assignments are specified in named sections Control sections Updcpy specify assignment Update the Company Name only in any TT sections where you Use SQL to get the list fields not indexed can assign values to then Load and update the ARS record your fields in a simple QuerySql TT ID Gna amp and feature rich way select instanceid from hpd_help desk where company SArg CpyS or contactcompany SArg Cpy or With Meta Update Ee Mines t rt you have many 1 TT different ARS records HPD Help Desk available that you 179 STT ID 1 can use to make your TT Upd assignments and HPD Help Desk decisions in your 179 STT ID 1 assignments Ee MORES hoe Y TT Upd Meta Update 19 User s Guide Software Tool House Inc A Meta Update script comprises a number of linked together Control Sections Control Sections or work elements This image summarises the basic flow of a Meta Update script s Control Section Assignments Ini
157. date job terminating before processing all records of a query The SthApiRetry string is either a single or multiple sets of three numbers start ARERR number stop ARERR number Retries Delay start_ARERR_number Single or ranges of ARERR numbers can be specified stop_ARERR_number Retries A Retry count of 0 means infinite number of retries Delay The Delay is in seconds A Delay of 0 means no delay The following example illustrates its use to protect against servers crashes and servers that have timed out a set SthApiRetry 90 92 0 60 93 0 30 A export SthApiRetry 90 92 0 60 93 0 30 These examples retry API calls resulting in error 90 91 92 93 retrying an infinite number of times with a 30 second delay on ARERR 93 timeout due to busy server and a 60 second delay for ARERR 90 91 92 Note that for Query timeouts 94 retries will generally not resolve the problem Instead use the TimeOutLong keyword of the Main section fs Meta Update 61 User s Guide SJ Software Tool House Inc License Environment variable SthMupdLic license key If this environment variable is defined the license check is made against the value associated and no read is performed on the ARS server This is primarily used on the server and also in high performance situations AnyVar Value Any environment variable may be used in a Meta Update script All defined environment variables are reference
158. dated in the first command is reloaded and the new section is run with all References available to it So for example the Launched section could use data in the newly created record to fill in linking information in dependent records Meta Update 24 User s Guide Definitions References Iteration Query QuerySql File Loop Assignments Meta Update SAY Software Tool House Inc References are the key to the power and ease of Meta Update scripting In ARS references are a form s field name or id between dollar signs Only a single form and record may be so referenced Within a Meta Update you have many different records in memory at the same time Each record is identified by a Tag that you chose So references comprise two parts Tag Field Meta Update lets you execute a script command once or iterate though a sequence of records Each iteration can load records make assignments produce output and launch other commands Allows you to iterate through the results of an ARS query specified as per the Advanced Query Bar in the BMC User Tool Of course the full power of Meta Update references is available to your query Similarly you can issue a direct SQL query through the ARS API iterating through the resulting rows and naming interpreting transforming the resulting columns Any type of columnar file can be iterated through Values can be transformed or interpreted CSV s that Excel or
159. e 179 regex can be referenced as Tag NameS Value Format SrcTag SrcFld Value Sec is an assignment section where fields are assigned to this Tag info assigns a set of fields to describe SrcTag SrcFlds date assigns a set of fields to describe a single date value arguments lar expression applied against a target string Value rc stdout stderr arguments User s Guide S z H Software Tool House Inc Single value to a Tag string reference Cmd Reference Tag Name Cmd Reference Tag Name Cmd Reference Tag Name Cmd Reference Tag Name Cmd Reference Tag Name Cmd Reference Tag Name Cmd Reference Tag Name Cmd Reference Tag Name Value val SrcTag SrcFld LookUp CLEC ua Section eval real Value fmt out Value Format fimtqry Value SrcTag Each of the above forms can be used to yield a single string variable being set with a value Value Meta Update ScriptFx SCTL PidS inp txt SrcTag SrcFld Cmd Reference Tag Name Value In this simplest form the Tag Name reference is assigned the dereferenced Value text as specified in the reference command For example Cmd Ref K False This will cause references like k Falses to return O Or Cmd Ref K Ftmp Nme SENV tmp S CTL This create a temporary file name in the form C DOCUME 1 ADMINI 1 LOCALS 1 Tem
160. e SHpdSrc Type S HpdSrc Items Meta Update 208 Qh Category amp User s Guide SAY Software Tool House Inc A File if coded is read once and only once on its first use by a LookUp reference That initial file read creates a list of sorted value pairs according to the Source and Target keywords Subsequent LookUp statements using the same LookUp section simply search this cached list Using a Query LookUp sections can also use ARS queries to build the translate string In this way a LookUp acts like a Load that is allowed to fail The record if found is made available to the rest of the script under the Query Tag specified in the ouery statement After a LookUp assignment CTL LookUp can be used to determine if the Query was satisfied or a default or other list was used A string reference using fields of the LookUp record found is used to build the return string The Schema for the query may be a string reference In this way the same LookUp section may be used for different schemas Similar to ARS if multiple records match you may throw an error the default or select the first record You may use the optional Sort in your Query To use an ARS query add the Query keyword to the LookUp section When you use the Query keyword all other file related keywords are also required A list of value pairs within the LookUp section will override or be overridden by the list from the external file
161. e 58 User s Guide SAY Software Tool House Inc The License Key You need a license key to run Meta Update Please see Licensing below for more information on licensing Meta Update and obtaining License Keys You can tell Meta Update the license key in one of three ways gt Code it in the script itself gt Set an environment variable with it as done with SthLic cmd and in the samples gt Set it in a special form and record on the target ARS server In the latter case the STH License form must have a valid licence key This form needs to be on the Script s Target ARS server In the first two cases the overhead of an extraneous Query and Get from the Remedy ARS server will have been avoided The environment variable to be set is SthMupdLic In the script you can specify License in the Main section A utility is used to generate an SthLic cmd Windows batch file or SthLic sh bash shell script This is a convenient way to set licensing server and authentication parameters It also allows ARS User passwords to be encrypted See SthLicUpd Maintenance Utility below Meta Update 59 User s Guide SJT Software Tool House Inc Environment Variables Both Meta Update and the BMC Remedy API can be affected by using Environment Variables This section defines the Meta Update environment variables and the values and behaviours associated with them BMC Remedy documentation is the accurate source for documentation on
162. e it is possible that the real file name that is the source of a file to be attached is not equal to the file name desired in the ARS data Consider the case where Meta Update is running on a server and the file needs be opened on the client In Meta Update attachment field values can be specified as a string as two strings oras a reference to another attachment field Or the three forms of an attachment assignment are 1 Att Fld attachment file name os file name 2 Att Fld attachment amp os file name 3 Att Fld Ta field This example is introduced and discussed below The three different forms of an attachment value are specified 1 Att Fld NC NtmpiVlogos jpg C temp attach 1 dta 2 Att Fld C tmp logos jpg 3 Att Fld Src AttFld For 1 Ifthe file c temp attach 1 dta exists and is readable and for 2 if the file c tmp logos jpg exists and is readable and for 3 ifthe reference Src AttFld is a loaded ARS record with an attachment field containing C tmp logos jpg then the three statements above are almost equivalent and result in an attachment named C tmp logos jpg being assigned to the target attachment field For the three statements these files need to exist 1 C temp attach 1 dta 2 C tmp logos jpg 3 none When an attachment field is assigned the contents of another ARS attachment value through a reference as in example 3 above the attachment value itself is retrieved result
163. e Command EE 173 Abort COMMA Dmae E E E A E E T 174 AttachSave Command niccccaccccsccerenceccncttececeesscevcaceeecedncercevesstesceuenexucteeececdecnnsroecee cave 174 Mo COMMA raa ar EE 175 Spawn COMIN E 175 Reference Command sisenta eege EES EEN 176 Using Regular Expressions srernnnnnvnnnnnnnvnnnnnnnvnnnnnnnvnnnnnnnvennnnnnvennnnnnvennnnnnvennnnnneenennn 191 Using Arithmetic Expressions rrnnssvvnnnnnnvennnnnnvnnnnnnnvnnnnnnnvennnnnnvennnnnnvennnnnnvennnnnneenennn 193 Set Schema Command rrnnvnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnennnnnnnnnnnnnnnnnnnnr 196 Trace eu ul EE 197 LOOKUP Sectionssuuddnu ata 199 OVerVvIeW ud 199 LookUp Types ee 199 Automatic Tags ewe ea ea a Re ov so SS a pat SB aS So aoe 200 Keywords aus ska 201 Using el see 205 Usinga Query usa 209 Using n SQL e TEE 210 Caching LookUp Records EE 213 Using different LookUp LiStS rrnnnnvvnnnnnnvonnnnnnvnnnnnnnvennnnnnvennnnnnvennnnnnvennnnnnvennnnnnvennnnn 213 Field Type Notes asi ciia2 ccc ecec eves cate ceeeesendeneuesesenue cutee ENEE EES ENEE EECH 215 Diay Field EE SE SE EE 216 Currency Kielener E 217 NUmeri E TE 218 Enum or Selection Field rrnsvrnnnvnnnnnvnnnnnnnnnvnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnennnnnnnnnnnnnnnennnnr 219 Date iG EEE EE Eege 220 Date Time Fields EE deeg 221 Attachment Fields sc EE A aE 224 Predefined Reference Tags rssrnnnnnnnvnnnnnnnvnnnnnnnvennnnnnvennnnnnvnnnnnnnvennnnnnnennnnnneennnnnnvennnn
164. e directory at the root The single directory is called Mupd x xx where Mupd X xx is the Meta Update release This allows you to test different versions and APIs of Meta Update easily This directory contains directories and files that is the Meta Update distribution Directory Contents docs This directory contains the Meta Update user manual and the Trace Facility Administration Guide These are distributed as two PDF files samples Contains sample Meta Update scripts and a sample Trace configuration file bin Contains all required binaries exe and libraries d for Meta Update and bundled utilities This is the 32 bit path It is the only path that can be used on computers that have a 32 bit architecture For computers with 64 bit architectures Software Tool House recommends that the 64 bit binaries be used See below for the bin64 directory It is recommended that this path be added to the system Environment Variables for use by a Server and in the User s Environment Variables for workstations bin64 This contains the x64 bit versions of binaries exe and libraries dll for Meta Update and bundled utilities This can only be used on x64 architectures It is recommended that this path be added to the system Environment Variables for use by a Server and in the User s Environment Variables for workstations The Meta Update distribution includes a bin and bin64 directory C Program Files SoftwareTool
165. e file type is Pattern MultiFile the FileName is re evaluated each time that output is processed and a new file rather than a new record is created It is possible to open multiple CSV files with a single output statement When a section is Launched with an Output statement the file name and tag is evaluated If both are unique a new file is opened If a tag was used before the file name must match the name opened when that tag was used before If so a new row is appended to the file If not an error is thrown Meta Update 135 User s Guide SJT Software Tool House Inc The sample script Tbl All Bkp ini uses this feature to produce different CSV files for a set of different tables using the same Output statement Do QuerySql Tbl SqlFlds A list of tables are select name viewname schemaid amp returned from the first from arschema amp QuerySql on where SArg sch qry arschema Do2 Launch Do2 For each table a Query Query Src Tbl name 1 1 is run returning all Output STbl viewnames Out f records and anew D E Arg F out Tbl viewname csv output CSV is created gr Z SCH That file contains a asg column for each field in Cmd Copy Src the table Out f This declares the output CSV file All fields from the schema are copied to the CSV Type Delimited FldHdr Format Quoted always Quotes escape LI escap Fields
166. e handled by a single copy command The file s fields are also copied from the passed table name Do will Launch Sv Att Struct once only Sv Att Struct creates a second CSV containing a list of all the Attachment fields Field Names and IDs If there are no attachment fields the CSV is not created The single Launch is controlled by the script variable v Firsts which is initialized to TRUE and set to FALSE by an AssignInit in Sv Att Struct If there are any attachment fields the CSV is created and a variable is set to indicate that there are attachments that should be saved Do will Launch Sv Att each record it processes if there are any attachment fields in the table This is controlled by the SV gotAtt script variable which was set by Sv Att Struct Sv Att iterates through all non null attachment fields in the Src record So for any single record it may iterate zero or more times Sv Att has no record or file output so all work is done in an AssignPre section which is called after the Loop s Tag is assigned on each iteration The assignment is a simple AttachmentSave command issued to save the attachment to the file system The file is named as follows prefix ReqId FieldId att Prefix is passed on the command line Reqld is the request id field with any characters from Join forms translated to This is done through a simple regular expression used for the side effect of allowing
167. e last keyword on the command Keywords for Copy commands SrecTag DupAppend DupOverwrite DupIgnore MismatchIgnore MismatchWarn MismatchError CoreAssign NoCoreAssign Meta Update Specifies the source reference tag This can be a string reference which must evaluate to a defined tag This Tag can be a loaded Remedy record a loaded File record or a String Tag Only fields with the same lds if both the source and target are Remedy records names and types can be copied Options indicate what to do on mismatches You can also override the copy of some fields by making explicit assignments to those fields ahead of the copy command and selecting the default option DupIgnore If a field already has been assigned a value this will cause the copied value to be appended to the current value if possible This is only possible for character and diary fields If a field already has been assigned this will take the value in the copy source record If a field already has been assigned this will ignore the value in the copy source record If not specified DupIgnore is taken as a default When comparing the source schema to the target schema this will ignore any mismatched fields When comparing the source schema to the target schema this will ignore any mismatched fields and issue a warning message When comparing the source schema to the target schema any mismatched fields will cause an error and the as
168. e password for the above user Code if there is no password Use the operating system security to prevent unauthorised access to the file This may also be a string reference such as in the default value ENV ArsPwd The ARS User Password may be encrypted If so it begins with Enc Password encryption is handled by a separate utility SthLicUpd This utility is used to both generate the SthLic cmd file and to encrypt ARS User passwords Meta Update 102 User s Guide SAY Software Tool House Inc Port This is generally not specified It is required if the ARS server does not use Port Mapper Simply code the port that the ARS server uses Note that if the environment variable ARTCPPORT is set this setting is ignored This is documented in the ARS manuals This may be a string reference Setting this to zero 0 has the same effect as not specifying it at all RPC This is generally not specified It is required if the Meta Update process is to use a private queue on the ARS Server Simply code the RPC program number that the ARS server has been configured to use for Meta Update Note that if the environment variable ARRPC is set this setting is ignored This is documented in the ARS manuals This may be a string reference This ARS server must be licensed for Meta Update use Records will be updated on this server Other servers may be read from These are called ReadServers These do not need lice
169. e server and authentication parameters for the update server 5 Establish the server and authentication parameters to the source server through the ReadServers keyword The value of that keyword is a section name which like the Main section gives server and authentication parameters for addition servers Note the Tag keyword in the Main Prod section Queries will use this tag Prod to reference the addition server The Called Command Section The SvrSync Date section is specified on the command line and is the script entry point The rile keyword says we will iterate through a columnar file The Fle Tb1 section specifies the attributes and fields of the file Row one of the file contains the field names and must match the fields specified in the CSV Meta Update 276 User s Guide SJT Software Tool House Inc The assignPre allows us to build the select SQL query for the modified date using the fields as specified in the file row and the optional query text also specified in the file row The first assignment of asg Mk Ory makes the modification date query text for the SQL statement using the modification field name specified in the CSV file for this table and the time argument passed on the command line This is set in tag Vars field Qry If the CSV query text was non null the same string is appended with and using the supplied query text Now that the SQL query string has been made the sect
170. eSchema is Vendor VendorName string Vendor name identifies the a plugin supplying the table VendorTable string Vendor Table is selected when defining the table to ARS KeyZeroFill bool Set false only if the schema has 1 defined max length of field 1 as 0 Meta Update 183 User s Guide SJT Software Tool House Inc KeyLen KeyPfx KeyPfxLen ArchEnable ArchType ArchDelete ArchName ArchNoAttach ArchNoDiary FieldTypelInt FieldType FieldId FieldName FieldLabel FieldDisplayOnl y FieldRequired FieldMaxLength Value ValueLength Meta Update integer string integer bool string bool string bool bool integer Integer Real Char Diary Enum Time Bitmask Bytes Decimal Attach Currency Date Time_of_day Join Trim Control Table Column Page Page_holder Attach_pool Ulong Coords View Display integer string string bool bool integer string integer Length of the request id field 1 almost always 15 The initial value of the request id field Acts as a prefix to an integer Length of the request id field s initial value or prefix Archiving enabled One of None Form Delete Form amp Delete XML ARX The Archive Type has the Delete flag on The Archive Form Name The No Attachments option The No Diary Fields option ARS field type integer ARS field type as a string ARS field ID Field name ARS defa
171. eak to manage your script s breakpoints With Break you can set list or clear script breakpoints Mupd Dbg gt h break The Break command allows you se t clear and list Break Points Break Points allow your Meta Update to proceed until you reach an area of the script you want A Break Point to examine in the Meta Update sense is a section name and a Section s Event Type Even Iteration Query is loaded or t Types are things like before an after a new Iteration record is read The Break command allows you set clear and list Break Points b Break Manage Breakpoints bs Break Set Set a Breakpoint bl Break List List Breakpoints be Break Clear Clear Breakpoints bs Break Set Set a Breakpoint bs line Will set an Assignment break point to the line specified bs section type section is a section name in the script type is one of Init when a section is starting up Term when a section is completing IterInit before an iteration query is run IterNext before an iteration record is loaded IterTerm after the last iteration record is completed Launch before each Launch is evaluated Asg at an assignment section must be set with bs line Examples bs 42 breaks when line 42 is encountered whil processing an assignment section bs Do IterInit breaks just before an iteration Query is run bs Do IterNext breaks just after each iteration tag is loaded bs Do Launch breaks just before each Launch of t
172. ection a source string That source string is then matched against the source left side of that list of pairs and if found the corresponding target right side of that pair of strings is returned An example G re Statuss is me EE matched against a list ssignment section f rce values Status LookUp Lkup Status S Src Statuss of Sou Lkup Status Status is assigned the New Open tchi T t Cancel Closed matching larget value If the source string as specified by Src Status is New then Open is returned and will be assigned to the Status field or the script variable V New Status A LookUp can also be used to load ARS records or SQL rows by issuing queries the Remedy These records are then used to create the returned target string and are also available to the script LookUp Types A LookUp can translate a source string into a target string through one or more of these sources gt A list of value pairs in the LookUp section Val Val 2 LookUp Val LookUp Val 2 gt An external file such as a CSV or any columnar file Fld 1 Fld 2 Fld 3 Fld 4 Val 1 1 Val 1 2 Val 1 3 Val 1 4 Val 2 1 Val 2 2 Val 2 3 Val 2 4 Val 3 1 Val 3 2 Val 3 3 Val 3 4 The first time a LookUp that uses an external file is used the file is read and a list of source and target pairs is generated from the values in the file When the same Meta Update 199 User s Guide SAY Software Tool House Inc Look
173. ed only when the file is closed Output controlling statements UpdateIfEqual Specifies whether to continue with an update when no field values have been changed Merge Indicates whether a Merge operation is desired and specifies the Merge options desired Ignored if the output is not an ARS record MaxOutput Limits the number of outputs for this control section to a specified maximum Any single record Updates Creates File writes is considered in this maximum The default is 0 which means unlimited This is useful during development of scripts that return large query results or process large files Note that when coded in the Main section any run of this section is limited to the lesser of the two numbers Launch statement Launch Specifies a set of Control sections to be fired for each record updated in this operation May be conditional Used to Nest operations Assignment section statements AssignInit Specifies the assignment sections to be applied before processing begins for the section AssignTerm Specifies the assignment sections to be applied after processing ends for the section and the section is about to be closed AssignPre Specifies the assignment sections to be applied directly after loading the section s record This is applied before any subsequent Loads Updates or Assignments AssignPost Specifies the assignment sections to be applied dire
174. ed ticket This ticket replicator creates a new ticket with the salient data from the old ticket assigning it to the last group that closed the old ticket replicating all emails and other associated records and finally linking the two tickets together for the GUI button This script demonstrates launching other sections so that multiple tables are processed 255 User s Guide SJT Software Tool House Inc Server data extract A single customer has many locations people services etc This script is used to copy a single Real Customer customer s data from production to development Problem for a single developer replacing any customer contact information with the developer s information Development time This was used in a large development team of a three hours bespoke telecoms client to facilitate development and testing Server delta copy A simple script copying all changed records from one server to another say a read only reporting server Development time one hour Demonstrates using Read Servers QuerySa Merge Query Update the Copy assignment command Meta Update 256 User s Guide Cie Software Tool House Inc Meta Update 257 User s Guide SJ Software Tool House Inc AR Schema Report This simple script outputs a CSV containing the tables defined an ARS server and well as the number of records they have for regular and join tables by querying and processing the arschema ta
175. ed utilities with different names One is used for local tracing and the other includes tracing through a trace server These programs have different names They are the same name in all operating systems SthMupd exe Local trace version SthMupdTrc exe Trace server version Logging is controlled by the Meta Update d switch in the same way across versions See The Command Line below for more information on the d switch The local trace version always appends to a file named SthMupd log in the current directory unless the trace file is named with the d switch With the Trace server version traces are sent to the trace server The trace server is administered to record selected levels of traces and discard other levels The trace server version needs both the d switch and the trace daemon set correctly for debugging traces to be captured The trace server must be running on the same machine as Meta Update Communication to the trace server is with the standard message queue facility under Unix or with Named Pipes under Windows If the Trace Server version of Meta Update is run and the trace server is not started Meta Update will act as though the local trace version was run That is a file named SthMupd log in the current directory is appended to unless the trace file is named with the d switch More information can be found on the Trace facility in Server Tracing below and the document The Common Trace facility Meta Updat
176. eeeeeeeeee 38 Iteration Concepts nernrrrnnvnnnvrnnvnrnnnnrnnsnrnnnnrenen 38 Beie A wats sass csceshicdinneste enskrid 210 QuerySal statement Select field variable oonrrrnrnnenvnnennr 122 QueryStart with Query mrenerrrvsnrnrnvrnnrrnenrnrsnrnernrenen 121 Quit Debugging Commande 90 R Random Numbers in Reference Assignment Commands 195 Seeding for Arithmetic Expressions 195 Ref Assignment Commande 176 Reference Assignment Commande 176 References CONCEPTS rrnnnnrononvnnonvnnenrrennvnnervrnsnnnnennre 22 defined in Concerts 28 Sjal REE 28 SING WEE 29 References String defined WEE 30 Regular Expressions Assignment Commands ervrnnvnnnvnnnrnnn 189 Return Values rarnvrnnnnnnvvrnnnnnnvrnnnrnnnnnn 67 Run Time Environment 56 BUUT e BEE 55 API Versions nrnnnnrnnonrnnnnrensnrnnnnrnnsnrnennre 56 ARS Client Tracimg 71 Environment for Meia Update 01000a1a 55 Firing from Workflow seene 77 Local Tracing 72 LOG la e E cesesteectutets desse 65 Log lt 75 Logging E 70 71 Logging ARS Client 71 Logging Locally s e 72 Logging Gerver 73 Meta Update Arguments seeeseeeee 65 66 Meta Update Environment Variables 60 61 Meta Update 295 SJT Software Tool House Inc Program Output 68 Return Valesi 67 Server Tracing ceccceeeceeeseeeeeeeeeseeeeseereaes 73 stdout amp stderr AA 67 elen WEE 70 Tracing Format 75 Be leie We EE 72 Tracing Server
177. eir backed up values skipping any fields that have already been assigned a value Meta Update 286 User s Guide Cie Software Tool House Inc Meta Update script Meta Update sample script file Meta Update is copyright 1996 2011 by Software Tool House Inc File LdTbl ini Part of the sample scripts for Meta Update wo scripts used to save and restore any ARS tables data This is the Load script See SvTbl ini for the backup script This Load script will process the CSV files generated by the save script and load all records including any attachments Main gives sign on info and declares Script arguments Server ENV ArsSvr PrmReq r LdTbl ini Do p tbl outp ArgNm schema Before we can proceed with loading the data file we ll need a list of Attachment fields so that we can assign them as needed So here the AssignInit figures out if the attachment fields CSV exists then launches Do Att Flds to save attachment fields in script variables and finally launch the Do Load section to process the backup data file against the ARS table The Assignlnit sectio AssignInit asg I asg I sets Va Dp to Launch if SVa DoS Do Att Flds true if the Attachment Fields Do Load CSV exists in the expected location Launch asg I This initial assignment section sets Va DoS to the existence of the SArg F inp att csv file and makes a few initializations Input Tags Arg
178. endndananemdd endene nn demmde sanden anne EEN 150 Numeric Field S anersnsnsnenien ga dendnenndnndddnnnmmdnn EE EEENE KEEN 152 Quotes in Field Value S si idaan aaua edda aa 153 Meta Update 5 User s Guide SAY Software Tool House Inc Assignment Reference mmm ss rrrnnsvennnannvennnnnnvennnnnnnennnnnnnnnnnnnnnennnnnnnennnnnnnennnnnnnennnnnnnnnnnnnnennnnnnenn 157 About Assignment Sections rrserrnnvvnnnnvnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 158 Using Assignment Sections rrnnvrnnnnvnnnnvnnnnvvnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnennnnnnnnnnnnnnnnnnnnn 160 Assignment Target srennnsnnvennnnnnvennnnnnvnnnnnnnvennnnnnnennnnnnnennnnnnennnnnnnnennnnnnnennnnnnnennnnnnnennnnnnenn 162 Section Target Ty POs as cacecciacccestsccceccven cece stseetcecwennevestieszeneecenedecuterasecacenedesesceesecuesneceettecees 163 ASSIQNMOING secre 164 Conditional Assignment rrnnnvnnnnnvnnnnvnnnnvnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnenn 165 ETE EE EENS 167 LookUp Aesidptente eeeeEEuEeSESEEE SEENEN cecensnceccecceececeeueseeceeusecenenensecuecess 168 Assignment CommandS rnnnvrnnnnvnnnnnnnnnvnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 169 Assignment CommandSe mmssrnnannnnnnvnnnnnvnnnnnnnnnnnnnnnvennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 170 Ile e ul Uu d a a eme araara aeea aaa ee re aaa a E aeaa aaa ea aaa Aea aaraa He AAAA aae SEEE 170 Includ
179. eness The following named constants are available e log2e log10e In2 In10 e 2 718282 log2 e 1 442695 log 10 e 0 434294 In 2 0 693147 In 10 2 302585 pi 3 141593 pi 2 1 570796 pi 4 0 785398 1 pi 0 318310 2 pi 0 636620 2 sqrt pi 1 128379 sqrt 2 1 414214 sqrt 1 2 0 707107 The following elementary functions are available abs x sqrt x rand x floor x ciel x exp x log x sin x asin x cos x acos x tan x atan x cot x acot x sec x asec X CSC X acsc x sinh x asinh x cosh x acosh x tanh x atanh x coth x Meta Update absolute value of x square root if x a random number between 0 and x returns nearest integer value for x returns smallest integer value that is greater than or equal to x exponential of x logarithm of x sine of x where x is in radians inverse sine of x cosine of x inverse cosine of x tangent of x inverse tangent of x cotangent of x inverse cotangent of x secant of x equivalent to 1 cos x inverse secant of x cosecant of x inverse cosecant of x hyperbolic sine of x inverse hyperbolic sine of x hyperbolic cosine of x inverse hyperbolic cosine of x hyperbolic tangent of x inverse hyperbolic tangent of x hyperbolic cotangent of x 194 User s Guide SAY Software Tool House Inc acoth x inverse hyperbolic cotangent of x sech x hyperbolic secant of x asech x inverse hyperbolic secant of x csch x hyperbolic cosec
180. ent sections specified in the AssignNew keyword these are taken and a new record is created If there are no AssignNew sections no new records will be created No error is thrown The Update Tag is automatically loaded with a new copy of the update record after the update is done This cannot be done on Join forms A Warning is issued if the Update form is a join form and the Update Tag will be undefined You can use an AssignPost section to reload the Tag yourself in the case of Join forms The Schema is a form name and may be a reference The Query is any valid Remedy Query Update Tag Schema Query If a section wants to update a Tag that is already loaded as a result of a Query a LookUp or a LoadQ then the Tag may be specified alone in an Update statement Update Tag The Tag must have been previously loaded and must be a Remedy record Meta Update 133 User s Guide SJT Software Tool House Inc Consider this example Do Query Hpd HPD Help Desk Query AssignPre Do asgPre Launch if SV gotPplAsg Do Asgee Loads PplAsg witha record from Do asgPre CTM People Cmd Ref V gotPplAsg LookUp Lkp Ppl Asg SHpd Assigyfe Do Asgee We update the Loaded Update PplAsg CTM People record Lkp Pp1l Asg held in Pp1Asg the given a person s ID load CTM People rec int PplAsg update record PplAsg Cache 100 data is replaced with the
181. ent statement in an assignment section can be stepped through one at a time When specifying an assignment breakpoint you simply specify the script s line number that you wish to break at before its assignment is processed Note that when you set the breakpoint Meta Update does not check that the specified line number is in an assignment section Use the List command to verify your line numbers It is not possible to set breakpoints in lookup sections or file sections A normal begging session begins with setting various breakpoints and then continuing execution until one of those breakpoints is reached Meta Update 86 User s Guide SJT Software Tool House Inc Debug Commands This table lists the Meta Update debug commands Command Abbreviation Notes Help h Displays Help about commands List 1 List script source Listfiles 1f List script source files BackTrace bt Print a Launch back trace Print P Print tag set or single string Next n Execute Next statement Continue c Continue execution until Break Point Quit q Quit job execution Break b Manage Break Points List Use List to print your scripts source lines or sections Mupd Dbg gt help list The List command allows you to display your Meta Update script s Source lines 1 List Lists up to 25 source script lines List nnn starting at line nnn List nnn mmm starting in file nnn line mmm List nnn mmm same as above List list section names and line num
182. ents is processed but after the Query or File record is loaded and a Status message is processed If a section is launched and has no Query or File then this will have the same effect as an Assigninit 116 User s Guide SAY Software Tool House Inc Specifies the name s of the assignment section s to be applied after an iteration of the command section is complete That is after the update is done and all launches have completed These assignments are applied only if the update and all launches succeeded They are applied before any AssignPost or AssignTerm assignments AssignPostErr Specifies the name s of the assignment section s to be applied after an iteration of the command section has complete with an error These assignments are applied only if the update fails or any of the launches fail They are applied before any AssignPost or AssignTerm assignments AssignPost Specifies the name s of the assignment section s to be applied after an iteration of the command section has completed either successfully or in error These assignments are applied before the next iteration of the section They are applied before any AssignTerm assignments Load Statements Load statements cause a record to be read from the ARS server and associated with the Tag given They may be coded in the control section or in an assignment section A load statements specifies a query to be performed that will return exactly one record to lo
183. er Q Default Requester else Req SHR People Login endif endif Default Requester Assignment of data from loaded Requester record Req 1 Req e Assign either Default or the supplied values Category W Default amp SArg Category Only make this assignment if if SArg Type W a value was supplied Default amp SArg Type if SArg Item W Default SArg Item Type Gif Arg AsgGrp Arg AsgGrp jes wiry Assignment Group The Category Type and Item assignments are simply based on the passed arguments on an individual basis To make similar assignments on a hierarchical basis simply use this segment instead or the three individual Category Type Item assignments above Meta Update 265 User s Guide S z H Software Tool House Inc Cmd Category Cmd Category Cmd Type Cmd Type Cmd Item Cmd Item Cmd ACmd ACmd if SArg w Wi Category Default else Arg Category if SArg Type Default else Arg Type if SArg Item else Arg endif w my Item DI Item endif endif The PrmReq can be used to specify usage information as well as the required number of arguments The usage information is delivered when an insufficient number of arguments is supplied on the command line Note that passing a nu
184. ere is size limit on the query itself QuerySql SvrTag Tag FieldSec Query Optional A single Loop statement is allowed Loops can go through Diary fields assigning various fields from the Diary entry to the tag gt Delimited Strings assigning the single string to the tag gt Fields of a schema or tag assigning information and value fields to the tag gt Forms making up a Join assigning form information to the tag gt Ae long as a while condition is true not using a tag at all These values are loaded one by one and the assignment sections are applied to a new or retrieved update record As many records as there are values in the passed string or diary field value are produced for the target schema If the string or diary field value is null no records will be produced Loop Diary Tag Reverse Forward Reference Loop String Tag seperator amp Reverse Forward amp Reference Loop Fields Tag Source Tag Loop Join Tag Form Name Loop While condition Indicates that a Merge operation is desired and specifies the Merge options desired Note that a Merge operation is different than a Submit or Update A Merge is what the arimport facility uses On Merges 1 only workflow set on Merge will be fired unless the NoFilters option is specified 2 Core fields can be assigned or updated including the ID field 3 Diary fields can be replaced completely with
185. ese commands h Help Displays Help about commands bt BackTrace Print a Launch backtrace p Print Print tag set or single string s Step Execute next statement so StepOut Execute until section end n Next Execute Next statement c Continue Continue execution until Break Point b Break anage Break Points 1l List List script source 1f Listfiles List included script files q Quit Quit job execution Enter help command for more Help on these commands at bp 2 asg I In 37 Asg Mupd Dbg gt go Meta Update 84 User s Guide SAY Software Tool House Inc Meta Update Line Numbers The include directive allows a single Meta Update script to include other script files The format of Line Numbers displayed and used as input in the Meta Update debugger is changed as a result There are two formats of line numbers when a script uses the include directive gt A single combined line number gt A file specific line number comprising the file index and line number within that file The combined number can be used as input and is listed along with the file specific number when listing source lines It is the line number of the file that results when all include directives are resolved The file specific number consists of two parts the file index and that file s line number not taking into consideration any other files The ListFiles command will list all source files and their indexes Meta Update
186. ess ID The hexadecimal upper case process ID The Schema being updated The CTL Schema transposed into a simple file name containing no special characters Note that it is not possible for two similar schema names to be transposed into the same file name Each special character is translated into an underscore This is generally also the database view name automatically created by ARS 6 and above Exceptions would be some specific tables that are SQL keywords like USER and tables beginning with numbers One of Update Create The ID for the record being updated or when creating The following tags are section based That is a different tag exists for each launched section The tag name is the prefix cTL and the section name For example the section DoFileImp will automatically define the reference cTL DoFileImp This reference will be available in that section and any sections launched from that section When that section completes the symbol will no longer be defined CTL Sec Rec The current record being processed within a query or file Null the empty string if not processing a File or Query Some tags are only defined when appropriate For example the Record counters count records in either a query or a file A file cannot reasonably have a maximum defined so that counter is unavailable Meta Update 227 User s Guide SAY Software Tool House Inc Arg Program Arguments The Arg
187. f sequence between applications but will never be out of sequence for any one instance of an application Note also that a single application may have two instances running concurrently Meta Update 755 User s Guide SVT Software Tool House Inc The f is the highest priority TrcLvl value on the Trc call that sent this trace message Values are as follows S Severe Severe error F Error Error W Warn Warning A All Always like info but never masked out R Run Run execution instance Script Processing These are on by default but may be turned off I Info Informational on by default Script Debugging These ar choed when selected with the d Q Ory ArQuery Sql all query strings G Get ArGet all ArRecGet ids U Put ArPut all ArRecPut ids etc Debugging settings These are never echoed Caution These generate masses of logs and can affect performance F Func Function entry and exit d Dog Debugging detailed debugging 2 Dbg2 Debugging lvl 2 more details yet a Data Data data values records fields S Struct Structure data Structures The Opid is the process identifier in hexadecimal of the process that generated the trace message This number can be used to select the trace records for a specific instance of a specific application The Prog is the program name coded on the application s Trclnit call Each application that uses the trace facility should document its use of the facility in its User s Guide You can use
188. fer Size Width and Height In addition we highly recommend that Cygwin be installed and Meta Update script developers become familiar with it There are numerous utilities that are especially useful for handling large log files Cygwin provides open source UNIX like utilities and shells for Windows It is available at www cygwin com Meta Update 70 User s Guide SAY Software Tool House Inc Tracing Tracing can be controlled through the use of the d switch When a d is specified with no additional options full Meta Update tracing is turned on With a no ARS client tracing is turned on With full tracing a great deal of data is generated Without a only a very few messages will be traced Tracing levels for both Meta Update and ARS can be specified with the d switch options d fpd2as fsap file The first set of letters specifies the Meta Update tracing levels A comma is used to separate the Meta Update levels and the ARS levels The second set of letters specifies the ARS client tracing level A further comma separates these levels from a specific trace file name If a full tracing switch is specified further switches may be specified as the next set of parameters For Meta Update tracing the levels are specified with a single case sensitive character as follows S Severe Severe error F Error Error W Warn Warning A All Always like info but never masked o
189. field format Numeric Field H Subst Meta Update 152 User s Guide SAY Software Tool House Inc Quotes in Field Values CSV files are generally defined by these rules Values are separated by commas All lines are terminated by a lt If gt or lt cr gt lt If gt combination Spaces are considered significant Values containing a comma must be quoted with the double quote character Values containing a double quote character escape that character with another quote Meta Update extends these rules on reading to permit several types of common flaws found in CSV files no matter how generated It allows you to specify a different quote and separator character In addition with Meta Update fields can have embedded new lines These types of files are difficult to use with the standard tools such as the ARS Import tool and Microsoft Excel Finally Meta Update can allow some values with embedded un escaped or un doubled double quotes Consider these CSV records a b c some text some more text with a new line This is really a single record that is commonly generated from database extracts Consider this record similar to the above but with a field containing a single double quote character a b c some text some more text with a new line Meta Update will handle this by establishing the value for the fifth field as some more text n with a new line Consider these CSV records
190. flag to false Do WL asgPre Cmd Ref V gotIncWL LookUp Lkp Inc WL SWL 179 Cmd if V gotIncWL Ref V Do 0 Meta Update 132 User s Guide SAY Software Tool House Inc Update Statement A single Update statement may be coded in the control section if Meta Update is to update existing records in the target form or create records if the specified Update query returns no records There are two forms of the Update statement In the first form a query is performed to determine the update record or determine that a new record needs to be created In the second form the update record has already been loaded into a Tag No Query is needed and no creates are possible An ARS Query selects the update record Updat Tag Schema Q SE ee De The update record is already loaded If Meta Update is to always create new records without issuing any query use Create instead of Update All loads in the control section are processed before the Update is processed Any iteration statement Query QuerySql File Of Loop is processed before the Update The assignments sections which will set the fields of the Update record are specified by Assign and AssignNew keywords When all assignments are done the record is updated on the server The Update statement issues the ARS query to load the Tag If the query returns no records no Tag is loaded If and only if there is a list of assignm
191. fld Targets of Copy commands The Copy command can be used in assignment sections for the following targets ARS records File records String patterns ACmd String Tags ACmd Defaults Meta Update in assignment section called from Update or Create command sections or from Reference ars commands called from other assignment sections in assignment sections called from command sections containing an Output for a columnar file delimited or fixed in assignment sections for an output pattern file or the assignment reference command Reference Tag Var Sec A copy command in Sec will iterate though all fields from the source tag building a single string based on the supplied Ptn value required through the use of the assignment command Reference Tag Q Sec A copy command in Sec will copy fields from the source tag creating like named fields in the specified Tag DupIgnore MismatchWarn NoCoreAssign 170 User s Guide SAY Software Tool House Inc In the case where the target is a String Tag the duplicate assignment option default is DupOverwrite To use Duplgnore on String Tag targets so that prior assignments may be made the following command should be run at an opportune point the AssignInit or AssignTerm sections for example to remove the last iteration s values ACmd Reference Tag del Only one of Skip or Fields can be used and it must be th
192. han created A Create statement has only two parts The Tag that the created record will be known under in any Launched sections and the schema to create After a record is created it is reloaded into the Tag so that Launches will have available all values of that record All loads in the control section are processed before the Update is processed A Query or File is processed before the Update The assignment section is processed after the Update s processed Until Statement The Until statement may be used only when a control section includes an iteration such as Query QuerySql File or Loop The Until statement specifies a condition that when true causes the control section to stop its iterations with no errors Until if condition If an error is needed use the Abort assignment command In a section that does not iterate any Until statement is ignored with a warning Meta Update 131 User s Guide SJT Software Tool House Inc In the following example an infinite loop is set up but is aborted after a single iteration Do These two sections AssignInit Do asgInit are entirely equivalent Loop While 1 Until if 1 Do AssignInit Do asgInit An Until statement can be used to limit a section s processing when any condition becomes known For example say you want to delete an Incident and all its dependencies but only if a copy of that Incident and all those dependencies exist in an
193. he Loop iterates throu Output F Fle Arg outf all the fields of AR_INFO Gr horse assigning a set of attributes esse such as ee ang Each field value pair is output Value to the Tag s into a single CSV record Name 8 FieldName Value Value gh Fle This defines the CSV file with two fields Typ Delimited FldHdr Fields Fle Flds Format Csv Fle Flds Name Value Meta Update 262 User s Guide Cie Software Tool House Inc eege Script entry point Output uses the argument to create a CSV file and the assignments simply use the Loop Tag s Meta Update 263 User s Guide SJT Software Tool House Inc Ticket Creation Batch Command This is an invented script built as an example to help learn Meta Update The script is untested and it must be noted that the script will need editing before being run in any reader s environment Requirements We need a simple easy to use parameterized ticket generator for our ARS Help Desk We want to be able to create new tickets so that we can if desired force an assignment to a specific group We want to use this callable command in various ways gt Remedy ARS workflow and escalations gt Scheduled jobs through at or cron gt Configured commands in other their network monitors gt Added as a last step of some of their bespoke software The command would depend on the arguments given Defau
194. hg exchg cvs The first example uses the environment variable Rmdy and the program argument fname File records are similar to ARS records A record is comprised of fields The fields may be referenced in ARS assignments in the same way as a loaded record s fields can be referenced There are two types of input files Delimited and Fixed Meta Update 124 User s Guide SAY Software Tool House Inc Delimited files are used by Excel Microsoft Exchange also produces these files Fixed format files have fields that are always a specified length Transaction files UNIX script output and input files tend to be fixed format See File and Field section below for more information on the options you can select When Launching a control section with a File that File will be processed for each record in the parent control section For example if the first control section processes a 100 record file and the second control section processes a 10 record file the assignments of the second control section will be processed 100 10 or 1 000 times Note at most one and only one QuerySql Query File Of Loop may be codedina command section Loop Statement A single Loop statement may be coded in the control section Meta Update will iterate through the values being looped For each value in the loop Meta Update will set the loop reference tag and can create or update a single record Note at most one and only one iteration s
195. hich sections have lead to where you are in a Meta Update script bt BackTrace Print a Launch BackTrace Examples bt DoOuter line 14 DoInner line 21 DoInnerInner line 42 H DoInnerInner line 42 at Do ln 42 Init Mupd Dbg gt Meta Update 88 User s Guide SJAA Software Tool House Inc Print Use Print to print the available reference tags all references for any one tag or a string containing references From the Help Print command Mupd Dbg gt h print The Print command allows you to print your Meta Update script s Tags and variables D Print Print tag set or single string Print will print all Tags defined Print Tag will print all members of the Tag Print String will print String with normal substitution Examples p will print all defined tags p ENV will print all environment variables p ArsSvr SCTL Server will print ArsSvr xxx at Do in 42 Init Mupd Dbg gt Next Use Next to single step your script If you re in an assignment section next will execute the current assignment statement and then stop at the next one If you re in a command section next will run the next phase or operation in that command section and stop before the next operation For example next might load the next iteration record and then stop before executing any AssignPre assignment sections Mupd Dbg gt h next The Step command executes the next instruction or settable breakp
196. his Section See also Next Step Continue Mupd Dbg gt Meta Update 91 User s Guide SAY Software Tool House Inc Script Reference Meta Update 93 User s Guide Cie Software Tool House Inc Meta Update 94 User s Guide SAY Software Tool House Inc Script Reference Meta Update 95 User s Guide SJT Software Tool House Inc Script File General Format The script file drives Meta Update It is your Meta Update script It tells which form the target assignment is to be applied to and drives the required loading of records It resembles a sectioned INI file Main Server User ArgNm Controls Update Assign Assignment Description Description Summary Status ArsDev Demo HpdId Tgt Yr SArg HPD HelpDesk HpdId S001 Assignment w Router N down auto raised by Xxx Auto Assigned The format for this INI file is as follows The Main section identifies the ARS server and sign on parameters The Controls section is passed on the Meta Update command gives operational information including the Assignment section to be applied The Assignment section assigns values to fields in HPD HelpDesk for update e Comments may be coded freely They are started with a number sign or semi colon as the first non white space character of a line Blank lines may also be inserted freely Comments cannot be coded on the right side
197. id Common Field Name Assigned To 8 Short Description To not assign these fields with the copy command add them to the Skip list This option is ignored when the target is not an ARS record and all fields that can be copied including core fields in the source if that source is an ARS record are copied Examples of Copy Commands When merging two different records it is often desired to not overwrite the contents of a field with NULL We also do not want to replace the Diary log with that of the source We will instead add a new Diary entry indicating the records were merged Note that we are not using a Merge operation but a normal Modify These assignments including the copy command will do that cmd Copy Src if FldSrc Di amp amp FldSrc ni In this example we are copying from another server but we do not want the request id copied Cmd Copy Src CoreAssign Skip 1 This example could be an assignment section for a pattern file to build an HTML table from all the fields String lt table gt lt tr gt lt th gt Field lt th gt lt th gt Value lt th gt lt tr gt Cmd Copy Src amp Ptn lt tr gt lt td gt FldNme lt td gt lt td gt FldSre lt td gt lt tr gt String lt table gt Include Command The Include command is used to include assignments from another section This is in addition to the set of assignment sections listed in the control section s Assig
198. ike Value from Xn Notes Notes 2 Value from Xn Notes2 IF Statement The structured nested if facility is like the if of many programming languages such as c Java and so on Basically if condition condition true assignments else condition false assignments if condition2 Condition2 true assignments else condition2 false assignments endif Meta Update 167 User s Guide SJT Software Tool House Inc endif Meta Update uses the first format of the assignment conditional if followed by no value to specify an IF statement See Conditional Assignments above for more information on specifying the conditional expression To distinguish this if from an assignment the special target field Cmd is used So ACmd if condition real ARS target field assignments cmd else real ARS target field assignments cmd endif An else can follow and an endif terminates the if If the expression evaluates to true all assignments up to the else are processed If false all assignments are skipped until the else and all subsequent assignments are processed Ifs can be nested as needed up to a maximum nesting level of 100 This following assignment sections are entirely equivalent Notes Notes n Notes Xn Notes ACmd if Xn Notes2 W Notes NY n Notes 2 n ACmd else Notes No notes data Cmd endif and Notes
199. ile Indicates how fields containing leading and trailing spaces are to be handled As many trim statements as required may be coded The field name a11 is a shortcut for every field of the file If Trim All is coded any other Trim are ignored The default for a Trim is trailing You must specify both leading and trailing if you need both With a trims a field containing all spaces is equivalent to a zero length field or NULL All leading Only leading spaces are trimmed All trailing leading Both leading and trailing spaces trimmed All trailing Only trailing spaces are trimmed All Equivalent to All trailing Fixed files contain fields that start in the same column of each record and are of a fixed length These files must have their fields specified in a field definition section Each field has a starting column number and a length It is possible to have overlapping field definitions in a fixed file Meta Update 145 User s Guide SJT Software Tool House Inc Field Sections About Fields and Formats What is a Field Section Field sections are a list of field giving them names and optionally formatting and interpretation rules These fields are then used in those Tags for assignments FieldSection ID format a delimited field UpdateText format one that could span lines The above example defines two fields called ID and UpdateText Note that the required dollar sign i
200. ing Meta Update eee 55 Environment Variables seseeseneeeeeeen 60 GibMupd e 61 SthScriptPath ec eeeeeseeeeseeeeseeeeseeeees 60 expressions Conditional asslgonments 166 Copy assignment Commanden 172 Include assignment command 173 Output statement rrrnorvrnnnrrrrrvrnnnnnnennr 135 SQL fl IDS sri aai 122 Until etaiememt A 109 While statement AAA 125 F Fields Copying from ARS Forms cceeeee 147 Dates and Date Formats 150 Format Specs sini witecadced 148 Formats in fmt Assignment Command 185 Numbers and Numeric Formats 152 Quotes in values rmrnrrrnrrrnrrrnrrrrnrnnnnnn 152 Regular Expression Extracts 0 189 SECUONSugn eee 145 SQL Selelii inu scins 149 File Iteration in Concepnts 38 Log Formatsion neninn 75 Logging Locally 72 73 Trace Format errnnvnnnnnnvnrnnnnnvnnannvnnnnnnnr 75 Tracing Locally 72 73 Format Assignment Commande 185 Functions in Arithmetic Expressions eee 194 fo ole PE EN cere 139 Ifs Reference Assignment Commands 187 Include Assignment Commande 173 Including Script Files Ginchude ennta 98 Installingu ET 46 Distribution Contents rrnvrnenrrronrnnrnrnnrn 49 Expanding the Distribution eee 48 Iteration About instead i ater 113 Concepts sieneen on eaa 20 File in Concepts rsrnnnnrnnnnrnnnvrnervrnnnnnnennr 38 IN Concepts 33 36 Loop Defined in Concepts 39 Loop in
201. ing a maximum length of 15 and no zero fill The initial value of the request id field Acts as a prefix to a zero filled integer Length of the request id field s initial value or prefix Number of Status field 7 values A zero indicates that this form has no Status and Status History fields Archiving enabled One of None Form Delete Form amp Delete The Archive Form Name The No Attachments option The No Diary Fields option 237 SJT Software Tool House Inc 15 None User s Guide Sak Software Tool House Inc Licensing Meta Update 238 User s Guide Cie Software Tool House Inc Meta Update 239 User s Guide Sak Software Tool House Inc Licensing Meta Update 240 User s Guide SJT Software Tool House Inc How It Works Meta Update is licensed on a server by server basis Licenses are dated and may be indefinite or limited term Evaluation licenses and migration project licenses are examples of limited term licenses Once a Meta Update license is granted for an ARS Server Meta Update scripts can be run against that ARS Server at any time or on any server or workstation License keys may be requested from the Software Tool House s web site at http www softwaretoolhouse com When requesting license keys the ARS Server Name must be supplied This ARS Server Alias Name is matched against the supplied license key This name is specified in the A
202. ing in an additional API call to the ARS server When Meta Update reads an ARS record through the ARS API as in the read that populated the tag Src the descriptive contents of attachment fields are read The attachment itself is not read until required When an attachment field is assigned the value of another attachment field through a reference and the source value is non null Meta Update retrieves the contents of the attachment That retrieval is made using a memory buffer The buffer is freed when the original record is freed in the above example s case when the Src tag is reloaded When an attachment field is a string value that string value in either one or two components refers to a file name Meta Update 224 User s Guide SAY Software Tool House Inc That file name must be able to be read by the Remedy API That is the file must exist and the user running the Meta Update binary should have read rights to the file Generally speaking you should be able to open that file with the Windows Explorer if you are running Windows Meta Update 225 User s Guide SAY Software Tool House Inc Predefined Reference Tags Meta Update automatically defines some reference tags These tags may be used anywhere that any other tags can be used These tags are available to the script on start up CTL Meta Update and script information Arg Script defined arguments ENV Environment variables AR INFO AR Server Informa
203. ings Remedy records the current environment if conditionals to be coded external processes to be spawned on the client or the server messaging aborting copy like fields into the target conditional breakpoints when debugging is enabled YYYYYY The following commands can be used Copy Copy all like fields from one record into the target record Include Process another section of assignments Abort Abort the update or output Msg Issue a message Spawn Spawn an external process Reference Assign a new string reference Break Execute a debugging Breakpoint if allows nested ifs else endif Meta Update 169 User s Guide SAY Software Tool House Inc Assignment Commands Assignment commands allow if conditionals to be coded messaging aborting copy like fields into the target YYYYY Copy Command external processes to be spawned on the client or the server assignments to script variables of strings Remedy records the current environment The Copy command is used to copy all fields that have matching field Names or Ids from one loaded record into the target update record These do not have to be from the same schema or the same server or even ARS records ACmd r ys yyy YS Copy SrcTag DupAppend DupOverwrite DupIgnore MismatchIgnore MismatchWarn MismatchError CoreAssign NoCoreAssign if exp SkipDisplayOnly SkipNull Skip FL Fy er I J Fields
204. ion launches the actual worker section Tb1 Sync to copy the modified records This section has no output The Launched Section Section Tb1 Sync is launched once for each table row in the passed configuration file row That row is in memory when this launched section is invoked In addition a select Query string has been created This section issues a select to retrieve the ids of the modified records for the given table It does this with the ouerysq1 keyword specifying the Prod server tag The na says that we will not name or edit any of the columns returned by the select statement instead referring to them by their column numbers We iterate through the set of Request Ids returned by the select During each iteration we load the source record from the source server with the Loado keyword and issue the Update to create the same record on the target server with the same request id as in the source server That Update or Create is performed using the Merge API and no filters are fired including filters set to fire or Megre The Assign and AssignNew sections are the same and simply issue the Copy command to copy all source fields including attachments and core fields into the target record updating or creating that record Meta Update 277 User s Guide Sak Software Tool House Inc Meta Update 278 User s Guide Cie Software Tool House Inc ARS Table Backup and Restore There are two scripts in this
205. is a string following the column or width in a field specification That string is made up of a set of keywords and values coded in any order Keyword Values Trim quoted leading trailing both Case upper lower title Date Spec Spec Quoted never always asneeded Quote std nnn Meta Update Meaning Specifies that leading and or trailing white space in the source field is to be deleted If the field value is quoted trimming does not take place unless the special keyword quoted is specified Specifies that alphabetic characters are to change case to the specified case For title case the first letter or a word beginning the string or following white space is converted to uppercase and all other alphabetic characters are converted to lower case If a word does not begin with an alphabetic character no characters of that word are converted to uppercase aAbB 1Aa b1B becomes Aabb 1aa B1b Indicates that the field contains a date value and determines how to interpret the date value Described further below Indicates that the field may be surrounded by quotes and that the quotes are not part of the field value Unless specified the quote character is the double quote Indicates the single character that is to be interpreted as a quote Std means the standard double quote character nnn defines an ASCII character with the value nnn x represents any single character 148 User s
206. is control section may itself be launched from a control section that iterates In that case it will perform operations once each time it is launched A control section can iterate on at most one of the following statements Query Allows you to iterate through the results of an ARS query specified as per the Advanced Query Bar in the BMC User Tool Of course the full power of Meta Update references is available for your query All records returned by the Query will be processed no matter what the server limit is set to If the Query returns more records than the server limit the Query itself will be chunked The records are retrieved in blocks of 100 One can control the starting record number and the maximum number of records of the Query results to process QuerySqi Similarly you can issue a direct SQL query through the ARS API iterating through the resulting rows and naming interpreting transforming the resulting columns Remedy imposes no limit on SQL queries and returns all results when the query is returned File Any type of columnar file can be iterated through Values can be transformed or interpreted CSV s that Excel or the BMC Import Tool can t handle are not a problem For example CSV s with values having embedded new lines stray undoubled quotes or different delimiters are all supported r Loop oops may be based on the entries of a diary field allowing you to create records for each diary entry for e
207. is is a single value to be assigned Any outer quotes are removed and references are resolved This value may be interpreted differently when special keywords are used for the Name being assigned as described above When assigning a value to a single named field of a tag additional functions are available to derive the value These are identified by a reserved keyword in the value field Value Keyword section When the value is specified as a single at sign the value following the reference is a String pattern assignment section See Assignment Targets above The specified String target assignment section has only two fields available string and File and is used to build a single string value that will be assigned to the specified tag and name LookUp The LookUp keyword is followed by the LookUp section and the value look up See LookUp Assignment above 177 User s Guide SV Software Tool House Inc Qif c The condition will be evaluated and the true or t false value will be assigned to the tag and name eval This is used to evaluate an arithmetic expression It can be followed by the keyword real to override integer arithmetic and specify that floating point arithmetic be used See Using Arithmetic Expressions below Heart This is used to transpose a value according to a fmtout field formatting string You can use this to change case and perform substitutions for example
208. lar expressions to remove all path information as needed Msg Command The Msg command is used in an assignment section to produce a message It has no other effects It can be made conditional Options include the severity of the message to generate and text of the message to be written to the trace file Cmd Msg Severity Message Severity D Debug A Debug message is produced in the trace files These are normally inhibited I Informational An Information message is produced in the trace files and may be echoed to the console w Warning A Warning message is produced in the trace files E Error An Error message is produced in the trace files but no real error condition is raised Message Any string including any string references Spawn Command The Spawn command allows you to launch a separate process Any valid executable can be coded The process must complete for Meta Update processing to continue Cmd Spawn command command This is any string that can be de referenced and makes sense for the operating system that Meta Update is being run on The process should return 0 to indicate success and any non zero value to indicate failure If the spawn itself fails that is the operating system will not or can not launch the specified process the Meta Update will throw an error and the assignments will fail If the spawn succeeds but the spawned process returns a non zero return value Meta Update will issue
209. laration supports the case where a field has an SQL fragment other than the name for example an inner select This may be specified before any field formats and after the field position as Sql An automatic tag and field is assigned with the text of the field names or field Sq1 text string separated by commas References within the Sql text is dereferenced when creating the string The CTL tag and a field made up of the field section name followed by SqlSelect contains the string Here s an example OrySql QuerySql Q amp SqlFields amp select S CTL SqlFields SqlSelect amp from table x A amp where fieldl SArg some argument SqlFields OBJID DATE CRE Sql Select date cre amp from table y amp where cre2x A OBJID as DATE CRE amp Date yyyy Mmm dd FIELD3 When the QuerySql is executed the text in cTL SqlFields SqlSelect will contain OBJID select date cre from table y where cre2x A OBJID as DATE CRE FIELD3 Date Fields ARS supports two different date fields in the database gt One is called a Date Time field This is accurate to one second between 1970 and 2034 Mar 23ish For ARS purposes this is an epoch time It represents a whole number of seconds from January 1 1970 in Universal or Greenwich Mean Time gt The other is a Date only field containing no time component For ARS this is a Ju
210. ld No sort is applied This is the default setting Reverses the natural order not the same as descending except for Diary loops Sorts set data in ascending sequence If both are numeric uses a numeric compare else does character comparisons May be abreviated to asc Sorts set data in descending sequence If both are numeric uses a numeric compare else does character comparisons May be abreviated to desc If the sort is not specified no sort or forward is applied For Diary loops the time stamp of the diary entry is used in the sort The ARS server stores Diary entries in an encoded diary string by appending to the string always from oldest to newest Hence forward is equivalent to ascending and is from oldest to newest reverse is equivalent to descending and is from newest to oldest 126 User s Guide SAY Software Tool House Inc In a String loop the forward order is the order that the individual strings are parsed from the whole reference Strings are compared as case sensitive strings except when both strings are integers In that case the integers are compared So 104 17 12 will sort as expected numerically and 104a 17a 12a will sort as 104a 12a 17a The following string example will illustrate the effects of the sort keywords String value 1 97 42 26 51 Forward 1 97 42 26 51 Reverse 51 26 42 97 1 Ascending 1 26 42 51 97 Descending 97 52 42 26 1 While Fiel
211. lds not defined in the target Meta Update 162 User s Guide SAY Software Tool House Inc Section Target Types There are three different types of assignment sections which differ in their targets ARS or CSV No Target Tag Target Pattern Target Meta Update Target is an ARS Record in the schema declared in the Create or Update keywords or the ars Reference assignment command or a columnar File record whose fields are declared in the output keyword These sections can only be specified by Assign AssignNew AssignOpen and AssignClose command section keywords There is no output target for these assignments There is no ARS or record to create or update or output file record to create These sections are used to assign script variables to invoke external processes issue messages abort an operation and so on These sections can only be specified by AssignInit AssignTerm AssignPre and AssignPost AssignPostOk AssignPostErr and AssignPostLaunch Called by a Reference command the target is a single string reference tag Any fields assigned in these sections become a field of the Tag that this section was called for See Assigning a set of fields and values to a single Tag in the Assignment Command Reference command The output target for these assignments is either gt a named string specified with the Reference assignment command gt or a pattern file recor
212. le The order keyword controls the order in which the lists are searched LookUp Section Default XXX NoMatch I D W E If a list is coded in Default Skip E the section the Order keyword LookUp Val Val trol oie 8 Se controls the lis LookUp Val 2 search sequence File Tag LookUp File rg File Names FileSource STag Fldl SrelS JATag Fld3 FileTarget Tag Fld3 Tgt 4 S Tag Fld4 String ren Order File List mappe O le Filelf if Tag Flal Srels Test fields of the file LookUp File Type Csv Format Excel The If puts Se Fields LookUp File Fields filter on the file s records Only LookUp File Fields records that match Fldl Srel Trim both the condition are Fld2 Tgt1 loaded Fld3 Src2 Fld4 Tgt2 File Specifies that an external columnar file will be used to create the LookUp table If coded all other keywords below are required The File keyword and syntax as well as the file definition in the specified File section is exactly as described in File Sections in the Command Reference part of this document above The Tag coded in the File is only used during the initial load of the file when the LookUp section is first used Any other references to that Tag will fail FileSource This allows you to specify how the source string is to be created from the fields in the file It is evaluated once only when a LookUp
213. le Tag File Section S Arg Filename See the File statement in the Script Reference above FileSource Required when File is used Specifies the string to be built as the Source LookUp while loading the file Use Tag 1d to specify fields of the file FileTarget Required when File is used Specifies the string to be built as the Target returned value while loading the file Use Tag 1d to specify fields of the file FileIf Optional Only used with File Specifies a condition that must be satisfied for a record to be included The file record s fields are referenced through the Tag specified in the File statement Filelf if SFile Tag fld 1 Active Meta Update 201 User s Guide SAY Software Tool House Inc Query Optional Specifies that an ARS Query will be loaded and used to derive the returned string if matched A Query specifies a query that should return exactly one row The CTL LookUp Src reference can be used in the Query Unlike a Loadg a LookUp query can return zero one or more than one record Other keywords control what to do when the number of records returned is not exactly one Query Qry Tag QRY Schema amp fld test SCTL LookUp Src amp Status Active QueryTarget Required when Query is used Specifies the string to be built as the LookUp return value when the LookUp query matches a row
214. lian date from an 1 4713 BC through Jan 1 9999 When a date is entered into the ARS User Tool it is considered to be in the local time zone of the machine that is running that User Tool Meta Update uses the standard libraries to Meta Update 150 User s Guide SAY Software Tool House Inc convert dates and also presumes that date values are in the locally set time zone of the Meta Update process ASCII file date fields either from an ARS field a CSV column or SQL column are character strings that Meta Update must interpret and convert when assigning them to ARS date fields Meta Update can read date data as either one of the above raw julian or epoch formats and a normal date specifying the year month day hour minute seconds By default a date is specified in any one of the following ways yyyy mm dd hh mm ss yyyy mm dd hh mm ss yyyy mm dd hh mm ss yyyymmddhhssmm One could use this format in making a constant assignment CreateDate 2003 12 31 10 15 Any missing components will be treated as if they were zero one for month and day These assignments are equivalent CreateDate 2003 01 01 00 00 00 CreateDate 2003 01 01 CreateDate 2003 These defaults can be overridden on a field by field basis when the field is defined in a field section Simply code the Date format specification when the field is defined Once a date specification is coded the file must contain all components specified
215. lity by suffixing Trc to the binary names Meta Query This tool allows you to issue ARS and SQL queries through the ARS API and print or create CSVs from the results Please See the Meta Query User s Guide for more information Meta Schema This tool allows you to find information about the ARS forms and fields on your server and print or create CSVs from the results Please See the Meta Schema User s Guide for more information Meta Delete This tool allows you to delete records from ARS tables on your server Please See the Meta Schema User s Guide for more information License Updater and Password Encryptor This utility is used to generate an SthLic cmd or SthLic sh file that sets environment variables for ARS server authentication and Meta Update licensing It is also used to encrypt ARS authentication passwords The Trace facility daemon This binary can be started when the machine powers on and left to run until the powers off See the Software Tool House Trace Facility Administration Guide for more information 51 User s Guide SJ Software Tool House Inc SthTrcCtl exe SthTrcEcho exe SthArsTime exe SthSiniGet exe Meta Update The Trace daemon control program This program is used to control the trace levels files sizes and so on It communicates with the sthTrcDaem exe process The Tracy utility that can be used to write messages to the trace facility Allows easy conversion of Re
216. ll value is still passing a value Named arguments not supplied on the command line contain the null value This example is equivalent to the above but will supply usage information when used incorrectly PrmReq PrmReq PrmReq PrmReq PrmReq PrmReq address PrmReq PrmReq PrmReq PrmReq PrmReq PrmReq Meta Update 4 Usage TT New p Subj Desc Req Cat Typ Item AsgGrp where Subj is required and is the ticket short subject Desc is required and is the long Req is either the requester login or email Default Requester assumed if null Cat Category Default if null Typ Type Default if null Itm Item Default if null AsgGrp is an assignment group or null Create a ticket and optionally assigns it to a group 266 User s Guide Cie Software Tool House Inc Meta Update 267 User s Guide SJ Software Tool House Inc Closed Ticket Replicator This is taken from a customer solution It has been modified to be used as a Meta Update sample The script demonstrates how to launch other dependent command sections how to make assignments from multiple records how to use the Copy assignment command Background The customer had a series of Perl scripts to control ticket generation and filing emails with tickets This allowed a full email conversation between the ticket agent and ARS system and the requester Sometimes a requester would reply to an email after it
217. lts would be assumed for all null arguments ZS Requester Email or Requester login If it contained an it would be looked up in a people form as an email Otherwise it would be looked up as a login name Subject The subject of the ticket Description The full textual description Category If not supplied use Default Z Type Hem ZS Assignment Group Only assign if supplied Meta Update 264 User s Guide Meta Update solution Main Server User ArgNm ArgNm ArgNm ArgNm ArgNm ArgNm ArgNm PrmReq TT New Simply create a Ticket every time Schema Assign S Y Software Tool House Inc Development time one hour Sth2 EI Names the arguments Demo ee Subject ReqSearch Description Category Type Item AsgGrp Specifies that only 2 arguments are required and usage info when not enough arguments supplied Simple command sectio that always creates a single record in the HelpDesk HPD HelpDesk schema Asg New TT JE Simple assignment of Asg New TT passed argument value Subject Description Cmd LoadQ Cmd Cmd LoadQ Cmd LoadQ Cmd Cmd Requester Id Requester Login Category Arg Arg if SArg Subject Description Load the requester record into memory under the tag Req amp if SArg Req SHR People Login else if SArg Req SHR People NE Email ReqSearch amp Request
218. m This is highly recommended whenever the INI file is changed as all invocations of Meta Update specifying that file will fail if its syntax is in error To check the syntax simply invoke the siniget exe executable with the INI file name as the only parameter It will either report a syntax error or it will print the contents of the file Meta Update 97 User s Guide SJT Software Tool House Inc Including Other Script Files Script files may include other script files The resulting script that Meta Update executes will be the merge of all source files and included files in the order that they are included The include file directive tells Meta Update to stop processing this script source and fold in the included source and finally to resume processing the original script source at the line after the include statement at the original source s section The file name specified on the directive cannot be a reference and must be a valid file name for the operating system on which Meta Update is running For example directory separators must be the correct ones for Linux and Windows The SthScriptPath environment variable may be used to set a search path for the included files Then the script can simply reference the file name with no path information That script can then be used on Linux and Windows An example may help include main ini Controls include controls i Update Tgt HPD HelpDesk amp Assignment
219. md Next Action Next Action Cmd Next Action Sth2 Demo TtIdClosed IdLog 2 Src TT mm r asg TT New TT Orig Upd TT Email T Hist 1 1 T Hist 3 Hist 5 New Upd Sre TT 1 SNULLS if Srce_ TT Next Actions this section creates a Ticket every tim TT TroubleTicket TT TroubleTicket SArg TT Id eds roubleTicket Yes Pee Development time three R hours Names two required arguments The closed source TT is loaded into memory from the passed Id Always creates one singl e record in the HelpDesk schema amp Merge API is used to inhibit Submit filters The created record fs loaded into memory after submission and other sections are run to copy dependent records fis 10 Old closed ticket actions n endif Src TT Next Action Problem Ticket Typ Priority Severity Ticket Opened Medium 4 Ticket Closed Problem Started Problem Fixed Escalate when ACmd The next cmd copies al Meta Update solution Meta Update SDATES SNULLS SNULLS 1 SNULL SNULL Copy Gre TT non assigned fields CoreAssign DupIgnore 270 Amit Assignments for the new TT some arbitrary values constants and the remaining set of fields from the closed ticket Skip 1 User s Guide Cie Software Tool House Inc The close
220. me fields as the ARS record Because all fields from the table and CSV file match we just issue a copy We need the CoreAssign option because we want 1 2 etc assigned from the CSV only available with Merge If the attachment value in the CSV is non null we will have a file named idl id2 fid att idl etc is the request id with changed to hyphens fid is the attachment field id We change to with a Subst we match all for the Subst Cmd Ref V Ld Att asg regex regex Src 1 Ld Att asg regex This field list is for regex used to substitute hyphens for Reqid Subst Meta Update 289 User s Guide SJT Software Tool House Inc Do Load asg handle attachments separately ACmd if SVa MaxS Cmd Ref V Qinfo Src SVa Fnm1 Cmd if SV Values ACmd Ref V attval SV ValueS V AttPth SV ReqIdS Va FidlS att SV FieldName V attval Cmd endif Cmd if Va Max gt 1 Cmd Ref V Qinfo Src SVa Fnm2 Cmd if SV Values Cmd Ref V attval amp SV ValueS V AttPth SV ReqIdS S Va Fid2S att SV FieldName V attval ACmd endif Cmd if Va Max gt 2 Cmd Ref V info Src SVa Fnm3 ACmd if SV Values Cmd Ref V attval amp SV ValueS V AttPth SV ReqId SVa Fid3 att SV FieldName V attval Cmd endif Cmd if Va MaxS gt 3 2 be The maximum number o
221. medy time stamp values Allows extracts of script files to be used in batch files and performs a simple validity test on scripts 52 User s Guide SAY Software Tool House Inc Running Meta Update Meta Update 53 User s Guide SJT Software Tool House Inc Meta Update 54 User s Guide SAY Software Tool House Inc Running Meta Update In this section we will cover Setting up the run time environment BMC Remedy API versions Meta Update program versions Using the license keys Environment variables The Meta Update command line usage Meta Update output and return values Meta Update Tracing VVVVVVVY Meta Update 55 User s Guide SJ Software Tool House Inc Run Time Environment Meta Update runs in a Windows Command Prompt or UNIX shell Scripts and files developed and referenced may be interchanged freely between Window and UNIX Meta Update scripts can be run gt manually in a shell or command prompt gt ina filter with the PROCESS actions gt through a batch file or shell or Perl script gt through an OS scheduler like cron or at The runtime environment is the same for workflow script and manual operation The Meta Update bin and bin64 directories contain all required Meta Update binaries or execuable programs shared objects and dlls The Meta Update bin directory should be on the path On Windows one of the two the Meta Update bin and bin64 direct
222. mes users status history can be set to any desired value Diary fields entries can be looped through creating records in other forms All ARS permissions and workflow is respected KKK Metz Update 14 User s Guide SJ Software Tool House Inc Concepts Query Sai Qyory I Filo m Sen a t oup F Lost G Zi Ryn Braet aia Reforgn Steg Meta Update 155 User s Guide SJT Software Tool House Inc Meta Update 16 User s Guide SJT Software Tool House Inc Concepts Meta Update 17 User s Guide SJT Software Tool House Inc Overview Meta Update is an Extract Transform Load ETL scripting tool for the BMC Remedy data Meta Update uses the BMC Remedy API With Meta Update you can create any repeatable programmable import migration or batch job in 1 10 the time it would take to develop a similar function using the ARS API with Perl Java orc Meta Update gives an ARS Administrator the power of the ARS API without having to know the API or programming at all With Meta Update your ARS Administrator can create complex imports and migrations himself in a language he already speaks easily and directly He tries out his ideas executes a job and sees the results He makes assignment changes and tries and checks again All in minutes Meta Update gives you a window into the Remedy ARS API As such all workflow is fired and all ARS permissions are respected It does no direct
223. mmand The Trace command allows push pop and change the trace settings when the script is run with tracing See Running Meta Update The Command Line for tracing scripts The trace command is generally used while debugging scripts by inhibiting or reducing tracing in already debugged sections and then selectively tracing other sections Cmd Trace Push Cmd Trace Trc Lvl Cmd Trace Pop Push This is used to save the current trace levels Pop Resumes the trace levels at the time of the matching Push Meta Update will issue a Warning when a Pop is used without a previous Push Tre Lvl A Trace Level setting See Running Meta Update Tracing for more information Note Trace commands within a script will be ignored when run with the minus minus d switch d See Running Meta Update Tracing for more information Meta Update 197 User s Guide Software Tool House Inc Meta Update 198 User s Guide SAY Software Tool House Inc LookUp Sections Overview A LookUp section is used in the LookUp assignments translate values and load records using lists files ARS and SQL queries A LookUp section can be used in field or reference assignments Different LookUp assignments may refer to a single LookUp section Field amp LookUp LookUp Section Source Value Cmd Ref V New Status amp LookUp LookUp Section Source Value The LookUp assignment refers to a LookUp section and passes that look up s
224. mmediately following or immediately before any newline in the subject string respectively as well as at the very start and end If there are no newlines in a subject string or no occurrences of or in a pattern setting this modifier has no effect 192 User s Guide SAY Software Tool House Inc s PCRE_DOTALL If this modifier is set a dot metacharacter in the pattern matches all characters including newlines Without it newlines are excluded x PCRE_EXTENDED If this modifier is set whitespace data characters in the pattern are totally ignored except when escaped or inside a character class and characters between an unescaped outside a character class and the next newline character inclusive are also ignored This is equivalent to Perl s x modifier and makes it possible to include comments inside complicated patterns Note however that this applies only to data characters Whitespace characters may never appear within special character sequences ina pattern for example within the sequence which introduces a conditional subpattern U PCRE_UNGREEDY This modifier inverts the greediness of the quantifiers so that they are not greedy by default but become greedy if followed by It is not compatible with Perl It can also be set by a U modifier setting within the pattern or by a question mark behind a quantifier e g X PCRE_EXTRA This modifier turns on additional functionalit
225. n Or Update0 keywords Cmd Include Section Section This is the section name to be included It can be a constant asg BaseElement If the section name does not exist an error will be thrown It can also be a string reference expression Sec UpdSSrc Typs Meta Update 173 User s Guide SAY Software Tool House Inc When the included section name is derived from a string reference expression the resulting section name does not need to exist If it doesn t no section will be included If the whole command is prefixed with an if exp that expression must evaluate to true or no new sections will be included Abort Command The Abort command is used in an assignment section to discontinue an update or to simply issue a message It is generally made conditional Options include the severity of the error to generate and a message to be written to the trace file The IdLog if being created reports the operation status as Aborted Cmd Abort Severity Launch Msg Message Severity D Debug No error is reported A Debug message is produced in the trace files These are normally inhibited I Informational No error is reported An Information message is produced in the trace files w Warning No error is reported A Warning message is produced in the trace files E Error An error is reported An Error message is produced in the trace files Processing of the control section st
226. n the delimiter Loop String amp E amp WAN kk Ak ff amp r Src CASE HISTORYS The Loop will iterate through 4 strings These are Lp 1 of 4 CASE OPEN 2011 08 01 supl The customer Lp 2 of 4 CASE NOTES 2011 08 02 supl Ran the trac Lp 3 of 4 CASE TRANSFERED 2011 08 02 sup net Lp 4 of 4 CASE CLOSED 2011 08 02 sup ne Firewall cha It is up to the AssignPre of the Loop section to parse the looped strings and determine what to do When a double anchor is used only when the delimiter string is preceded by two new lines does that string be considered a match Consider the following example Loop String amp Meta Update 129 User s Guide SJT Software Tool House Inc T WAAkkx r SrcC CASE HISTORYS Then the loop will be executed four times If on the other hand a single anchor were used the loop would be executed five times and iterate through these strings Lp 1 of 5 CASE OPEN 2011 08 01 supl The customer Lp 2 of 5 CASE NOTES 2011 08 02 supl Ran the trac Lp 3 of 5 tracert output attached Lp 4 of 5 CASE TRANSFERED 2011 08 02 sup net Lp 5 of 5 CASE CLOSED 2011 08 02 sup ne Firewall cha Example 5 Join The following script will transfer records from a class form on a production server tola server Because we do not want workflow to fire
227. nch Site Site Query Site Site Organisation ID SOrg 1 Launch Services Services Query Service Services Site ID Site 18 Assign ServiceInvalidate ServiceInvalidate Status Inactive Launches can be conditional That is a separate section can be launched if a condition is satisfied That condition may be dependent on any of the data held in memory at the time the launch condition is evaluated This includes data from any previous control sections the current record from a query or file and the updated record Further the section name to be launched can be derived Multiple launches can be coded for any section and a launched section can in turn launch more sections Meta Update 43 User s Guide SJ Software Tool House Inc Control Section Example Two rather contrived examples may help to illustrate Example 1 In this simple example we want a command line script that will raise a new ticket We d like the script to take one argument a key to a configuration table that would give the details of the ticket to be raised Example 2 In this update we process a Query of an Update with five columns Schema Key value Key field label field name and field value We want a script that processes that file updating only that field in the right schema record and ensuring no workflow fires or modification dates are touched Example Migrate any Table This example
228. nd how to format the field value for output Format specifications are described below in the Field Section 144 User s Guide Quote Trim ErrorFile SAY Software Tool House Inc The special keywords Csv or Excel are equivalent for input files and stipulate a specific default format as follows Quote Quoted asneeded Quotes double Nulls std 1f unix The keyword Overridden or Merged tell Meta Update that the field level format either overrides or is merged with the file level format The default is Merged Optional for any type of input file Ignored on Output files Gives the name of an output file to build This file will contain all those input records that resulted in an error The supplied name is a string reference The file so created will be in the same format as the input file If the input file had field headers the output file will also have field headers No manipulation of the record data is done before output when any error is diagnosed within the processing of an input record The following keywords have been superseded by the Format keyword Their use is not recommended Optional for Delimited ignored for Fixed Specifies that the fields in the file may be quoted Specifies the single quote character not escaped LineSpan Is used to indicate that a quoted value within the file may contain embedded line feeds or carriage returns The default is NoLineSpan Optional for any type of f
229. nd the first 72 bytes of the record or query result string Any values permitted in Query statements may be used For example when operating on a query based on a Help Desk schema you may code Status 1 RecCtr Tkt HD Ticket IDS HD Summarys The format of the Status message is also used to report the original record being worked on if any errors occur in the processing of that record You may inhibit the status message as well as the end of iteration status message with Status 0 Meta Update 137 User s Guide SJT Software Tool House Inc Sleep Statement A single Sleep statement may be coded in the control section Its function is to act as a governor for Meta Update You can use it to reduce the load that Meta Update will place on the ARS server Sleep recs secs The above sleep will cause Meta Update to pause recs seconds every secs records while processing a File Or Query If Sleep is not coded there is no pausing Launch Statement Meta Update allows you to follow chains of linked records One control section can launch other control sections which can in turn launch still others For example let s say you have the following tables Organisation 1 many Sites 1 many Services You want to write a script to invalidate all Services belonging to an Organisation You write a Meta Update control section that queries for the single Organisation record you wish to invalidate services for This c
230. ng Produces large output and slows throughput d Full tracing into SthMupd log with no 2 or ARS server tracing d Full tracing like d plus 2 and ignores script Trace commands din vy Tracing x specifies tracing levels qsad2flp y ARS client tracing flags fsap f is the tracing file name local or Caution global q quiet Quiet inhibit all output to stdout not log v Verbose same as d qsa switches for script development g Debug Mode enter script debugger help for commands e single Error terminate job on first error for script dev test switches for specifying servers Note that servers must be licensed Set defaults with SthLic cmd server server the Main server default ENV ArsSvrAdmin user user the Main server s ARS user default ENV ArsUsr password Enc xxx the Main ARS User s password default ENV ArsPwd port port the Main server s ARS Port or 0 default ENV ArsPort other switches help more detailed help pipe to more Deprecated positional argument synopsis SthMupd switches script file section p script argl arg2 arg3 Poe ee ee For more details execute SthMupd help 143704 690 i terminating successfully in 0 sec In the local trace version the d switch causes a high level of tracing This data is appended to a file that will grow if not deleted occasionally Without the d the file will still be continually added to but at a much reduced volume Only Error and o
231. nneennnnnnvennnnn 226 CTL Meta Update InformatiOn rassrnnnnvnnnnvnnnnnvnnnnnnnnnvnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 227 Arg Program ArgumentS msrunnnnnnvnnnnnnnvnnnnnnnvennnnnnnnnnnnnnnennnnnnnnnnnnnnennnnnnnnnnnnnnnnnnnnnnnnnnnnnenn 228 ENV The Environment srennnnnnvennnnnnvnnnnnnnvnnnnnnnvennnnnnvennnnnnvennnnnneennnnnneennnnnnvennnnnneennnnnneenennn 228 AR INFO ARS Server Information rrnnnnvernnnnnvennnnnnvennnnnnvernnnnnnennnnnnnennnnnnnennnnnnnennnnnnenr 228 RadSvr AR INFO ARS Server Information rrxsavonrnnnnvennnnnnvennnnnnvennnnnnvennnnnnvennnnnnvenennn 228 AR INFO Table of Fields and Values s rrrrsnnvnnnnnnnvennnnnnvennnnnnvennnnnnnernnnnnnennnnnnnernnnnnenr 229 CTL Schema Tag sssenies caciscsce seneecabecte esececeetiencueeede sa veatceetoctedenece vane seenceceede cunt veke naensnennnddeene 236 Licensing sutta keen 240 Howilt WOrks sissies oe ects ees ot ee ene etre cece te eet ee eats 241 Specifying The License Key rserrnnvvnnnnvnnnnnvnnnnvnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 243 Installing the def File sa ees woes Sate Secs dE 245 Meta Update 6 User s Guide SAY Software Tool House Inc ELT gg ol MS u ieaiaia 255 AR Schema Report vue EENS VESEEESEEEEEEEENEEEEEESEEEEuEER 258 AR Server Info Report rnnnsvnnnnnvnnnvvnnnnvnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 261 Ticket Creation Batch Command
232. nnnnnnnennnnnnnnnnnnnnnnnnnnnnn 84 Meta Update Line Numbers srennnnnnvnnnnnnnvnnnnnnnvennnnnnvnnnnnnnvennnnnnvennnnnnnennnnnnnennnnnnnennnnnnnennnnnne 85 About Meta Update Break POintS rssrernnnnnvnnnnnnnvennnnnnvnnnnnnnvnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnenr 86 Debug Commands smnssesteirisanerdseemenet tsgnczcheceeccetegsicrssucencoduegeutersscenccuedcuneersueserstesenccezesenes 87 Bister 87 List kes 88 B cklrace EE 88 Pim 252 89 NN 89 OT TE SEENEN E ES 90 UNE EE MM 90 Break EE EE ME ne 91 Script Reference ee EES 95 Script File General Format rsernnnnvnnnnvnnnnnnnnnnvnnnnvnnnnnvnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnne 96 Including Other Script Files rrrnvrnnnnvnnnnnvnnnvvnnnnvnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 98 Section Types ee Ee EES EE EE 99 LEKT EE 100 Read Server Sections rmssrrnnsvnnnnvnnnnnnnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnennnnnnnnnnnnnnnennnnn 107 Control Sections 240 tasters eek aa aaa 108 About Control Sections rrnnvrnnnnvnnnnnnnnnvnnnnnvnnnnnnnnnnnnnnnvnnnnnvnnnnnnnnnnnnnnnnennnnnnnnnnnnnnnnnnnnn 108 Keywords and Statements rrrnnnvnnnnnvnnnnvnnnnvnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 109 Load Statement Ssss aenaran n ean aaarnas aaeanoa eee 117 Q ery Statements ess NEESS ENEE EH 118 QuerySql Statement rsernnnnvnnnnvnnnnnnnnnnnnnnnvnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnenn 122 File
233. nnnvennnnnnvennnnnnvennnnnnvnnnnnnnvennnnnnvennnnnneennnnnnnennnnnneennnnnneennnnnne 60 Script Path Environment variable rrrnavrnnnnvnnnnnnnnnvvnnnnvnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnn 60 API Retry Environment variable rrnnnnvonnnnnnvennnnnnvnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnenn 61 License Environment Variable ssrnnnannvvnnnnnnvennnnnnvnnnnnnnvnnnnnnnvennnnnnvennnnnnvennnnnnvennnnnne 62 The Gommand Ines 63 Switehes EE 64 Usage Help Text Lee Scent 65 Using Positional Arguments Deprecated rrrnnnnvnnnnnnnvnnnnnnnvnnnnnnnvnnnnnnnvnnnnnnnvnnnnnnne 66 Meta Update 4 User s Guide SAY Software Tool House Inc Program Return Values rrnnnnnnvennnnnnvnnnnnnnvnnnnnnnvennnnnnvennnnnnvennnnnnnnnnnnnnnennnnnnnennnnnneennnnnnnennnnnne 67 Program e e UE 68 LCTO EE EE 71 Local Tracing E 72 Server Tracing ecescncccsasecescecececce sine exseeecentcectuere dene catereedenedeeuessiireatectveneoseuiecvesereneeceetder 73 Trace re 1 ee n 75 Firing from WorkflOw seiscmnir 77 Developing SCHIPUS ie ccsnccccicecscceeesntiecice exseescenteeetderedentsenteestsene donuts starentectdenesestieeusentennesestiere 78 Script Debug gO araa earren aa e raaa Aa raap A ao aaan aHa ap eske Guwebecevevatexsucecstucucs 82 What Is Script Debugging srrnnnnnnnnvvnnnnvnnnnnnnnnnnnnnnvennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 83 Entering Debug CommandS rrsavnnnnnvnnnnnnnnnnnnnnnnennnnnnnnnnnnnnnnnnnnnnnnnnnnnn
234. ns true This is called Iteration Assignments Assigninit A control section can Create or Update ARS records or file S N SS gt NS records and can De Loop Loop Loop Loop we for each for each for each for each Launch other control tere Query QuerySql File Loop only tesut record record record di ry or sting value sections to create or update more ARS or file records 1 armen next ARS record next SOL row next File row A control section tells what output if any to produce the target form schema whether this will be updating or submitting new records whether this will use the normal Submit or Modify API or use Merge It also gives the assignment section names to be applied to the target update record and lists any assignment sections to be applied when the control section starts ends or before or after the iteration record is loaded means Seet AssignPostFail AssiqnPost ry aber Gir Coraval sections keratvely A control section can also Launch or call other control sections in order and conditionally These can process queries dependent on this query s retrieved records or the first section s record and can create other outputs and launch other sections as needed A control section can also have no output at all It can be used to group several control sections or decide which control sections to launch based on arguments
235. nses MaxOutput Optional Limits the number of outputs for the entire job to a specified maximum Any single record Updates Creates File writes is considered in this maximum The default is 0 which means unlimited This is useful during development of scripts that return large query results or process large files RandSeed Optional Meta Update by default seeds the standard random number generator with the run time at start up You can have Meta Update not seed the random number generator by specifying RandSeed No Note that the sequence of random numbers generated on each run will always be the same for a script that does not seed the generator QueryDbNames Optional Meta Update by default allows a field s database name to be used within single quotes in a Query Meta Update pre scans all Query qualifications and if it sees a field s database name will substitute the field Id within the single quotes This is especially useful as field labels can change when multiple languages are installed and a forms default view is changed By specifying QueryDbNames No there will be no prior scan of qualifications TimeOutNormal Optional Can be used to increase the Normal timeout value for this session Only available for ARS Release 6 3 or above The default or minimum is 120 seconds This value applies to record reads and submits If a lot of workflow is run when a record is submitted raising this value may correct the p
236. nt that assigns OK to the stdout variable if the file exists Note that because of the UNIX if shell syntax the stdout and stderr redirection does not come at the end of the command line and is explicitly stated Do will Launch Do Att Flds once only Do Att Flds processes the Attachment Fields CSV just building a script array of Attachment Field Names and Field IDs and setting the number of attachment fields If there are no attachment fields the CSV was not created and the number of attachment fields remains 0 Do Att Flds makes no output so only an AssignPre is used That AssignPre section increments the number of attachment fields counter and sets the Field Name and Id into the array Do Att Flds asg For each field increase the number of fields and set it in the Va Fnm and Fid arrays Increment Va Max D i Cmd Ref Va Max eval SVa MaxS 1 cmd Ref Va Do asg FF This assigns a series of field value pairs to the Va Do asg FF tag We use references in Fnm Va Max AttFldNm Side MaxS ees the fields to be assigned Tags built are like this Va Max 2 Va Fnml Attachmentl Va Fidl 5378001021 Va Fnm2 Attachment2 Va Fid2 5378001022 Do then Launches Do Load the backup file handling section since all Attachment fields are now known Do Load Processes the passed backup data file and updates the passed table using 1 the first field of the file
237. number of Development time fifteen minutes 22 lines AR Info Report records they contain It queries the arschema table does a select count for normal tables and generates a CSV This is a good beginners script It shows how to code a script so that server information is referenced and the script can be used in many ARS server environments without changes In addition this demonstrates a SQL Query iteration using QuerySql as well as a QuerySql used inside a LookUp section This simple script creates a CSV listing the predefined server information tag AR_INFO Development time fifteen minutes 22 lines Ticket Creation Batch Command Development time one hour Closed Ticket Duplicator Real Customer Problem Development time three hours Meta Update It is useful for gathering the server information required for a BMC ticket The script simply loops through the predefined AR_INFO and outputs a CSV file This is a good beginners script It shows how to code a script so that server information is referenced and the script can be used in many ARS server environments without changes A simple script that creates a ticket accepting different command line parameters This script demonstrates the simple creation of a record based on command line arguments It introduces the common elements of a Meta Update script A mail robot must not reopen a ticket nor attach an email to a clos
238. oads are processed based on a Query In this case the query must result in one and only one record LoadQ PplReq SHR People People ID SArg Pplids Loads are processed in the order that they are coded and all the loads are completed before the assignment process begins Note that Loads may be replaced by LookUp assignments These allow multiple records default values in case of no matches and cache records in memory Meta Update 31 User s Guide SJ Software Tool House Inc Types of Sections This list summarises the types of sections used by Meta Update Main Read Servers Control File Field Assignment LookUp Meta Update Gives the update ARS server and sign on information and the Meta Update licensing information Specifies additional read ARS servers and sign on information Specifies the operations you want Meta Update to perform These are the heart of Meta Update scripting Defines the format of an external ASCII file Specifies the fields and field interpretation transformation rules of an external ASCII file an SQL row a regular expression extract Contains the actual field assignments to be made to the target form Also used to assign script variables and control script execution Used in an Lookup assignment to provide a mechanism for translating data values 32 User s Guide SAY Software Tool House Inc Control Sections When you fire Meta Update
239. of itself Performance alone makes this option not usable It will have a higher development cost than Export Import and easily rival or surpass API Meta Update 13 User s Guide SLAM Software Tool House Inc Meta Update A New Way to Use The API With Meta Update these types of problems are handled quickly with ease and confidence There is no need for an API programmer or any programmer at all The ARS Administrator Developer scripts complex functions in the language he already knows in minutes He fine tunes mappings and assignments and gets his feedback immediately His runs are fully logged allowing complete resolution and recovery Development efforts for any migration or file import requirements are reduced to at least 1 10 That s an order of magnitude savings on the initial development effort compounded by fewer resources required to maintain or enhance scripts from the deployment on Compound that development savings with the confidence you get by using Meta Update The performance is that of the API run on the server or client Jobs complete with Log and Continue error processing Errors produce complete resolution and retry information logs Jobs can be broken up in batches and run simultaneously on one or more machines Core fields can be easily assigned on both primary and secondary forms CSV files that fail on the import tool can be handled easily Transactional files can be handled Dates ti
240. of lines as the character is permissible in ARS form names field names and queries e Lines can be continued by having the last non blank character of a continued line be a backslash V or ampersand character amp e If a backslash is used all spaces preceding the continuation character and at the beginning of the next line are significant No additional spaces are inserted e If an ampersand is used all spaces preceding the continuation character and all leading spaces on the continuation line are removed and a single space is inserted e The include file directive will include the whole of another script file and then continue reading the source file at the same point The resulting script is a merge of all source script files Meta Update All section names and keywords are case sensitive Keywords within a section can be placed in any order but are processed in the order that they are encountered Sections can be placed in any order and can be split Equal signs only are used to separate a keyword from its value 96 User s Guide SAY Software Tool House Inc e The file may be in either Windows or UNIX formats That is lines may be terminated by either lt If gt or lt cr gt lt lf gt and a single end of file marker Z will be ignored if present as the last character of the file Script files may be used across both platforms The validity of the INI file can be checked with the siniget exe progra
241. og statements IdLogs are recognized as the same when they have the same Tag It is an error to specify two IdLog statements with the same Tag and different file names or different file sections You can use the same Tag in a Launched section s IdLog to specify a different assignment section That section could include the launched section s IdLog assignments if needed Once an IdLog event is taken and before the assignment section is started some Tags and fields are assigned values These can be referenced in the IdLog assignment section CTL IdLogging 1 or 0 to indicate that IdLogging is turned on CTL EvSec the section name of the last Id Log event The Tag for the next variables is a concatenation of CTL and the section name as given by SCTL EvSec CTL EvSec EvIdLog the Tag from the IdLog statement for this event CTL EvSec EvName the Event name one of the Event keywords that can be specified on the IdLog statement as described above Meta Update 140 User s Guide CTL EvSec CTL EvSec CTL EvSec CTL EvSec CTL EvSec CTL EvSec CTL EvSec EvSch EvServer EvUser EvRc EvOp EvOp2 EvKey SAY Software Tool House Inc the Schema name which may be when there is no schema the ARS Server of the event the ARS Server s User of the event the event s error code 0 means no error the event operation see below either Merge or the Key value as specified in the IdLog
242. oint and returns debugging control to you n Next Execute next instruction See also Continue Mupd Dbg gt Meta Update 89 User s Guide SJ Software Tool House Inc Continue Use Continue to resume normal execution of your script until a breakpoint is reached or the end of the Meta Update job is reached A normal begging session begins with setting various breakpoints and then continuing execution until one of those breakpoints is reached Mupd Dbg gt h continue The Continue command continues script execution until the next break point is reached Use break clear all to remove all breakpoints before entering the Continue command to run the script to its end c Continue Continues script execution until the next breakpoint is reached or until the end of the Meta Update job See also Quit Mupd Dbg gt Quit Use Quit to terminate the Meta Update job immediately An error message is written and the Meta Update job ends abruptly A normal debugging session begins with setting various breakpoints and then continuing execution until one of those breakpoints is reached Mupd Dbg gt h quit The Quit command terminates the Meta Update job immediately Use Continue to continue script execution until the next break q Quit Terminates this Meta Update job immediately with an error See also Continue Mupd Dbg gt Meta Update 90 User s Guide Break Ce Software Tool House Inc Use Br
243. ol House Inc Meta Update 248 User s Guide SJT Software Tool House Inc ARS Authentication Password Encryption ARS user Passwords can be encrypted using a utility Once encrypted only the same OS user that encrypted the password can use that password The SthLic cmd and SthLic sh scripts that set environment variables for a licensed server and authentication can be automatically generated on all supported platforms see below These files will allow the setting of environment variables by specifying the desired server So that for example a query can be run against one server and then run against another server All utilities bundled with Meta Update will accept either plain text or encrypted passwords in all the methods that ARS Passwords may be set on the command line in scripts or in environment variables If using ARS password encryption the supplied passwords must be encrypted for each Windows or Unix user that will use Meta Update The encryption decryption is dependent on the currently signed on user A new version of the files SthLic cmd and SthLic sh must be generated for each Windows or Unix user even if the ARS User is the same This means that when using ARS Password Encryption the files SthLic cmd and SthLic sh cannot be copied from machine to machine and if a single machine is used by more than one user different SthLic cmd and SthLic sh files will need to be used by each user Meta Update
244. onal settings on the machine running Meta Update The format of the ARDATE value differs for UNIX and Windows Meta Update 221 User s Guide SAY Software Tool House Inc These summaries of ARDATE syntax are taken from the BMC Action Request System 7 6 03 Form and Application Objects document This table lists the UNIX field descriptors that you can use with ARDATE ARDATEONLY and ARTIMEONLY Descriptor Function Same as a Day of week using locale s abbreviated weekday names YA Day of week using locale s full weekday names b or h Month using locale s abbreviated month names B Month using locale s full month names d Day of month 01 31 D Date as m d y e Day of month 1 31 single digits are preceded by a blank H Hour 00 23 K l Hour 00 12 KO Hour 0 23 single digits preceded by a blank Sun Solaris operating system only m Month number 01 12 M Minute 00 59 Pp Locale s equivalent of a m or p m whichever is appropriate Yor Time as I M S p R Time as H M S Seconds 00 59 T Time as H M S W Day of week Sunday is day 0 X Date using locale s date format X Time using locale s time format y Year within century 00 99 BY Year including century for example 2004 Table 1 ARDATE Field Descriptors for UNIX This table lists the Windows field descriptors that you can use with ARDATE ARDAT
245. onment variables in the current Window for any given Meta Update licensed BMC Remedy server It also sets the license variables for all Meta Update utilities SthLic cmd or SthLic sh are generated by a utility called SthLicUpd or the Software Tool House License Upda ter See Running SthLicUpd above for more information The following keywords are available in Main ARS Authentication Server Specifies the server connection address May be a reference Must resolve into an IP address that has an BMC Remedy Server listening for API requests Port Specifies the BMC Remedy Server s Listen port Use zero when the server uses Port Mapper RPC Specifies the BMC Remedy Server s RPC Listen port Not used by Meta Update User The BMC Remedy server Login Name to be used for the script It is highly recommended that this user be an administrator and have all ITSM rights Some script operations such as QuerySql1 require Administrator rights When a non administrator is used it is possible for scripts to be denied fields records or operations Password The above user s password May be an encrypted string as ARS Session Contr ol TimeOutNormal Specifies the Normal time out value Default and minimum is 120 seconds Primarily used for reads and updates May be a reference TimeOutLong Specifies the Long time out value Default and minimum is 300 seconds P
246. ontrol section launches a second control section that queries for all sites associated with this Organisation That second control section processes a set of Site records and for each of those Site records launches a third control section that queries for all services associated with that single Site record being processed That third control section invalidates the Services records for each Site of the Organisation Org Query Org Organisation 1 001 Launch Site Site Query Site Site Organisation ID SOrg 1 Launch Services Services Query Service Services Site ID SSite 15 Assign ServiceInvalidate ServiceInvalidate Status Inactive Launches can be made conditional That is the Section name launched can be build and selected from ARS data or other loaded data Launch if Cfg DoHtml Do Html Meta Update 138 User s Guide SAY Software Tool House Inc IdLog Statement An IdLog is used to create a delimited file with a row for each record processed read queried updated You can specify multiple IdLogs and events that the IdLog will be created for You can also control the format and content of the IdLog fields An ldLog is primarily used to track errors so that a subsequent Meta Update run can process only those records that resulted in errors Syntax and usage of IdLogs On Fdef IdLog Update Update Create Create Ite
247. ops for this record and no other sections are launched for this record Note that if the Severity is Error the message appears as an error but no actual error condition is raised Also note that if the message severity is Debug debugging logging must be turned on for the message to appear Launch This is a keyword that must be coded as is If coded any Launches coded will be executed This is not the default behaviour Note that the record being created or updated cannot be reread as the update was aborted and so there should be no references to the Update tag in any Launched sections Message Any string including any string references Defaults I User Abort taken for CTL Operation on SCTL Schema ID CTL IDS AttachSave Command The AttachSavecommand allows you to save an attachment reference on the machine that Meta Update is running on Cmd AttachSave Tag Fld FileName Tag This is the Tag containing the ARS record that will have an attachment field that needs to be saved Meta Update 174 User s Guide SAY Software Tool House Inc Fld This is the field name or id of the attachment field FileName This is a reference string that will be the name of the file Examples cmd AttachSave Src Attachl Src Attach1 In the above example the attachment field itself is used as an output file name Note that this will fail if the path information is incorrect or the paths do not exist You can use regu
248. or a diary field picked up by SQL This is a string delimiter A delimiter can be a single character or a string It can also be a reference that evaluates to a single character or a string If the delimiter is a string it can be anchored by prefixing the string with a single or double cimcumflex character or 4 or by suffixing the string with a single A prefixing means that the delimiter will match only if it is preceeded by a new line or is at the start of the string The is not matched A prefixing AN means two new lines must precede the delimiter string to be considered a match A suffixing means that the delimiter will match only if it suffixed by a new line or the end of the string Newlines may be in either Windows or UNIX formats on either OS If the delimiter is a single character the values iterated through the looped strings do not include the delimiter If the delimiter is a multicharacter string the looped strings include the delimiter string Delimiters may be quoted and may contain escape characters for example An or 013 The string is parsed into an array of strings by using the delimiter as a separator A non null string with no delimiters returns a single complete string An optional sort if specified must be coded as one of forward ascending asc reverse decending In the natural order that is the source order within the string or diary fie
249. or file name NULL for SQL queries Key The value of 1 for ARS schemas of a string made of the first few attributes for SQL queries files and Loops Operation One of Read Update Create Op2 Either blank or Merge Result One of OK Err or Err followed by an error message Fname Required when any IdLog Tag is first used Optional otherwise It is an error to use a Tag twice with different Fname values Specifies the name of the output IdLog file associated with this Tag Key Optional A reference string that is used instead of the default key value generally containing references from the sections iteration Tag Fasg Optional A single assignment section name This is used to override the default assignments as given above or to assign values to other fields defined in the file section for this IdLog For example you could add some fields from an SQL query to the IdLog and use the assignment section to assign values to the added fields and even to change the assignment to automatic fields such as the Schema or Key field Only a single assignment section can be specified That assignment section can include other assignment sections record loads lookups spawning of server or client processes and so on As many IdLog statements as needed may be coded in control sections When a section with an IdLog launches other sections the IdLogs are carried through to that launched section unless that launched section has its own IdL
250. ories needs to be in AE the PATH environment variable Set PATH D Apps Sth Meta Update 5 56 PATHS The program operates in a Command Prompt or DOS Box or as a fired process Local trace files are written in the current working directory by default On Solaris or Linux one of the two the Meta Update bin and bin64 directories needs to be in the PATH and LD LIBRARY PATH environment variables export PATH D Apps Sth Meta Update 5 56 SPATH export LD LIBRARY_PATH D Apps Sth Meta Update 5 56 LD LIBRARY PATH The program operates under any of the available shells or as a spawned or background process Local trace files are written in the current working directory when not specified Meta Update 56 User s Guide SAY Software Tool House Inc BMC Remedy API Versions Meta Update is generally compiled against the most current BMC supplied version of the BMC Remedy API The Meta Update distribution includes all BMC supplied dlls that are required The Meta Update API version does not need to match the version of the servers that Meta Update establishes with Meta Update can establish multiple connections to different Remedy servers of different releases Software Tool House always recommends that the highest API version is used no matter what your server version is Meta Update 57 gt User s Guide SJ Software Tool House Inc Program Versions There are two versions of Meta Update and bundl
251. ouse recommends the use of switch based arguments for clarity By convention in this document and in our samples script arguments are specified after the script file and section name gt gt gt SthMupd exe 090 SvrAdmin 221 SwLogs ini Do Line 28 required argument log not on command line no default specified E Function E This is a Meta Update script that switches the ARserver log files E E Usage E SthMupd 221 SwLogs Do log XXX E where XXX is a log file name without a path E and without the log E The path and log are configurable E in the script E Examples E SthMupd 221 SwLogs Do log my E will set all log files to apps bmc ARSystem db my log E E terminating unsuccessfully in 2 sec Meta Update has a set of switches that may be specified on the command line Each script can also define a set of arguments that may be set on the command line Entering the Meta Update command with no arguments yields usage help Entering the Meta Update command with the single help switches yields more detailed help SthMupd exe SthMupd exe help more Meta Update 63 User s Guide SJ Software Tool House Inc Switches Entering the Meta Update command with no arguments or the single help switch yields usage help SthMupd exe SthMupd exe more Logging d Specifies logging By itself all specified full debugging logs to the default log file with no ARS Server logging and no
252. ower of Meta Update scripting When you launch a section all of the references in all the previous sections is available to the launched section The update record is reread after the update to ensure all workflow results are available to the launched section Meta Update 34 User s Guide Software Tool House Inc Control Section Flowchart This flowchart summarises a Meta Update control section s operation JL Assignments AssignInit lt gt EN NS Plen SS gt Gp eS Do Loop Loop Loop Loop one for each for each time Query Loop only result record diary or string value retation N Load and transformation rules EV nothing next ARS record next SQL row next File row next Value ge GT Ge Me E ene ee keen geen Ven Weem P AssignPostok AssignPostFail AssignPost Assignments AssignPostLaunch e eee te eee eee eee N A Assignments AssignTerm Meta Update 35 User s Guide SJ Software Tool House Inc Iteration A Control Section may either iterate or not If it does not iterate it performs its cycle once and once only If it does iterate it loops picking up a new record during each iteration and performing the actions specified which can include creating or updating other records and launching other control sections The absence of an iteration statement tells Meta Update that the control section wants to execute once and once only Th
253. owerful LookUp facility The LookUp facility can cache records handle multiple records as a result of a query and succeed even if no record is loaded A LoadQ is used to query for and load a single record into the specified Tag LoadQ Meta Update Optional Loads specify a query that must return exactly one record LoadQ SvrTag Tag Schema Query Any number of load statements may be in the control section or in the assignment section These are processed in the order they are encountered with those in the control section being processed before those in the assignment section All loads coded in the control section before the iteration statement Query File Loop QuerySql are processed before the iteration statement if coded The iteration statement may reference fields from any of the preceding Load statements Loads following the iteration statement can refer to data from the loaded records or from the record loaded by the iteration statement Then the Update is processed possibly resulting in another load The Update can refer to any loaded record in the control section including the record from the file or query 112 User s Guide SAY Software Tool House Inc Finally the assignment sections are processed In any one assignment section loads are processed first then an update record is built up After all the sections are processed the update is applied About Iteration Statements
254. p MyScript 11582 inp txt when running a script called MyScript under the Process Id 11582 Cmd Reference Tag Name val Use this to extract a value from a dynamic SrcTag and SrcFld Both of these and be string expressions This is an alternative to using the info reference command when the SrcTag and SrcF1d are known to exist and you are only interested in the value Cmd Reference Tag Name LookUp Use this to perform a LookUp possibly loading a record and load the returned value into the Tag and Name field See LookUp Sections below Cmd Reference Tag Name if 180 User s Guide ACmd Cmd Cmd ACmd Cmd Cmd Meta Update SAY Software Tool House Inc Use this to assign a value conditionally The if can be of these two different formats Reference Tag Name Gif exp rueValue Reference Tag Name if exp TrueValue FalseValue In the first case if the expression is false no assignment is made to Tag and Name If Tag and Name were not defined they would still be undefined In the second case an assignment is always made to Tag and Name Reference Tag Name Section The section is a string pattern assignment section A string assignment section comprises the normal cmd keywords as well as the special keywords string and File These special assignment sections can be used to build long strings Each separate st ring is implicitly terminated with a new line
255. parameters This form needs to be installed using the ARS Remedy Administrator Tool Simply import all definitions included in the SoftwareToolHouse def file which comes in the Meta Update distribution See below for more information about installing this form To add the license key bring up the SoftwareToolHouse form in the ARS Remedy User Tool Note that the ARS user must have Administrator privileges to see this form If you are replacing a key search first using Meta Update as the Application and License as the keyword Then modify the Value field to reflect the new license key If you are creating a new record select Meta Update as the Application Leave the Section field null Specify License for the Keyword and then type in the license key For the above example the form would look like this Meta Update 244 User s Guide SJT Software Tool House Inc Installing the def File The License key and other server wide settings for Software Tool House Inc Applications can be specified in a form called SoftwareToolHouse An ARS Remedy Administrator Definition file SoftwareToolHouse def is included in the Meta Update distribution You may also download the def from the web See http www softwaretoolhouse com products ShtMupd licensing htm By running the Remedy ARS Admin tool you can import this SoftwareToolHouse def file into your ARS server Import Definitions Aystable Deche O
256. pdate 210 User s Guide SAY Software Tool House Inc When you use the QuerySql keyword all other related keywords are also required Other LookUp mechanisms including an internal list of value pairs a list from an external file an ARS Query will override or be overridden by the SQL query coded here If a result is found the SQL query is not executed at all The order keyword controls the order in which the LookUp mechanisms are searched LookUp Section The Order Default D FG keyword controls NoMatch I D W E the search Default Skip Error sequence of Order QuerySql List LookUp mechanisms LookUp Val Val LookUp Val 2 Val 2 ge 5 The full features of 6 gue SEA T ae QuerySql can be uerysd agovr ag OO pod Select fld a fld b fr used including Where frd took p field interpretation SCTL ED Up Src rules QuerySqlTarget STag fld Stag fld b QuerySqlMulti First rror QuerySqlTarget LookUpSq1Flds is used to build a fld a Subst _ LookUp return fld b Date julian string from the columns in the row and other references QuerySql Specifies that an ARS server SQL Query will be used to select a row with QuerySqlTarget QuerySqlMulti Meta Update which to build the returned string The Querysq1 is coded exactly as in a Command Section see Query SQL Statements above If the Querysq1 matches a row the Tag is used to hold the loaded values The
257. pdate query returns no records May output a new file of a multi pattern file or a new record in a single pattern file or a new record in a columnar file Control sections specify sets of assignment sections that are called at different times during the control sections iteration or to handle the output assignments Assignment sections are listed with different keywords and a control section They gt specify the assignment sectionss to be applied to the target update record for create or update or for the file output fire once when the section starts fire after the next iteration record or value is loaded but before an output is applied fire if an update is applied successfully fire if an update had an error fire after an update is applied but before other sections are launched fire after all Launches are processed fire once on section termination Assignment Sections VVVVVVV Assignment sections can load records SQL data files and transform data They can launch client or server processes They offer nested ifs includes regular expressions arithmetic date operators In short they offer a rich facility for transforming data Meta Update 33 User s Guide SJ Software Tool House Inc Finally a section can launch other sections All previously loaded Launching references are available to the inner launched section These or launches can be conditional Nesting The Launch is the key to the p
258. place holder This is followed by the argument values specified in the same order as the Arg or ArgNm statements in the script As this is deprecated Software Tool House recommends updating any batch files or PROCESSS filters to use the new switch based command line syntax Meta Update 66 User s Guide SAY Software Tool House Inc Program Return Values The program returns a zero upon successful completion If any errors occur the program returns 1 This value may be used in scripts to decide a course of action Errors and important informational messages are reported the trace file They are also echoed to stderr generally the console stderr may be redirected On UNIX and Windows the syntax is the same SthMupd exe a cad 2 gt gt errors txt Or SthMupd exe S Le A 2 gt errors txt The first command appends between runs The second creates a new file each time This file may be examined with any ASCII editor such as Notepad Word vi The format of the trace messages are explained further in Tracing below Note that error messages are also always written to stderr which is generally the console window If redirected as in the above example command invocations Errors and Warnings may be grep d or find d from this file See Tracing below for more information Meta Update 67 User s Guide SJT Software Tool House Inc Program Output Unless the q switch is used Informational Warning and Error
259. r INC CAL00010021 Incidentally the following command assigns the same string Cmd Reference Tag Name Incident Number amp SSrc Incident Number However when Value is a not a constant but a reference such as from a configuration the Gfmtqry is needed Many values to a Tag Cmd Reference Tag Sec e When the Name is a single it tells Meta Update to treat the value as an assignment section where any field can be assigned a value All fields become a field of the named Tag This is a good way to assign many fields to a single Tag in one section Sec This is the single section name that will be executed All new fields are added to the Tag This can be a reference Assigning a field twice causes concatenation If you need to initialise specific elements of the Tag or delete the Tag before this reference command After either of these two assignment sections is executed the following references will be defined SV vis vi val SV v25 v2 val SV v3 v3 val Asg Asg Cmd Ref V vil vl val Cmd Ref V Asgvl Cmd Ref V v2 v2 val Cmd Ref V v3 v3 val Asgv1 v1 vl val v2 v2 val v3 v3 val Meta Update 182 User s Guide SAY Software Tool House Inc Reference Information assigning a set of values using references for a Tag and Field The info command assigns a specific set of fields describing the single reference Tag
260. r IterEr Meta Update Tag amp On Eventl Event2 amp Fdef def section amp Fname file name amp Key key amp Fasg assign section The Tag identifies an IdLog file and file section If the same Tag is used in two different dl og statements they must specify the same file and file definition section or an error will result You may change assignments and events on different IdLog statements in Launched sections A special Tag is used to turn off all Id logging for a section IdLog Off Specifies a series of events for which this Id Log will be written to Events are keywords and must be coded exactly as follows a record is updated successfully or not Err a record update failed a record is created Err a record create failed an iteration is done the next record SQL row or file row is read or the next loop value is processed r an iteration failed Optional Specifies a file section The IdLog will be written with the fields and attributes of this file section Automatic fields if not specified will be added in sequence after the last field specified To change the order of the automatic fields in the output file specify them in the file section If a file definition is not specified only the automatic fields will be in the IdLog file 139 User s Guide SJT Software Tool House Inc These are Time The time of the event Server The ARS server name User The ARS user Schema The schema
261. reference or constant with the name of the ARS form Any form name with spaces or special characters should be enclosed in quote marks SrcTag This is a reference to a string Tag that contains a minimum number of specific fields and appropriate function for the Set operation being performed For the Archive settings the following fields may be set Examples Do AssignInit asg Arch asg None asg Arch Cmd Ref Arch ArchName HPD Help Desk ARC Cmd Ref Arch ArchType Form ACmd Ref Arch ArchDelete 1 Cmd Ref Arch ArchEnable true Cmd Set Schema HPD Help Desk Arch asg None Cmd Ref Arch ArchName Kai cmd Ref Arch ArchType None ACmd Ref Arch ArchEnable false Cmd Set Schema HPD Help Desk Arch In the above script the initial assignment section asg Arch will cause Remedy to set the connection between the main and archive forms of HPD Help Desk and HPD Help Desk ARC creating the archive form if it doesn t already exist Then the second initial assignment section asg None will reset the Archive Properties of HPD Help Desk to have no archiving defined This will sever the connection between the two forms HPD Help Desk and HPD Help Desk ARC but will not delete the archive form The archive form will now be considered a regular form Meta Update 196 User s Guide SAY Software Tool House Inc Trace Co
262. reportplugin dll ServerAdmin dl FlashboardObject dll D Apps BMC ARSyst em arealdap arealdap dll D Apps BMC AR System ardbcldap ardbcldap dll D Apps BM C ARSystem approval bin arapprove dll D Apps BMC BMC Service Level Management bin omfbjiefilapidll Ku D Apps BMC BMC ServiceLev 4 elManagement bin arfslasetup dll D Apps BMC ARSystem D Apps BMC ARSystem pluginsvr D Apps BMC ARSystem arealdap D Apps BMC ARSystem ardbcldap D Apps BMC AtriumCore cmdb server64 bin D Apps BMC BMC Service Level Management bin cmdbsvr7604_win64 dll D Apps BMC AtriumCore cmdb server64 bin D Apps BMC AtriumCore cmdb D Apps BMC AtriumCore Logs 0 AR System Log SQL AR System Log API AR System Log Escalation AR System Log Filter AR System Log User AR System Log Alert AR System Log Server Group AR System Log FullText Index AR System Log Thread Pte User s Guide Meta Update FIPS_SERVER_MODE FIPS_CLIENT_MODE FIPS_STATUS ENC_LEVEL ENC_ALGORITHM FIPS_MODE_INDEX FIPS_DUAL_MODE_INDEX ENC_LEVEL_INDEX DSO_MAIN_POLL_INTERVAL RECORD_OBJECT_RELS LICENSE_USAGE COMMON_LOG_FORM LOG_FORM_SELECTED MAX_CLIENT_MANAGED_TRANSAC TIONS CLIENT_MANAGED_TRANSACTION_ TIMEOUT OBJ_RESERVATION_MODE NEW_ENC_PUB_KEY_EXP NEW_ENC_DATA_KEY_EXP NEW_ENC_DATA_ALG NEW_ENC_SEC_POLICY NEW_FIPS_SERVER_MODE NEW_ENC_LEVEL NEW_ENC_ALGORITHM NEW_FIPS_MODE_INDEX NEW_ENC_LEVEL_INDEX NEW_ENC_PUB_KEY CUR_ENC_PUB_KEY NEW_
263. represents the date as above In assignments date fields can be references to ARS fields file fields or strings No reformatting of dates is required as all internal dates have the same format as described above When assigning constants the constants need to conform to the above format When Queries are coded ARS expects a date to be formatted according to the current machine s international configuration Queries using date fields with compare values from diary loops can use the specific reference for that machine s settings The ARDATE environment variable may be set before Meta Update is started to alter how the ARS API interprets dates in queries Any change to the ARDATE environment variable within a Meta Update script have no effect on the ARS API so if you decide to use this it must be set before the Meta Update job is fired Full documentation on the ARDATE specification is given by the BMC Remedy documents The release 7 6 03 documents specifically say that ARDATE has no effect on clients However testing with Meta Update scripts has proven that if ARDATE is set before Meta Update begins then dates in Queries are interpreted according to the ARDATE setting If the same Meta Update script is to be run on different machines with different regional settings and dates are specified in Queries then it is a good idea to set the ARDATE environment variable so that the queries will be interpreted in the same way no matter the regi
264. rguments trump environment variables as well Single record operations License XXX such as Get Update Create Extra optional vars TimeoutShort 40 Multi record operations such TimeoutNormal 60 as Query and QuerySal TimeoutLong 200 Client type can be used by workflow Admin operations Not used ClientType 0 by Meta Update ENE Script entry point Issues a Do QuerySq for all regular forms in arschema Q m PD D Za This is the entry point and simply issues a QuerySql on arschema looking for regular data holding tables QuerySql ArSch na select name schemaid from arschema where schematype 1 AssignPre asg Msg Meta Update 259 User s Guide SJT Software Tool House Inc asg Msg Available Tags h f d ArSch An SQL record with two columns assignment section There Name 1 and SchemaId 2 is no output The function of this Pre assignment section is to issue the warning message by way of the Cmd Msg assignment command Prior to doing that we need to issue an SQL query to get the number of records in the form This LookUp assignment is passed the ARS Table Schema ID and uses a select count query on the T table is A i Cmd Ref V Count amp This ssignment LookUp amp Command sets a script LkUp Count amp variable V Count tolthe ArSch 2 single SQL row column select count from
265. ried or read from A Tag or name is specified to identify the server All read server sections are identified on the ReadServers entry in the Main section Main ReadServers ReadSvrl ReadSvr2 ReadSvr1 Tag Svrl Server TIB 2a L2 L Port SArg Svrlports RPC SArg Svrlrpcs User Demo Password XXX TimeOutNormal 240 TimeOutLong 600 ReadSvr2 Tag Svr2 Server 198 2 12 2 User Demo Password XXX TimeOutNormal 360 TimeOutLong 1200 The Tag specifies the word used to identify the ARS Servers in the control section s Query Or Load statements Read Servers do not need to be licensed Sessions are established for each ReadServer section specified in the Main ReadServers values Like the main section values for Server Port RPC User and Password may be string references Values may also be set for time outs and for Client Type Meta Update 107 User s Guide Software Tool House Inc Control Sections About Control Sections A Meta Update Control Section tells Meta Update the operations to perform When you fire Meta Update you pass it the first control section s name You may code many sections in the same file A control section may execute its process once or may loop through the records returned by an ARS Query or an SQL Query gt records read from an ASCII file gt values extracted from a string or a Diary field gt the fields of a record gt while any condition remai
266. rimarily used for queries May be a reference Locale Specifies the BMC Remedy Server s RPC Listen port Not used by Meta Update ClientType The BMC Remedy server Login Name to be used for the script It is highly recommended that this user be an administrator and have all ITSM rights Some script operations such as QuerySql1 require Administrator rights When a non administrator is used it is possible for scripts to be denied fields records or operations Meta Update 100 User s Guide SAY Software Tool House Inc Password The above user s password May be an encrypted string starting with Enc or a plain text password Use for no password Meta Update Licensing License The License key may be specified in the script This is not recommended as there are other more convenient ways of specifying the license key including by using the Windows batch file SthLic cmd or the Unix shell script SthLic sh Meta Update Scripting Options MaxOutput nnn Default none Can be used while developing scripts Limits the number of Output records This includes Updates and Creates QueryDbNames Yes No Default Yes Disallow use of BMC Remedy field database names in queries IdLog filename Default none Specifies a default script wide IdLog This has been superseded by the section based IdLog facility Please see Using IdLogs in for more information
267. roblem Symptoms of the problem are an ARS error 92 TimeOutLong Optional Can be used to increase the Long timeout value for this session Only available for ARS Release 6 3 or above The default or minimum is 300 seconds This value applies to record queries If slow queries are run through ARS raising this value may correct the problem Symptoms of the problem are an ARS error 93 or 94 Locale Meta Update 103 User s Guide SJT Software Tool House Inc ReadServers IdLog Meta Update Optional Used to set the ARS servers client locale for the RPC calls in this Meta Update execution Only available for ARS Release 6 3 or above The default is or C The Remedy API uses this client Locale setting to effect character translation to and from the internal database representation and to interpret field labels in queries Meta Update does not validate this setting Please see the BMC Remedy Installation and Configuration manual for more information on the values that can be used in this setting Optional Specifies one or more section names defining additional ARS servers and the Tags associated with them These servers can be queried and read but not written to These servers do not need Meta Update licenses Deprecated and superseded by section IdLogs which allow more functionality such as assignments fields conditions Optional Specifies a file name to be produced This file will be a tab separated
268. rol breakpoints and resume normal execution See Script Debugging below for more information about using the Meta Update Script Debugger Meta Update 78 User s Guide SJ Software Tool House Inc In this example a script Abort was set by an AssignInit section that ensured there was at least one matching Support Organisation Another example where a bad value is passed as a script argument The v switch echoes the eXact query qualifications sent to the Remedy Server Meta Update Version 5 56 x64 f r ARS lib 8 1 2 c Copyright 1996 2015 by Software Tool Rouse ne The script issues several www seftwaretoolhouse com E messages and then an 4159 515 q BO QuerySql Svr sthvl abort 4159 515 q Do QuerySql Qualification 00087select court CTM Support Group where eport Organiza 4159 515 q Do QuerySql Qualifitation 0040 tion Qelp De Meta Update tells you the 4159 515 q Do QuerySgk Tfeturned 1 records of 1 script issued an Abort 4159 515 i DolMsg Found 0 records with Support Organization e aa 4159 515 E Do Msg The Support Organisation argument m t match 1 or more records of CTM Support Group 4159 515 E Do Msg Please check the spelling of yur command line argument 4159 531 E Do Abort aborting 4159 531 E Do asg init AssignInit apply wes aborted in file FD SupGrp Ren ini sg init Cmd line 74 59 53 niRdo of FD SupGrp Ren ini Do failed with 3 ArPu
269. rst record Note that Error will write an error message to the log but will not necessarily cause the LookUp to fail The LookUp search string may still be found through other LookUp mechanisms The NoMatch keyword determines when to do when all coded LookUp mechanisms are exhausted Query records may be cached to avoid the overhead of issuing queries for the same record The default is that the LookUp section does not use a cache See Caching LookUp Records below for more about LookUp record caching Using an SQL Query LookUp sections can also use direct SQL queries to build the translate string The SQL statement is executed by the ARS server using the server s database credentials SQL Queries are similar to ARS Queries The QuerySq1 qualification string will generally have the source reference CTL LookUp_Src in it A Querysq1 acts like a Load but for an SQL row that is allowed to fail The row if found is made available to the rest of the script under the Query Tag given The reference cTL LookUp may be used to determine if the QuerySql was satisfied or a default or other list was used A string reference using fields of the LookUp record found is used to build the return string That string reference is specified with the QuerySqlTarget keyword If multiple rows match you may throw an error the default or select the first record To use an SQL query add the QuerySsq1 keyword to the LookUp section Meta U
270. ry will append an and and any extra query text supplied in the CSV row This makes an and string Cmd Ref Vars Ory if the CSV had an optional SFtbls ModFld gt SArg mod date QueryText value Cmd if Ftbls QueryText W Ref Vars Qry SVars OQryS AND SFtbls QueryText Meta Update 275 User s Guide SJT Software Tool House Inc This section has the CS Tb1 Sync row loaded and does the rest Issues an SQL query to obtain the modified of the work by issuing the record IDs Loads the records and updates SQL Query on the source to phem oi the target server server for the modified QuerySql god request ids loading the Soller record and updating the na record on the target server select SFtbls IdField from SFtbls TblSql where SVars QryS Prod SEG SFtbls TblS vir SSqlLst 18 Update Tgt SFtbls TblS 1 SSqlLst 18 Merge Yes NoWorkflow Assign asg Copy AssignNew asg Copy This section copies the asg Copy source record s fields ES ge e VE including core fields Script Detail The Main section does these things 1 Specifies three argument names with the argNm keyword 2 Specifies the file to be generated as the id log with the IdLog keyword 3 Says that all three arguments are required but does not give additional user help text when those arguments are not specified on the command line 4 Establishes th
271. ryTarget CTL LookUp Src amp SQry Tag fldi lename QuerySqlMulti Optional when QuerySq1 used Default is Error Specifies the action to take when multiple records are returned by the ARS SQL query when the LookUp is done Values are Error and First If First is selected the first record that matches is loaded into the Tag and the LookUp return string is made fusing that loaded record Cache Optional when Query or QuerySql is used Default is off Specifies the keyword off or a number of records to cache Zero indicates an unlimited cache If Cache is specified then any records that match a source string are saved in memory and set as though they have been retrieved again by the Query See Caching LookUp Records below for more information on the LookUp cache The simplest LookUp may include LookUp Section Default CTL LookUp Src NoMatch I D W E Default Skip Error LookUp Val Return Val Return Val 2 LookUp Val 2 Default Specifies a string reference to be used as the value returned when an exact match is not made The Default value is NULL The special symbol CTL LookUp Src may be used It refers to the value passed to the LookUp section It is the value being looked up NoMatch Specifies the actions to be done when the source value is not matched Default is E Error The first value is the type of message
272. s and field names may be coded between single quotes If a field name is used and that field name does not match the default field label in the ARS schema the field ID is substituted before the query is sent to Remedy The values NULL and SNULLS are equivalent and replaced with the NULL keyword with any quotes removed Meta Update 119 User s Guide SJT Software Tool House Inc The query may be tested using Meta Query Using d q or v on the Meta Update run will cause the complete text for all query qualifications sent to ARS to be logged Using d q q on the run will log the query sent to Remedy and if the Meta Update user is in the configured client logging group will also log the resultant ARS Server SQL logs To perform substitution use assignment references wrapped in s Examples are Query SrcSrv amp SrcR amp HPD HelpDesk amp Key SArg Key AND amp Value gt Src TgtValues AND amp Non Null l SNULLS If the command argument named Key had the value Key1 and the value of the TgtValue field in the record loaded as Src was 1 then the substituted query qualification would be Key Keyl AND Value gt 1 AND Non Null SNULLS If on the other hand the value of Key was or NULL the substituted query string would be Key SNULLS AND Value gt 1 AND Non Null SNULLS Note that only
273. s and the launches are processed in order Launching Other Command Sections Each launch allows a new command section to be processed That command process has all the preceding sections references available to it It can query and iterate like any other section Launch TT Orig Upd Launch TT Email Launch TT Hist l TT Hist 2 amp TT Hist 3 TT Hist 4 TT Hist 5 Launch TT New Upd Command Section Overview TT Copy The called or main section lt executes only once Meta Update 272 User s Guide Cie Software Tool House Inc and creates a new ticket It then launches in order these other sections TT Orig Upd Uses a Merge to add the new ticket id reference to the old ticket T Email Uses a Query to copy all emails to the new ticket TT Hist Uses a Query to copy all the history records TT Hist 1 2 45 Uses a Create to create a few new history records for the TT Closed Copy operation TT New Upd Meta Update 273 User s Guide SJT Software Tool House Inc Server Delta Copy This script is created as a learning vehicle to demonstrate several Meta Update statements Requirements A reporting server must be kept in sync with a production server The sync job is run on a 24 hour delay basis The updated records are to be transferred based on the last modification date Request IDs are to be maintained The subset of the tables to be kept synchronised is given by an A
274. s Guide SAY Software Tool House Inc Fieldl Field2 if exp assignment if exp true value false value In addition a full structured if facility is provided Assignments can use either format If the first format is used and the expression evaluates to false the assignment is not made at all If the expression evaluates to true the assignment to the field is made In the second format an assignment to field2 is always made If the expression is true the true value is assigned If false is false the false value is assigned Assignment commands can only use the first format If the expression evaluates to false the command is not processed Cmd if exp assignment command In the second format the values can also be if constructs The expression syntax is as follows op not Boolean not op bool ce Boolean and Boolean or op rel fs gt OF lt lt pE case sensitive l s gt ey MY lt we case insensitive val string digits val rel exp val op rel val rel exp exp op not rel exp bool op rel exp exp Values compared are string references and are case sensitive The NULL value compares equal no matter if it is specified as the NULL keyword or an empty string The operators and are leading string compares If the left string begins with the right string the expression yields true For example abcdef abc yields true abcf abcdef
275. s a simple place holder for the next position There are two types of field sections based on the possible length of the fields fixed or variable length Most columnar files such as CSVs are variable length That is each field value will be as long as it needs to be to hold the value This includes the length zero which Meta Update translates by default to NULL Fixed fields are rarely used now These are used by files with Type Fixed Fixed field begin in a column and are a specific length Fields can never contain no value A sequence of spaces can be used to mean NULL Fixed fields can overlap on read files offering different ways to interpret the same data FieldSection ID Ly 15 format ID Prefix Ly 3 format ID Suffix Ze 12 format UpdateText 2 512 format Assignments to overlapping fields of output fixed length files are done in the order they are encountered Such overlapping assignments would not normally be done Reading overlapping fields works as expected with each field having an appropriate interpreted value Where are Field Sections used Field sections are used with gt Fields keyword in file definition sections gt QuerySq1 field sections in command sections or look up sections gt The Assignment command Ref regex extract field sections gt The IdLog statement to change the default fields of an dog output file Only File fields have a file or file name associated with them Onl
276. s available is the minimum of the API version being used by Meta Update and the ARS server version Field names are the AR SERVER INFO xxx defines in the API file ar h The number of fields defined vary by the release of the server RdSvr AR INFO ARS Server Information The RadSvr AR INFO Tag refers to the ARS Server Information values available for a read server with the tag RdSvr Meta Update 228 User s Guide SAY Software Tool House Inc AR INFO Table of Fields and Values The following table lists the AR INFO tag s field names the ARS Server version that introduced the field typical values and whether the field is readable or writable The values were taken from an OOTB 7 6 04 patch 2 server installed on a Window 2003 Server X64 Standard VM In some cases the value has been truncated Release Name Introduced 5 12 DB_TYPE SERVER_LICENSE FIXED_LICENSE VERSION ALLOW_GUESTS USE_ETC_PASSWD XREF_PASSWORDS DEBUG_MODE DB_NAME DB_PASSWORD HARDWARE OS SERVER_DIR DBHOME_DIR SET_PROC_TIME EMAIL_FROM SQL_LOG_FILE FLOAT_LICENSE FLOAT_TIMEOUT UNQUAL_QUERIES FILTER_LOG_FILE USER_LOG_FILE REM_SERV_ID MULTI SERVER EMBEDDED SQL MAX SCHEMAS DB VERSION MAX ENTRIES MAX F DAEMONS MAX L DAEMONS ESCALATION LOG FILE ESCL_DAEMON SUBMITTER_MODE API LOG FILE FTEXT FIXED FTEXT FLOAT FTEXT TIMEOUT RESERV1_A RESERV1_B RESERV1_C SERVER_IDENT Meta Update RW 2222777 0 2222570202 RW RW RW RW
277. s coded Meta Update will issue the supplied query and for each record returned in that query will e Load that record and associate that data with the tag specified on the Query statement e Perform any AssignPre section if coded This is a great place to load related records transform values validate the record loaded and set the target schema for the Update e Perform an Update query if coded and apply the assignment sections to create or update a record in the target schema e Launch other control sections to update other records possibly using variable set in the AssignPre to add a condition to the launches An Update can result in the same number of new records added to or updated in the target schema as was returned by the query Syntax Query SrvTag Tag Schema sort Fld Qualification mas ea Meta Update 118 User s Guide SAY Software Tool House Inc SvrTag Specifies a ReadServer to run the Query on The ReadServer s Tag value is the SvrTag and is prefixed with an The ReadServer s section must be specified in the Main ReadServer keyword Tag Specifies the Tag that each of the returned records will be assigned to and referenced with The Tag is used throughout the script to access data from the query result The Tag is reloaded while iterating through the query results You can then use Tag fields to reference data from the record Schema The Schema is a full
278. se remain in memory until the next LookUp using the same LookUp section is processed Specifies how to build the string that will be returned when the QuerySql matches a row Columns in the loaded row may be used to construct the returned string That string can also use other references and the CTL LookUp Src reference Column numbers or if specified field names can be used for the SQL row s columns This is an optional value than can be one of two keywords Error or First The default is QuerySqliMulti Error Normally the QuerySq1 specified should return exactly one row If multiple rows are returned this allows you to continue by loading the first row 211 User s Guide S z H Software Tool House Inc Note that Error will write an error message to the log but will not necessarily cause the LookUp to fail The LookUp search string may still be found through other LookUp mechanisms The NoMatch keyword determines when to do when all coded LookUp mechanisms are exhausted An SQL query may also be used in other ways not obvious in a LookUp function For example an SQL procedure may be coded in the SQL Query that manipulates a source string and returns a different string allowing you to write value transformation functions An SQL select count may be used to assign to an integer field This query makes Assignment Section ge 7 no use of the Count LookUp LookUp Section dummy LookUp
279. section Query Indicates that this operation will process a set of records returned by a query QuerySql Indicates that this operation will process a set of direct SQL records returned by a query Loop Indicates that this operation will process a string or diary field value loop through the fields of a Tag or the forms making up a Join or while a condition is true Iteration controlling statements Until Applies a conditional expression to limit the number of iterations the section performs Output statements Update Specifies that an output record is to be created or updated Specified the query to be issued to determine the update record Create Specifies that an output record is to be created Output Specifies that an ASCII file record or pattern file is to be utput Meta Update 109 User s Guide S H T Software Tool House Inc rather than an ARS record Assign Specifies the assignment sections to be applied to an update record AssignNew Specifies the assignment sections to be applied if an Update query returned zero records and you want to create a new record AssignOpen Specifies the assignment sections to be applied if an Output file is specified as output These sections are applied only when the file is opened AssignClose Specifies the assignment sections to be applied if an Output file is specified as output These sections are appli
280. sed on the command line from environment variables or from references assigned during the Meta Update session ARS and file records are tagged with a name For example the requester of a ticket may be tagged PpiReq Then fields from these forms can be referenced in assignments to the target form For example Requester email PplReq Email address Requester nam PplReq Surname Requester nam y X Requester nam PplReq GivenName The above example shows concatenation of a text field s assignment A reference for an ARS record is the Tag that identifies the record and defines the Schema of that record and either a field id or a field s ARS database name Meta Update 29 User s Guide SJT Software Tool House Inc String References A string reference is used in queries and other control statements It comprises a mixture of text and assignment references wrapped in dollar signs Requester email SPplReq Email address Requester Name LIKE SFile SurnameS SFile Firstname Requester Name LIKE SSFile Surname File Firstname Requester Name LIKE SS File Surname Server ENV ArsServer Meta Update 30 User s Guide SAY Software Tool House Inc Loads You tell Meta Update what data records to load and what names you want to use for these records LoadQ PplReq CTM People 717 000000000041306 L
281. sed ticket s ID that will be copied IdLog the file name for the IdLog function Will create a new TT as a copy of the old one including all its previous emails but not its history records for which a few will be artificially generated Will also update the source TT with the newly generated ID plus a text reference to the generation The source TT must not have already been copied to a new TT TT Copy The Called Command Section The command section called to copy a ticket is TT Copy To call the command either on the command line or within a shell script or batch file one could enter SthMupd exe TT Cpy mus TT Copy p TKT000049 TKT000049 tmp TT Copy has no Query QuerySql File S0 it is executed exactly once The Load keyword loads the closed source ticket The data of this ticket can be referenced with ssrc TT fields This can be used in subsequent queries or assignments The create keyword causes an ARS record to be submitted This could have been an Update keyword which would have allowed different assignments for an update or a create operation An ARS query that selects exactly one or zero update records must be specified It loads the source ticket record which is always the last ticket closed in a chain of tickets That id is passed on the command line as the named argument TT Closed After the command section creates the new ticket that new ticket is re read so that all fields have the current value
282. signment will not be processed The record will not be updated Indicates that the core fields are also to be copied This is only useful when doing a Merge operation Note that specifying CoreAssign will also cause the Request Id field to be assigned If you do not want this specify Skip 1 in addition to the CoreAssign Indicates that the core fields are not to be copied This is the default CoreAssign NoCoreAssign and the MisMatch options apply only if the target is a Remedy record 171 User s Guide SAY Software Tool House Inc Ptn string if exp SkipDisplayOnly SkipNulls Skip Fields Specifies an pattern text string that will be used for each field and value being copied Required and used only when the target is a single pattern In the pattern string the following extra substitutions can be made FldSre TagSrc Field Name the value F1ldNme Field Name the field s name Specifies an expression to be applied to each field being copied If the expression evaluates to true the field is copied and an assignment is made to that field If the expression evaluates to false an assignment to that field is not made In the expression the following extra substitutions can be made FldSre TagSrc Field Names value FldTgt TagTgt Field Names value FldNme Field Name field s name TagSrc is the SrcTag on the copy command TagTgt is the Tag on the Update statement
283. source l value instead LookUp Section using a different Querysql Dmy Tag na amp reference Select count from xxx amp Se wher case id amp SHpdSrc Request ID QuerySqlTarget SDmy Tag 1 In this example an SQL statement is used to decrement a counter Note that this SQL statement is Oracle specific Assignment Section Cmd Ref MyVars Ctr amp LookUp LookUp Section SMyVars Ctr LookUp Section QuerySql Dmy Tag na amp select amp to number CTL LookUp Src 1 amp from dual QuerySqlTarget SDmy Tag 1 QuerySql records may be cached to avoid the overhead of issuing queries for the same record The default is that the LookUp section does not use a cache Meta Update 212 User s Guide SAY Software Tool House Inc Caching LookUp Records LookUp sections that issue Query or QuerySql queries can cache the records retrieved This only happens when the cache keyword is used in a LookUp section and that section USES Query Or QuerySql The cache keyword is used to specify a maximum cache size Specifying 0 zero makes the cache unlimited When a LookUp section includes a cache the source string is searched in the order given by that LookUp section against its internal list file or queries Before the Query or QuerySql is executed a search is made in the cache for the source string If the string is found the saved record is returned as though the Query or Quer
284. sr Group ListS Loop Fields Tag ST TT Type Attachment NoNulls AUN Loop String Tag A 7 SrcTT CASE HISTORY Example 1 Diary Loop Diary sDiary SSrcTT Notes In the first example a Help Desk ticket is loaded into the Tag SrcTT The Notes field a diary field is parsed and each entry in that diary field is iterated through When the entry is loaded the following references are made available to the section sDiary User the login name of the user who made the diary entry sDiary Date the date of the entry yyyy mm dd hh mm ss sDiary DateMdy the date of the entry mm dd yyyy hh mm ss sDiary DateDmy the date of the entry dd mm yyyy hh mm ss sDiary Text the entry text The Date value is useful for assignments This is the format that Meta Update expects for date variables The DateXxx values are useful for ARS Queries which require that the date be formatted according to the machine s locale In Windows this is set at a machine level On Unix the local may be controlled by environment variables The C locale a default is referenced by DateMdy Example 2 String Loop String sTag SUsr Group List In the second example a User record is loaded into the tag Usr The Group List field is parsed based on the semi colon seperator specified into a set of single groups Each of those groups is interated through When each group is loaded the following references are made a
285. st is for Reqid Subst Meta Update The AssignInit simply gets rid of any is the request id is the attachment field id the whole string for the This section extracts any Attachment fields into the file system e he source record The info for each attachment field in the request id value Src lt W W This will loop through all lt NoNulls attachment fields with non null values in the record just loaded There is no output an AssignPre is called after the next iteration is loaded and this saves the attachment processing all non null attachments in the record We save them to the file system using the name with Join forms changed We use a regex that always matches to effect a Subst This results in V Reqld holding a request id with all changed to is by a Subst we match e effected which the nam FieldNames amp t FieldId att This saves the attachment to the file system under a unique name he regex that is used to change 284 User s Guide SJT Software Tool House Inc Restore Script Overview Do is the main command section and does no iteration or output instead only Launching two sections once An AssignInit is used to initialize script variables There is no Query argument in the restore script The AssignInit also determines if an Attachment Fields CSV exists or not It does this with a Reference spawn assignme
286. stallation notes for UNIX and Windows Running Running Meta Update and interpreting the output Developing and debugging scripts Script Reference This explains how to code Meta Update scripts in detail You will need to refer to this section when you don t remember how a specific setting or option is specified Licensing This explains how the Meta Update server based licensing works Samples These samples which are part of the software distribution and available on the web are another way to learn how to build scripts These samples perform different functions and have detailed explanations of the Meta Update scripts used Bits of these scripts may be copied and tailored to your scripts Meta Update 3 User s Guide SAY Software Tool House Inc Table of Contents Prefaceusundsadkepekeied psi Eed 2 Organisation 42 aske a sede och dees nce ekke etatene 3 Tabl e e ET A ue HL e E 11 Data ei EE LE 12 Ge Te Vle e E 13 Meta Update A New Way to Use The API nnrennnnnnvennnnnnvnnnnnnnvnnnnnnnvennnnnnvennnnnnvennnnnnvennnnnne 14 IT CN 17 ERNEIEREN sues 18 Dees 25 erte 27 ASSIGNMENIS suksesserien 28 Assignment References nss ennnnnnvvnnnnnnvennnnnnvnnnnnnnvennnnnnvnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 29 String References nnssrnnnvnnnnnvnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 30 e EE 31 TYP S Of e E 32 Control Sections E 33 Control Section
287. statement or the default key value for the type of event These references may be used in an event s assignments Meta Update 141 User s Guide SJT Software Tool House Inc File Sections A file section defines an external ASCII file s format File keyword iterates Files sections can be used for input or output with the File and through a CSV Output command section keywords Output adds a new CSV record or appends text to a single or new file Input files are always columnar CSV like and can be of two types Those with fixed length fields and those with variable length fields Output files may be columnar like input files or they may be pattern files A pattern file is any type of asci file and can be used to generate html or xml A file definition can also include field definitions These fields can specify value transformation and interpretation rules If an output file is columnar fixed or delimited the fields must be defined Input files have their field definitions as optional if the field includes a field header However it is recommended that the fields be defined in the script as well both to validate the file and to perform value interpretations and field requirement checks An output file can also be a pattern file or a non columnar text file Pattern files are generally used for reports emails XML HTML and so on They are ASCII files A pattern file can be used to appen
288. string containing the line ends You may use a Loop if needed to process these lines individually using a line feed as the delimiter Alternatively you may use a normal Spawn command and then process the files with a File This example run on Windows with Cygwin installed will extract the Windows User Id to produce an information level message Cmd Reference V spawn amp set grep USERNAME cut d f 2 Cmd if SV re 0 ACmd Msg I User is V stdout ACmd else Cmd Msg W Spawn for Windows User returned SV rc ACmd endif This example will set the contents of a file into a field Cmd if SCTL OSS Windows Cmd Reference V spawn type SArg filename ACmd else Cmd Reference V spawn cat SArg filenames Cmd endif Field V stdout Using Regular Expressions Regular expressions may be used to match and extract split values Meta Update 191 User s Guide SAY Software Tool House Inc This is an example of a script that does no ARS updates but simply splits the specified string around the last and trims and leading and trailing spaces from both parts DoSplit PrmReq 1 Usage SCTL script f DoSplit p subj ArgNm subj AssignInit asg Split asg Split Cmd Ref X regex parts regex amp MO Se ANT amp SArg subj Cmd if SX rcS 1 ACmd Msg I matched Src SArg subj
289. tIini Parm error 3 59 53 Statistics 59 53 Sections Maximum section depth Output Schemas Output Schema records Output Schema records Outputs OK Outputs Errors 59 546 Outputs Aborts 59 546 Input Errors 0 59 546 E error some errors occurred Check for errors above this message 59 546 E terminating unsuccessfully in 0 sec created updated with 0 skipped uo VO a LA H H H H H H tb DOO Oo oOo of y BLP PHF HP SHE HH PPS ol VO U w In this next example the script file s Query at line 65 referenced a ReadServer tag which was not defined as the script didn t need use additional servers Query Itsm6 User User V Qry E gt SthMupd QQQ Tb1Rpt User ini Do sthvl Demo start 1 max 10 Meta Update Version 5 56 x64 for ARS lib 8 1 2 Error Server reference not found c Copyright 1996 2015 by Software Tool HensE Inc www softwaretoolhouse com 3416 785 i Do One 3416 785 i Do One beunChing 1 of 1 Dol Script line number in error 3416 785 E Boy One FlIniFindCtl Server Tag Itsm6 not fowfd 3416 785 E Do One ArIiniQuery FlIniRefFindCtl for It sm6 failed at file QQQ TblRpt User ini Dol Query line 65 3416 785 E Do One ArPutIiniRinit ArIiniQuery fafled rc 4 in file 000 TblRpt User ini Dol Query line 65 3416 785 E Do One ArPutIiniRinit for Dol returned 3 ArPutIini Parm error 3 3416 785 E Do One ArPutIiniRdo
290. tag holds any program arguments as defined by the ArgNm keyword in the Main section All arguments defined with the ArgNm keyword are defined when the Meta Update script starts whether or not the command line included a value for an argument If the command line did not include a value for a given argument it will contain an empty string equivalent to NULL ENV The Environment The ENV Tag refers to the environment The fields in the environment are initialised when Meta Update begins and reflect the environment of the shell used to start Meta Update Fields of the environment are case sensitive ENV Path does not yield the standard PATH variable ENV PATH does Assignments to the environment may be made through the Reference assignment command When a Reference command sets a variable in the ENV tag the Meta Update environment is adjusted Any changes in the environment will be reflected in subsequent references within Meta Update and within any client processes that Meta Update starts This includes any client processes launched by the Meta Update Spawn command When Meta Update completes the environment will revert to what it was when the Meta Update process was started AR INFO ARS Server Information The AR INFO Tag refers to the ARS Server Information values available The fields in this tag are initialized when Meta Update begins and reflect the values returned by the main Update Server The number of field
291. tatement QuerySql Query File Of Loop may be coded in a command section Types of Loops There are four types of loops String a string is parsed according to a specified delimiter Diary all entries in a Diary field value are iterated through While a loop continues while the specified condition is true Fields all fields defined by a source Tag are looped through Join all normal forms that make up a Join are looped through Syntax overview Loop String Tag dim sort Ref Diary Tag sort Ref While expression Fields Tag SrecTag Options Join Tag SvrTag Schema Skip list These are keywords that specify the type of loop and are required String A string loop iterates through a set of substring Diary A diary loop iterates through all diary entries in a single diary field While A while loop iterates until the condition is false Fields Each field of the source Tag is iterated through Join Each normal form that makes up the Join is iterated through Keywords Ref This is a string reference If Ref evaluates to a NULL no iterations and no outputs are performed This is similar to a Query that returns no records Meta Update 125 User s Guide SJT Software Tool House Inc dlm Sort forward reverse ascending descending Meta Update For diary loops the reference must evaluate to a formatted diary field It will generally be to a loaded record s diary field
292. te Site name SthDomain Site licence domain suffix For site licensing all three environment variables must be defined For server licensing only the first variable must be defined Specifying the License Key in the Script The Meta Update License may be specified in the Main section of a script file as an alternative to using environment variables or using a form on the server To specify the license key in the Main section code the License keyword with the license key as the value For site license you may also code the Domain and Site values License This is the password for either a server or a site license It must be specified exactly as was specified when the license was requested If a site license is being specified both the Site and Domain are be required Site This is the Site Name the of a site license It must be specified exactly as was specified when the site license was requested Domain This is the Domain suffix for a site license It must be specified exactly as was specified when the site license was requested The following script file addition would accomplish the same thing as the environment variable example above Main License QF143G6 PL95S0Q Specifying the License Key in an ARS form with the User Tool Meta Update 243 User s Guide S z H Software Tool House Inc All Software Tool House tools can reference a special form on the target server for both licensing and operational
293. ted the Update specifies the same Tag as on the Query The Query cannot have specified a read server Update Tag A query is be performed to select the update record unless the update record is the same as this sections query record and the short form of the update statement is used This Update query s results must contain exactly one or zero records The Tag must be unique and cannot match that of the Query if a different schema and query are coded If the Update query returns zero records a new record can be created if the AssignNew is also coded Otherwise an error will be produced and no record will be created If the Update query returns one record and no Assign is coded no update will take place and no error will be thrown Meta Update 115 User s Guide SJT Software Tool House Inc Assign AssignNew AssignInit AssignTerm AssignPre AssignPostOk AssignPostErr AssignPost AssignInit AssignTerm AssignPre AssignPostOk Meta Update Required Specifies the name s of the assignment section s to be applied to the updating record when Update is used or record being created if Create Is used These are the actual Remedy ARS field assignments to be performed against the target schema in either an update or a submit See Assignment Section below for more information Multiple assignment sections can be specified on multiple Assign statements All are processed in the order
294. tement Defined in Concerts 39 Tu CN 126 Meta Update 294 Example 1 Dam 128 Example 2 Gring 128 Example 3 Fields AAA 128 Example 4 Gring 129 Example 5 Join rrnrrrnronnnvnvrvrnvnnvrnrrrnvnnn 130 Examples cc cise ceacessccctzeadeceusccenedscesacneece 128 SOM EEE EE 126 M Message Assignment Commande 175 Meta Update BMC API Versions seeen 56 Msg Assignment Command Assignment Commands Msg Multifile Output Gitatement eee 135 N Name Constants in Arithmetic Expressions 194 Next Step a Script in Debugoger 89 O Operational Statements in Control Gechons 111 Output Files in CGoncepnts 42 Output GONCOPIS EE 21 Re lee 33 Output Files defined in Concepts eeseeeeeeeeeeeeeee 42 Output Program Output 68 Output Statement Mulle a istedet 135 Multiple CSV les 135 Output Statement centers 135 P PCRE Assignment Commande 189 Positional Arguments Meta Update Usage 66 Print Debugging Commande 89 Program Meta Update License Key eee 59 Meta Update Output 68 Meta Update Versions sssneeesesseeeeeene 58 Program Arguments Meta Update Usage 65 66 User s Guide Q OVE E 118 Iteration GONCEPIS EE 37 Limitte 120 Logging TE 120 Performance e 120 OuervMan 121 QueryStat niusnusssnimssneinuvevnsne 121 JE EE ee ayia See QuerySal using field names s i 37 QueryMax 999999 000 ee 121 WITT Cen eur NEEN dEe tins 121 QuerySq Defined in Concepts seeeeeeeeee
295. that record then a cache cannot be used in either LookUp Using different LookUp Lists Meta Update 213 User s Guide S z H Software Tool House Inc To use different LookUp sections to make a match simply use several different LookUp sections in a sequence of assignment so that the assignments are run only if the LookUp previously has failed The condition can be on the CTL LookUp reference or on the assigned value if a default was selected Cmd Cmd Cmd if Ref if Ref LookUp MyVars LkUp 1 SCT LookUp SCT 17 ookUp MyVars LkUp 2 ookUpS Ref In this example the LookUp section returns the original source string by default and the three different sections are always run In fact if the Default for the LookUp is the original string LookUp MyVars LkUp 3 the example above and below are equivalent Cmd Ref LookUp Cmd Ref LookUp Cmd Ref LookUp Meta Update MyVars LkUp 1 MyVars LkUp 2 MyVars LkUp 3 214 LkupRslt SMyVars DefaulS LkupRslt SMyVars DefaulS LkupRslt SMyVars LkupRslt SMyVars LkupRslt SMyVars LkupRslt SMyVars LkupSrc LkupSrc LkupSrc LkupSrc LkupRslt LkupRslt User s Guide SAY Software Tool House Inc Field Type Notes Meta Update 215 User s Guide SAY Softw
296. that will be traced I Information Always logged D Debug Only logged if d was specified W Warning Always logged Meta Update 203 User s Guide SVT Software Tool House Inc Val LookUp Val Examples E Error Always logged The second value indicates the action to be done if the source value is not matched Default The default value coded is taken Skip No assignment is made to this field Error An error is returned and this operation is aborted Specifies the value reference that will be returned as a result of this LookUp when the source value being looked up matches the associated LookUp value precisely Specifies a string constant that will be matched against the passed source string reference When this constant is matched exactly its associated Val will be the result of the LookUp command xlt AsigneeLogin Default NoMatch Meta Update CTL LookUp Src D Default Ms J Blow changed names EE EE Ed These persons don t exist in the new system Make the Assignee SNULLS SNULLS 204 User s Guide SAY Software Tool House Inc Using Files LookUp sections can also use external files for its lists of string pairs To use external CSV files use add the File keyword to the LookUp section When you use the File keyword all other file related keywords are also required A list of value pairs within the LookUp section will override or be overridden by the list from the external fi
297. the BMC API environment variables We summarize them here because they affect Meta Update behaviour Meta Update environment variables are fully defined below Environment Variable Description SthScriptPath A path like environment variable for finding Meta Update scripts and files SthApiRetry Allows Meta Update to retry API operations on any BMC Remedy API errors or during server outages SthMupdLic Specifies the Meta Update license key for the main server BMC Remedy API environment variables are specified in the BMC provided documentation The usage of these variables may be changed at any time This list is included for convenience and because it affects and overrides Meta Update behaviours Validate all usage of these variables with your Remedy documentation Environment Variable Description ARAPILOGGING Generates two files in the current working directory of the running Meta Update process Conflicts will occur when multiple Meta Update processes with this environment variable are run ARTCPPORT Sets all connections TCP Port to the servers Overrides the Meta Update Port keyword which can be different for different servers Specifies a private RPC port for all server connections Script Path Environment Variable Scripts may be specified on the command line or may be found by searching an SthScriptPath environment variable SthScriptPath is set the same way as PATH according to the O
298. the main server or any of the Read Servers RandSeed Yes No Default Yes If set No the sequence of random numbers generated by the rand function will be the same on multiple runs AssignInit Section section Default none A list of Assignment sections that are invoked before the first control section passed on the command line begins This happens after arguments are processed and the Main and all ReadServer sessions are established It is effectively the first assignment section See AssignInit below and in the Assignment reference AssignTerm Section section Default none A list of Assignment sections that are invoked after the first control section passed on the command line completes This happens just before the job ends See AssignInit below and in the Assignment reference Server This is the Remedy ARS server to sign in to If coded on the command line this has no effect If not coded on the command line this must be coded This does not have to be the real Remedy server alias It is simply an IP or domain name that translates to an IP where the ARS server is running The server may be specified as a string reference The string reference may be a named parameter or an environment variable If it is a named argument it must be passed on the command line as a script argument User The ARS User ID to use if not coded on the command line This may be a string reference Password Th
299. the powerful concept of a Reference you tell Meta Update what to do You create or update records using Merge Submit Modify API calls by specifying an update query References are used throughout a Meta Update command script With the Remedy Administrator a reference is a field name or id Meta Update extends references to include a record identifier or a Tag Within a Meta Update script that is creating a Ticket you may have two different people records loaded one for the requester and one for the requester s manager The data from both are available when making assignments running further queries or in conditional expressions A simple Meta Update command script has a single command section In it there is no Query SQL Query or File processed A Create is coded So the command will always output a single ARS record The command script may take a couple of program arguments Meta Update 23 User s Guide SJT Software Tool House Inc These could be assigned to the new record or used in conditions within the new record assignments A Meta Update command can also be made to iterate Creating or Updating as many records as the number of times the command section loops If a Query is coded and it returns 12 records then 12 records will be output by the Create or Update of the command A Meta Update command can Launch another different Meta Update command When this is done the record created or up
300. the schema for the record to be created in and the Tag that the re read record will be referenced as Because the record is reread after creation the Request ID field will be available The assignment section is applied to a new record in the create form If you want to create a new record or update an extant record depending on a query you can use the Update statement Update You may code a query to determine the update record This query is coded in the Update statement Assignment sections can be coded for both updating and creating a new record when the Update query returned no records When you do use ouery the record you want to update can be the result of that query or a new record loaded from a query that returns one and only one record The simplest case is the result of the query is the update target Query Tgt HPD HelpDesk Master Ticket Id 001 Update Tgt Here an update will occur for each ticket satisfying the query condition In other cases you d need to load the update target record by issuing a different query based on data in the results of the Query This second query is meant to find the target record ID It must return exactly one or zero records Load Src SalesProduct 001 Query Cat ProductCat Product SArg Product Update Tor SalesItem SaleId SSrc SaleId AND amp Item SCat Items Here an update will oc
301. ther informational messages will be written See Tracing below for more information Meta Update 65 User s Guide SJT Software Tool House Inc In the Trace Server version the d switch causes a lot of message traffic between Meta Update and the Trace daemon The trace files are cycled through and do not grow beyond the limits specified in the trace configuration See Tracing for more information The q switch indicates quiet operation No messages will be echoed to the stdout or stderr files at all This includes all Error and Info messages as well as the copyright notice These messages will still appear in the logs The n switch indicates a null operation No database writes are performed but all queries and loads are processed The assignments are also processed and the updating data is printed to the console This may be very useful when you are developing a new script file Note that with complex scripts because no database writes are performed references needed may not exist The e switch indicates a single error operation The first error that occurs will stop the run Normally a file or query is processed and sections that are launched may succeed or fail If a launched section fails then the remaining records in the file or query continue to be processed Using the e switch changes that behaviour so that the job is ends when the first error happens When developing scripts this allows the developer to sort out
302. tial Once on section start Launch Iteration EEE aia eee EE ee Load and transformation rules N nothing next ARS record next SQL row next File row next Value Assignments Pre output After Load before Output Gib UTD Ui Assignments Post output After output success fail Launch invoke other control sections iteratively gt f Assignments PostLaunch After all Launches are done Iteration Assignments AssignTerm Done once at Termination Each Control Section follows a simple structure as depicted in the image above A Control Section may choose to iterate by issuing an ARS Query or processing a CSV file for example Eee A Meta Update control section can iterate through an ARS Query an SQL Query an ASCII column file like a CSV a delimited string s values a diary field s entries while a condition is true a set of fields defined in a schema file or SQL query Or a command section can be run through exactly once VVVVVVY Within each iteration Meta Update loads the next iteration value or record performs any assignment sections you specify setting variables transforming values and loading additional ARS records or SQL rows Meta Update 20 User s Guide SAY Software Tool House Inc A section can then optionally perform an output Creating or Updating an ARS record appending data to a CSV or text file or generating the next text file in a pattern of files
303. tion Meta Update 37 User s Guide SJ Software Tool House Inc QuerySq You can also tell Meta Update to perform a query using direct SQL Meta Update passes the query you code to the Remedy Server Meta Update will then iterate through the results of the query loading the records one at a time and create or update the same number of target records If your query returns six results you will update or create six records in the target form SQL Columns can be named and interpreted For example ARS Date fields can act as integers un interpreted or as dates QuerySql BseGuid na amp select instanceid amp from bmc core bmc_baseelement amp where modified date gt Vars ArgDateEpoch Or QuerySql TskCnt na amp Select count from ctm task amp where RootRequestInstanceID SIncSrc InstanceID File A File can be used instead of a query Meta Update will iterate through the records of the file loading the records one at atime and create or update the same number of target records If your file has six records you will attempt to update or create six records in the target form A file is an ASCII file with columns separated by delimiters or in fixed positions An example could be a csv file created by Excel or an Exchange Post Office dump Using a File looks like this File ExchSrc ExchangeFileDef File Name ExchangeFileDef File d dta ArsTemp exchange dat
304. tion RdSvr AR INFO AR Server Information for the Read Server with the Tag RdSvr As many of these are defined as there are Read Servers CTL RdSvr Schema When any schema is loaded queried or updated an automatic tag is created that holds information about the schema The ENV AR INFO and RdSvr AR INFO tags may be assigned values with the Cmd Reference assignment command Meta Update 226 User s Guide SAY Software Tool House Inc CTL Meta Update Information The CTL tag gives Meta Update wide operational information Tag MORA Q Ss cae E Q 3 d E CTL CTL Field Server Port RPC User Password Script ScriptF ScriptFx OS ArsVer ArsVers Pid Pidx PidX Schema SchemaFnm Operation TD Value The Server where the update will occur The Port number for the update server connection or zero The RPC number for the update server connection or zero The User ID being used for Meta Update updates The Password being used for Meta Update updates The script file and path being run E g path x ini The script file being run minus path information E g X ini The script file being run minus path information and extension E g x One of UNIX LINUX or Windows The ARS Server version whole number E g 7 for ARS 7 01 The ARS Server Sub version E g 1 for ARS 7 01 x The decimal process ID of the Meta Update run The hexadecimal lower case proc
305. uide SJ Software Tool House Inc Installing Meta Update 45 User s Guide SJT Software Tool House Inc Meta Update 46 User s Guide SAY Software Tool House Inc Installing Meta Update Meta Update 47 User s Guide SJT Software Tool House Inc Expanding the Distribution Meta Update is distributed as a single zip or g zip file The file may be expanded in your applications area For example On Windows you could unzip the distribution in C Program Files STH Or C Program Files SoftwareToolHouse The zip creates a single directory containing all Meta Update software documentation and samples as described below The root directory is called Mupd_Xxx where X xx is the Meta Update release This allows you to test different versions and APIs of Meta Update easily Meta Update 48 User s Guide SAY Software Tool House Inc Complete Installation There is no formal installation for Meta Update Meta Update is meant to be run from a command line or shell or fired by ARS workflow or other automated processes By expanding the distribution file you have completed the installation of Meta Update You may choose to include the Meta Update distribution directory on you path and your library path See Runtime Environment below for more information Meta Update 49 User s Guide SJ Software Tool House Inc Distribution Contents The Meta Update distribution has a singl
306. uired For example to convert a decimal value in German notation to the internal Meta Update representation Numerc Value Subst Subst A value of 1 234 56 would then be transposed into 1234 56 Meta Update 218 User s Guide SAY Software Tool House Inc Enum or Selection Fields Selection Fields are stored in the database as integers There are three different types of selection fields defined in the API since release 5 though the administrator tool prior to release 7 only allowed a single type Now with the advent of release 7 the admin tool supports two types though a third type is supported with the API The two types are sequentially enumerated types and enumerated types with gaps Meta Update takes character strings or integers for enumerated values References are converted to character strings So a Closed value from one schema will match a Closed value in another schema even if the underlying numerical values are different A value of 10 will first be searched though the aliases and if not found will be accepted as an integer value Values must be defined in the field or an error is thrown Meta Update 219 User s Guide SJT Software Tool House Inc Date Fields Meta Update holds date values internally as character strings of the form yyyymmddhhmmss in the local time zone It converts to and from ARS date data types as needed ARS Date fields hold a date from Jan 1
307. ult field label ARS field is DisplayOnly ARS field is required ARS maximum field length The field value The length of the value 184 15 None None DI User s Guide SAY Software Tool House Inc Doubled Reference Values assigning a single value using references for a Tag and Field When you want only the value given by a double reference that is when the Tag and Field are themselves references then the Gval is simpler and faster than the Qinfo command above Cmd Reference Tag Name val SrcTag SrcFld val This is a keyword and must be coded exactly as shown This command assigns the value of a dereferenced Tag and Field to a single string SrcTag This can be any string expression or a constant It must evaluate to a known Tag SrcFld This can be any string expression or a constant It must evaluate to a known Field within the Tag given If the Tag is an ARS record the field can be a field s name or ID Both the Tag and Field may be references which must evaluate to an existing or loaded Tag and a field defined in that Tag This allows you to hold field references in variables and do use hashes and arrays Note that the info reference command also retrieves the value and can be used anywhere that this command can be used In the next example assuming the Tag Src is a loaded ARS record with a field of Status the next Reference command will assign that Status string to a varia
308. us 7 Meta Update can hold many records in memory when it is time to update a Remedy record with assignments So a reference comprises two parts the first specifies the loaded record of an ARS form and the second specifies a field database name or field id from that form SRecTag StatusS SRecTag 7 The first part is called a tag You declare in a Meta Update statement such as a Query or File As each record in the query is processed the Tag that you declare refers to the current record s data There are also two tags that are set up by Meta Update The second part of a reference is the field name as defined in an ARS form s field s database name declared in a File QuerySql as filled by regular expression extracts as assigned in a string list as implied by field names in the first row of a CSV file as set in the environment in the ENV tag as set by Meta Update in the CTL tag The records that Meta Update can hold in memory can come from sources other than Remedy forms Of course field ids only apply to Remedy forms In addition to Remedy ARS record references a Tag may refer to A CSV or other columnar file s field values An SQL query column A named collection of string variables You can use strings to hold variables allowing you to make complex scripts There are a set of Meta Update assigned string variables under the Tag CTL Examples are SCTL Pids SCTL OSS You can also
309. ut R Run Run execution instance Script Processing These are on by default but may be turned off i Info Informational on by default Script Debugging These ar choed when selected with the d Q Ory ArQuery Sql all query strings G Get ArGet all ArRecGet ids U Put ArPut all ArRecPut ids etc Debugging settings These are never echoed Caution These generate masses of logs and can affect performance F Func Function entry and exit d Dog Debugging detailed debugging 2 Dbg2 Debugging lvl 2 more details yet a Data Data data values records fields s Struct Structure data Structures 1 List Script listing and files are logged For ARS tracing the user id the Meta Update signs on the update ARS server must be in the Group that the ARS administrator has specified client side logging for in the Server Information panels using the ARS Administrator tool The following options can be specified s SQL logging f filter logging a API logging p Plug in logging Specifying any ARS tracing implies Meta Update tracing of level 2 In the next example we want the filter traces from ARS and the Meta Update data traces This will show us what value each field had before the ARS submit set or merge call as well as the filter logs produced by that call Meta Update 71 User s Guide SJT Software Tool House Inc d a E In this example we want complete tracing including complete ARS tracing and we want to direct it to a specific file
310. vailable sTag Text the single group id as a string Example 3 Fields Loop Fields fTag SrcTT Type Attachment NoNulls In the third example a Loop of only a records attachment fields containing attachments non null are iterated through The Tag fTag will contain the information returned from the info reference assignment command Meta Update 128 User s Guide SJ Software Tool House Inc If the record has three attachment fields and two have no attachments are NULL the loop will execute once only with these fields being assigned to the fTag specified fTag Type ARS SchemaName HPD HelpDesk FieldName Attachmentl FieldId 3000100010 FieldType Attachment Value C tmp Some File jpg ValueLength 19 See Assignment Reference on page 183 for the list of variables assigned to fTag Example 3 String Loop String sTag SrcTT CASE HISTORY In the fourth example say SSrcTT CASE HISTORYS contains CASE OPEN 2011 08 01 supl The customer called complaining of slow response time This generally happens for a period of an hour across his lunch CASE NOTES 2011 08 02 supl Ran the tracert to his server when h xperienced the slowness tracert output attached p CASE CLOSED 2011 08 02 sup net Firewall change made CASE TRANSFERED 2011 08 02 sup net Consider the following Loop example using a double anchor o
311. will migrate any data table from a source server to a target server The table name is an argument to the script The configuration specified things like ticket CTI Priority Summary and Description and so on The script was passed the key value a word to look up in the configuration table It would do the look up and if specified build a ticket as configured SthMupd exe Main Egl TT Create Req p ReadServer ReadServers Server User Arg ReadServer Tag Server User Do Query Update Merge Assign AssignNew asg Cmd Meta Update ArsDev Demo FormName SrcServer ArsSourceServer com Demo SrcServer SrcRecord SArg FormName 1 1 Upd SArg FormName Vy M SreRecord 18 Yes No Workflow Do asg Do asg Copy SrcRecord CoreAssign 44 Tkt Cfg Typ l The Main section identifies the ARS server and sign on parameters It also gives the script argument names and usage information The ReadServer section identifies the Source ARS server and sign on parameters The Do section is passed on the Meta Update command It queries the source server for all record in the passed ARS Form Name and migrates the data as is using the Merge API The Do asg section holds the individual field assignments for the updated record In this case we will copy all the data fields from the source record into the target record User s G
312. xample delimited strings allowing you to process a Group List or other encoded value such as lists of tables any arbitrary condition being true the set of fields in any Tag or Remedy record the set of forms that make up a Join form YYY VvV Y A control section s iteration can be stopped before the next iteration begins with an Until statement If an Until statement is coded the iteration continues while the until condition evaluates to true Meta Update 36 User s Guide SAY Software Tool House Inc Query You can tell Meta Update to perform a query Meta Update will then iterate through the results of the query loading the records one at a time and create or update the same number of target records If your query returns six results you can update or create six records in the target form A query is similar to a Load You tag or name the loaded record so that you can use its data in assignments you name the query s source form and you specify a query string A query may refer to the target server as specified in the Main section or to any read servers Query PrdCode ProductCode amp Product Pkgl AND Status Active You can also use references in your queries Query PrdCode ProductCode amp Product S S001 AND Status Active Or Query PrdCode ProductCode amp Product S SrcMasterProductSale ProductCodeS AND Status
313. y Ok Skip the update was skipped as no fields had changed values Error the operation failed 104 User s Guide SAY Software Tool House Inc PrmReq Optional If coded specifies script usage text that will be produced as error messages if required script arguments were not coded on the command line This is generally a good place to put usage information about the file ArgNmVar Deprecated There is no need to use this Optional If coded specifies a Reference name to be used for command arguments parameters If missing the name is presumed to be Arg Arg Optional If coded specifies a command argument and optionally a default value Only arguments without default values are required on the command line Arg arg name Default default The reference would become Arg arg_name For the switch based command line the argument name is used as a Switch and it is followed by the argument value SthMupd exe MyScript ini Do arg name some value AssignInit Optional If coded specifies a list of Assignment Section You may specify names to be processed after Meta Update establishes all its script wide server sessions and before the first Control section is fired initialization and termination AssignTerm Optional If coded specifies a list of Assignment Section assignments from names to be processed after Meta Update completes all Main script processing and before the server sessions are close
314. y File fields can be of the Type Fixed that is with a starting and ending column number Specifying field order The field sections positions are specified in different ways for fixed length fields and variable length fields Meta Update 146 User s Guide SAY Software Tool House Inc Only fixed length fields need both a starting column and a length Variable length fields simple have a to represent the next sequential position of the field For variable length fields the field position is that of it in the list in the field section in all cases except in the case of an input file with a field header row For input files with field headers as specified by Type Delimited FldHdr in the file section the field order is given by the file s field header row Fields in the file and not in the field section are ignored Fields in the field section but not in the file are assigned NULL by default If an input file does not contain a field specified in the field section the value of a reference to that field will always be NULL A FieldsRequired or FieldsInFile keyword may be specified in the file section to throw errors as needed About Field Formats Field Formats allow character substitutions and value interpretation rules to be specified when loading the field with gt a value from a file by reading the next row of the file gt an SQL result column gt a Regex extract They also applie
315. y University of Cambridge and is distributed under the BSD license Updates This program and this manual may change from time to time The latest version is available at our web site www softwaretoolhouse com Comments Your comments are welcome Please see www softwaretoolhouse com support and click Comments or email us at support softwaretoolhouse com We look forward to hearing from you Meta Update 2 User s Guide SAY Software Tool House Inc Organisation This document is divided into a sequence of D sections The diagram to the right outlines which User s ci Guide sections we recommend as you use Meta Update more and more Mean 0 Ready ae Mets Update to Start User Here s an overview of the User s Guide arver PG installing Script sections mr in Reference Concepts i R nning F a Introduction WE bm This is a short description of what Meta L ge Baye e J Biss al Update is and the types of problems you can solve with it Read it if you are new to Meta Update or want to learn what Meta Update does at a high level You do not need to be an ARS Administrator or developer to read this section Concepts In this section you will learn about the Meta Update commands and facilities It introduces the Meta Update scripting language and gives a general understanding of what to do to implement a script It is required reading until familiar with Meta Update scripting Installing The in
316. y of PCRE that is incompatible with Perl Any backslash in a pattern that is followed by a letter that has no special meaning causes an error thus reserving these combinations for future expansion By default as in Perl a backslash followed by a letter with no special meaning is treated as a literal There are some differences in regular expression handling among all regular expression engines For complete information on regular expressions and specifically the regular expressions implemented by PCRE please refer to the PCRE or regex man pages available on the web Using Arithmetic Expressions Arithmetic expressions can be assigned to string variables as either integers or real numbers Here are a few examples ACmd Cmd Ref MyVars Ctr eval SMyVars Ctr I Ref MyVars Area eval pi CiXmit rangeS 2 The following unary operator is supported unary minus The following binary operators are supported multiplication division A exponentiation addition subtraction Meta Update 193 User s Guide SAY Software Tool House Inc The usual arithmetic rules of precedence apply You can change the order of evaluation by using parentheses All arithmetic functions are implemented with the GNU matheval library which comes with support for some named mathematical constants and basic functions While of improbable use in a Remedy application these are documented here for complet
317. ySql had been executed This saves going to the ARS server for the query and record and can yield a significant performance boost Any Load can be converted to use a LookUp to benefit from this performance boost It is important when using a cache to remember these things gt Records are found in the cache according to the LookUp input string no matter what terms are used in the queries Therefore each LookUp source string that returns a record should always return that and only that record No other source string should return that record It is usually a simple matter to develop such a string The string passed to the LookUp section does not have to be referenced by the LookUp queries So for example the string could simply be the set of references that the LookUp uses as in this case ACmd Ref MyVars LkupRslt amp Cannot use a Cached LookUp LkUp 1 dmy LookUp cmd Ref MyVars LkupRslt amp Can use a Cached LookUp LkUp 1 LookUp STagl fieldl STag2 field2s LkUp 1 Cache 0 Query Tag amp Schema amp Field 1 Tagl fieldls and 8 Field 2 Tag2 field2s gt lfa record that is returned by a LookUp will be updated through the script or through any other means then a cache should not be used This will ensure that when needed the record will contain the updated values gt If two different LookUp sessions can return the same record and use the same Tag for

Download Pdf Manuals

image

Related Search

Related Contents

le patrimoine équestre en région Basse-Normandie  DMD50 Universal Satellite Modem  rg-p001 user manual    

Copyright © All rights reserved.
Failed to retrieve file