Code slots in Rules and Events


As described in Updating a transaction after K2BTools has been applied, K2BEntityServices updates the transaction’s definition. When the developer wants to include custom code in the transaction (both in the Events and the Rules parts), the developer must work with the “Slots” defined by the pattern.

What is a “slot”?

A “slot” is a code section that was created by the pattern to implement a specific feature or set of features. The section is delimited by comments, as shown below.

Code slot example in events

Basically, a code slot starts with a comment with the form: 

//+ <owner>.<functionality><.Fixed>

Where “<owner>” is the pattern that generated the slot, “<functionality>” is the name of the feature it implements. 

The slot ends with a line containg this comment “//-”.

The postfix “.Fixed” may appear or not, depending on the slot. Slots that include the “Fixed” postfix are called “Fixed Slots”, while the rest are called “Non-Fixed Slots”.

NonFixedSlotExample FixedSlotExample
Non-fixed slot example in rules Fixed slot example in rules

Updating Events and Rules where slots are present

The following rules must be followed by the developer:
  1. The developer can add code outside the slots.
  2. The developer can add or update code in “Non-Fixed slots”.
  3. The developer can NOT add add code in “Fixed slots”.