top of page
  • Stefan Hulls

JavaScript


During our first automator steps we introduced a “JavaScript – like” language to script automation packages. This was a necessity because of our execution engine back then.

After a year of automator experience we decided to adapt a different by far more powerful execution engine and pure JavaScript in its version V2016.


What does it mean from a business perspective?

  1. Every JavaScript developer can write automation scripts after a short introduction.

  2. If you decide to cancel your automator subscription, you can simply take the automation scripts and use them in your own environment. Only small parts have to be added by your JavaScript developer.


What does it mean in technical terms?

JavaScript developers can make use of the following possibilities:

  1.  Base language features -> Variable declaration with var, let, const -> if and else with {} Blocks -> let x={}; Blocks to create new data objects -> for, for of, break -> while, do.. while -> switch -> regex -> template Strings -> Block and line comments -> functions (named, anonymous, self calling, nested)

  2. Base functions like -> isFinite, isNaN -> parseFloat, parseInt -> decodeURI, decodeURIComponent -> encodeURI, encodeURIComponent

  3. Base objects like -> Math, Number, Date -> Infinity, NaN, undefined -> true, false

  4. Standard Operators like -> Logical Operators (==, !=, <, >, <=, >=, ===, !==, ||, &&) -> Math. Operators (+, -, *, /, %) -> Ternary Operator (condition?then:else)

  5. Default set of functions: -> stringify and parse – for JSON handling -> log, logError, logVerbose an logDebug -> date and moment – to create a Date and Moment object -> newMap and newSet() to create the Map and Set Objects -> setProperty and getProperty to access a property by its name -> isNull, isArray, checkNull -> uuid, atob,btoa, encodeHTML, decodeHTML -> formatdate, formatDateTime, formatNumber, …

  6. HTTP, REST, GRAPH, MAIL, Proxy functions -> http functions that can be used e.g. for SLACK integration -> rest functions can be used e.g. for JIRA integration -> graph functions can be used for Office 365 & Sharepoint integrations -> proxy functions that can execute powershell scripts on premise -> In detail: -> http_get, http_post, http_put, http_patch, query_stringify -> rest_get, rest_post, rest_put, rest_patch -> graph_get, graph_post for office 365 access -> sendMail -> executeOnProxy

  7. ITRP functions -> fetch, fetchAll, fetchFilter -> update, create, deleteItrp for Itrp Accounts -> addNote, addApprover, link, mergeAudit -> isUserTokenValidInAccount, hasUserTokenRoleInAccount -> exportPromise, importPromise, waitForPromise

  8. Template Management -> templates now support the smart {{variable}} style -> templates allow ASP style development (<%=variable%> and <% /* code */ %>) -> templates can only access global package variables -> text in variables can be used as template now -> in detail: -> createTemplateTextMail, createTemplateHTMLMail, createTemplateText -> textFromTemplate, subjectFromTemplate, -> bodyFromTemplate, bodyFromTemplateText -> useContentAsTemplate

  9. NOT implemented -) Use of classes, and therefore no use of the “new” keyword -) Asynchronos calls or use of functions – all is handled synchrone -) continue is not allowed in loops -) All elements that are not listed above


Conclusion

Every JavaScript developer is now able to develop automation packages within the automator framework. Workflow automation is now easier than ever.




7 views0 comments
bottom of page