简体   繁体   中英

Raising an event in another ruleset

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM