Binary Rule

  • By default platform works out of the box with regular JSON messages, Boodskap also supports text data, binary data and complex JSON documents as messages, this opens up endless possibilities to integrate and implement. For example, you can directly upload an image, video clipping/frame, or some encrypted data which can be processed using this binary rules to decode/decrypt and implement your business logic

  • Context Variable: msg

Eample

Complex JSON

{
  "fruits": [
    {
    "name": "Apple",
    "size": "Large",
    "color": "#FF0000"
    },
    {
    "name": "Orange",
    "size": "Medium",
    "color": "#FFA500"
    }
  ]
}

Binary Rule

def fruits = msg.map().get('fruits');

for(fruit in fruits){
    
  if(fruit.size == 'Large'){
    
    log.info("%s is ready to harvest", fruit.name);
  }else{
    
    log.warn("%s is not ready to harvest", fruit.name);
  }
}

Related REST APIs

Create / Update Binary Rule
Retrieve Binary Rule
Delete Binary Rule
Delete All Binary Rules
List Binary Rules
Count All Binary Rules