Questions tagged [krl]

KRL stands for Kinetic Rule Language. Use this tag for questions regarding KRL applications.

The Kinetic Rule Language was developed by Kynetx and runs on the Kinetic Event Architecture platform. KEA is a cloud-based platform for building real-time, context-aware applications that connect web services across multiple browsers and devices. It is the event layer that glues services like Twilio, Twitter, Google, Facebook, Amazon and others.

KRL is particularly useful for creating Evented systems. KRL is also used for writing Browser Applications. As such, KRL questions frequently overlap with questions about CSS, JavaScript, HTML, and jQuery.

Some places to start:

126 questions
4
votes
2 answers

Can I use the > operator in a KRL query() selector?

I want to get a nested DIV tag using KRL query() but it complains with ERROR Rules.pm a8x40 show_xfers Ruleset a8x40 failed: html.query error - Invalid specification ">div" in query: div.recent-transfer>div Here's the HTML fragment (there are…
Randall Bohn
  • 2,597
  • 2
  • 16
  • 20
4
votes
2 answers

Beestings in a heredoc within a global function

I'm having trouble with using beestings in a heredoc in a global function. The runtime throws an error "Exception: arg2 is not defined". Here is an example: ruleset a163x59 { meta { name "Beesting in heredoc" description << …
Steve Nay
  • 2,819
  • 1
  • 30
  • 41
4
votes
3 answers

What is the best way to iterate over a Hash in KRL?

Let's say I have a hash where I don't know the contents of the hash (so I can't use pick for this). Here is an example of the hash: { "key1" : "value1", "key2" : "value2", "key3" : "value3" } I want to iterate over this hash and create the…
Mike Farmer
  • 2,992
  • 4
  • 28
  • 32
4
votes
1 answer

KRL extended quoting

There are two ways to do extended quoting in KRL. One of them is documented under Literals on Kynetx Docs. That looks like this: var = << Some text >>; That syntax allows you to embed beestings (e.g., #{var}) in the text. However, I've also seen…
Steve Nay
  • 2,819
  • 1
  • 30
  • 41
4
votes
3 answers

KRL: if then else problems

I am trying to write something comparable to an If, else if, else statement. However, the online compiler is giving me problems. I usually write my code in jquery and just emit it... but I am trying to do it the KRL way this time and I am running…
frosty
  • 21,036
  • 7
  • 52
  • 74
4
votes
1 answer

Weird KRL foreach behavior

I've been getting some odd behavior using a foreach today. I have a dataset that's pulling in a JSON document. Part of it is an array, which I pick() out and send to the foreach. Here's my global block: global { dataset appserver <-…
Steve Nay
  • 2,819
  • 1
  • 30
  • 41
4
votes
2 answers

JavaScript setTimeout being cleared on Facebook in KRL app

I'm using a setTimeout that calls itself each time it runs to continual check the contents of different pages since each page gets loaded via ajax. It seems that the Facebook JS is running through all the possible setTimeout references and calling…
Mike Grace
  • 16,636
  • 8
  • 59
  • 79
4
votes
1 answer

In KRL can I have a persistent variable count down instead of up?

I want to have an app variable count down instead of up. I put the following in the postlude of one rule: fired { app:pies -= 1 from 10; } The variable app:pies would count from 10 down to 1 but it never reached zero. I need to stop giving out…
Randall Bohn
  • 2,597
  • 2
  • 16
  • 20
4
votes
1 answer

Detect empty pick() from hash in KRL

I have a bunch of data in a hash and I am picking from it. Sometimes there will be data there to pick and sometimes there won't. What is the best way to know when there was something found by the pick operator and when there wasn't so I can react to…
Mike Grace
  • 16,636
  • 8
  • 59
  • 79
4
votes
1 answer

How can I avoid floating the same content twice?

My Kynetx app uses float_html() to put up a box full of content. rule float_box { select when pageview ".*" pre { content = <<

Floating Message Box

    >>;…
    Randall Bohn
    • 2,597
    • 2
    • 16
    • 20
    4
    votes
    1 answer

    Long-term persistence in Kynetx apps (via entity variables or something else)

    I have an app that allows the user to enter a name and other relevant information to be used in submitting a request to a web service. I'd like to store that and use it to pre-fill the form the next time the app runs. Entity variables would be great…
    Steve Nay
    • 2,819
    • 1
    • 30
    • 41
    4
    votes
    1 answer

    How do I access the message body from the Kynetx email endpoint?

    I want to extract a URL from an inbound email message and then http:get() the URL. How can I access the message body? select when mail received from "(.*)@example.com" setting user pre { /* extract first URL from message */ } http:get(URL); So what…
    Randall Bohn
    • 2,597
    • 2
    • 16
    • 20
    4
    votes
    1 answer

    Boolean expressions with strings and numbers

    I have two variables in my pre block, and I need a third (a boolean) that identifies whether certain properties hold of those two: str = "some string from a datasource"; qty = 15; //Also from a datasource The third variable, valid, needs to be true…
    Steve Nay
    • 2,819
    • 1
    • 30
    • 41
    4
    votes
    1 answer

    Debugging tools and tips for dual execution environment of KRL

    Because of the dual execution environment of KRL, I'm looking for better ways to debug my Kynetx applications. What applications can I run on my local computer to help with debugging Kynetx apps that interact with the web domain? What web services…
    Mike Grace
    • 16,636
    • 8
    • 59
    • 79
    3
    votes
    1 answer

    Kynetx and SOAP

    I have been searching the web and Kynetx.com for any documetation or examples of how to use SOAP with KRL but have come up with nothing. Sadly the web services I am working with has a lot of SOAP rather then REST. If there is any links of…
    Reed
    • 73
    • 5
    1
    2
    3
    8 9