开发者

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 wit开发者_如何学编程hout 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜