390 likes | 528 Views
Working Out with KURL!. Shayne Koestler Kinetic Data. Questions Welcome. KURL. KURL. Kinetic Uniform Request Language KURL is a domain-specific language (DSL) written in Ruby DSL Example =MIN(A2:A7) DSL Definition A language designed to solve a specific set of problems
E N D
Working Out with KURL! Shayne Koestler Kinetic Data
KURL • Kinetic Uniform Request Language • KURL is a domain-specific language (DSL) written in Ruby • DSL Example • =MIN(A2:A7) • DSL Definition • A language designed to solve a specific set of problems • KURL is designed to define service items in Kinetic Request
KURL Uses • Additional form of development • Text editing rather than point and click • One big save opposed to many small saves • Acts as an export format • Human readable • Easy to keep under version control
KURL Uses • Automate Service Item Development • KURL code is a serialized format for service items • Service items can be exported into the format • Data from external sources can be converted into this format
KURL DSL • Set of functions that model Kinetic Request service items • page – defines a page element • event – defines a javascript event • A few more • Functions are made available in specific contexts • question within page • choice within question
KURL DSL • KURL Guide • On Kinetic Community • Provides a complete list of functions available • Details all options for these functions • Details which functions are available in which contexts
KURL Files • kurl.jar • Builds service items from KURL code • Retrieves KURL code for service items • YAML config file • Often named config.yml • Configures connection to Remedy server • Can be generated automatically by kurl.jar
KURL Files • Library files • Required to make API calls to Remedy • .dll (Windows) or .so (Linux) • KURL code files • Contain the KURL code of a service item • .rb file extension (Ruby)
kurl.jar • Help • Displays usage details of the kurl.jar • Lists functionality provided by the kurl.jar
kurl.jar • Version • Lists the version of the kurl.jar • New versions are released to accommodate new versions of Kinetic Request • The latest version is 2.1.1
kurl.jar • Setup • Recommended method for configuration • Prompts for configuration values • Generates YAML configuration file • Named config.yml • In current directory
kurl.jar • List Catalogs • Lists all catalogs in the Kinetic Request application
kurl.jar • List Service Items • Requires a catalog name • Lists all service items in the given catalog
kurl.jar • Retrieve Service Item • Requires • Catalog name • Service item name • Output directory • Generates the KURL code that defines the given service item • Saves KURL code to a Ruby file in the given directory
kurl.jar • Build Service Item • Requires • File name • Builds service item in Kinetic Request from KURL definition
kurl.jar • Retrieve Catalog • Requires • Catalog name • Output directory • Builds KURL code for each service item in catalog • Builds KURL code for catalog itself
kurl.jar • Build Catalog • Requires • Directory containing KURL definitions • Builds catalog and service items in Kinetic Request fromKURL definitions
Problem • Service catalog under development • Standards are well defined • New requirements daily • Additions to service items • New service items
Solution • Automate development with KURL • Gather requirements in a spreadsheet • Use spreadsheet data to construct KURL code • Execute KURL code to build service items • Could run this for every new requirements document
KURL Automation • General process • Create a service item that defines • Look and feel • Defaults for service item contents • Retrieve KURL code for the service item above • Divide KURL code into small, specific code templates • A piece of KURL code that defines part of the service item
KURL Automation • Template Service Item
KURL Automation • General process • Create an empty file to store KURL code • For each piece of input data • Append appropriate code template to the KURL code • Build service items with resulting KURL code
KURL Automation Header Header Header Header Footer Footer Footer Footer Text Question Text Question Text Question Text Question Date Question Date Question Date Question Date Question List Question List Question List Question List Question Input Output (KURL code)
KURL Automation • HTML Parsing • We have • Form on a website • Catalog of services or products on a website • We want • Generate service items from the HTML data above
KURL Automation • HTML Parsing • Solution • Ruby program that parses HTML as input and assembles KURL code • Execute KURL code to build service items
KURL Automation • Catalog Provisioning • We have • Catalog template • Suite of pre-defined service items to choose from • We want • Service item that gathers requirements for a new catalog • Task process to automatically build the new catalog
Catalog Provisioning • Components • Catalog template • Available service items • Catalog provisioning service item • 2 task handlers • Create catalog • Clone service item
KURL Automation • Spreadsheet Parsing • We have • Spreadsheet with service item requirements • Service item that defines standards • We want • Generate service items defined in the spreadsheet
Spreadsheet Parsing • Components • Spreadsheet with requirements (saved as CSV file) • Adheres to a strict format • Script that parses CSV to generate KURL code • Contains KURL code templates
Spreadsheet Parsing • Components
KURL Automation • Service Item Request • We have • Service item that defines standards • We want • Service item to gather requirements for a new service item • Task process that builds the requested service item
Service Item Request • Components • Service item that gathers necessary requirements • Name • Questions • Task handler that assembles and executes KURL code • Contains the KURL code templates
KURL Resources • Files and introduction http://community.kineticdata.com/60_KURL/Documentation/02_Get_Started • KURL guide http://community.kineticdata.com/60_KURL/Documentation/03_Guide • Help (support for KURL is handled through our support forums) http://support.kineticdata.com/viewforum.php?id=11