Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: mostly typo fixes

...

  • understand important concepts about programming in KRL including ruleset structure*
  • know how to install and operate the node pico-engine
  • know how to use the "Engine Rulesets" page to register a ruleset
  • know how to add a ruleset to a Picopico
  • become familiar with using the "My Picos" page to work with your Picospicos

Concepts

*This section is copied verbatim from Quickstart (the one for the original KRE system)

...

In the example above, port number 8084 was chosen. By default, if you run the command `pico-engine` without setting the environment variable, port 8080 will be used. The node pico engine will spend some time initializing internal data structures before it starts its web server.

Note that the web server displays the URL of its document root, ex. "http://localhost:8084" and then continues to run. As we will see later, messages will be logged to this console.

Create a

...

pico

Visit the default web page of your web server. As this page loads, it will perform a bootstrap sequence, which creates a Picopico, known as "Owner Pico" and then registers and installs two rulesets.

...

Code Block
linenumberstrue
ruleset hello_world {
  meta {
    name "Hello World"
    description <<
A first ruleset for the Quickstart
>>
    author "Phil Windley"
    logging on
    shares hello
  }
 
  global {
    hello = function(obj) {
      msg = "Hello " + obj;
      msg
    }
  }
 
  rule hello_world {
    select when echo hello
    send_directive("say") with
      something = "Hello World"
  }
 
}

Enter the ruleset name "hello_world" into the small box (with placeholder "ruleset id") in Open the "Engine Rulesets" page (linked from the "Pico Bootstrap" page), and click the "add" button. Then complete the rulesetpaste the ruleset above into the big text area, and click the "validate" button. When your KRL compiles correctly, you will see a result of "ok" beneath the buttons.

...

Click on the "register" button. Notice the circle beside the ruleset name. This indicates that the source code has been registered with the pico-engine, but is not yet enabled. Click on the "enable" button.

Finally, click on the "install" button. This causes the pico-engine to compile the KRL and cache the compiled version in the "a rulesets" folder folder. Once this has been done, the ruleset can be added to Picospicos.

Adding the Ruleset to your

...

pico

So far, you have installed the ruleset into your pico-engine. But it can't run unless it has been added to a Picopico.

Adding a ruleset to a Pico pico is properly a user function, but as a developer, you are functioning in both user and developer capacities.

View your Owner Pico by visiting the "My Picos" page (linked from the "Pico Bootstrap" page).

Your owner Pico pico is represented by a rounded rectangle, which is placed on a canvas, allowing you to change its placement.

...

Notice that the name of your ruleset is in a drop-down list. Click the "add ruleset" button to add the ruleset to your Picopico.

Notice that you are able to delete the ruleset from the Picopico.

Next Steps

Having completed this quickstart, you should continue with Lesson 1. events and queries

...