5

I'm collaborating on a large Kynetx app with another developer. To make it easier to split up the work, I'd like to have multiple rulesets so we can work on them separately without stepping on each other's toes.

Is there a way to raise an event (explicit or otherwise) in another ruleset? Something like this in a postlude:

raise explicit event next_section in a163x50

I know it's possible to do with JavaScript in the browser, but I'd like to do this from the KRL on the server side.

Steve Nay
  • 2,819
  • 1
  • 30
  • 41

1 Answers1

5

You can raise events in the postlude, and you use with [appid] instead of in. Check out the Explicit Events section of the Postlude Documentation.

Here is an example postlude, raising an event to a new app with some context:

fired {
  raise explicit event "something" for a163x50 with cheese = "swiss";
}

For a really complete walkthrough of loosely coupled rulesets, see Phil Windley's post called Tweeting from KBlog.

Don't forget about modules for code reuse. Wrapping functionality in a module makes it much easier to test that code, and enable use within multiple rulesets.

TelegramSam
  • 2,770
  • 1
  • 17
  • 22
  • Thanks! The reason I can't just do this with modules is I need to have a bunch of rules that interoperate to get the right behavior. Functions and actions aren't enough. – Steve Nay May 18 '11 at 18:31
  • I've seen a few cases where this is required. Also, ++geek_cred when you do. – Randall Bohn May 19 '11 at 02:07
  • I love multiple rulesets in an app.... I just mentioned modules as a way to handle the cases where it is appropriate. – TelegramSam May 19 '11 at 17:28