Skip to main content

filterByCookbook

A Workflow Engine function that allows you to filter inscape Situations (trigger and swept up) based on their Visualize data. These are inclusive filters and return true if the Visualize data for the Situation matches the cookbook name.

This function is available as a feature of the Workflow Engine v1.1 download and later.

This function is available for Situation workflows only.

Back to Workflow Engine Functions Reference.

Arguments

Workflow Engine function filterByCookbook takes the following arguments:

Name

Required

Type

Description

cookbook

Yes

String

Name of the cookbook to filter by.

Example

The following example demonstrates typical use of Workflow Engine function filterByCookbook.

If you want to check if the cookbook name is "Default Cookbook", enter the following:

  • cookbook: Default Cookbook

The UI translates your settings to the following JSON:

{"cookbook":"Default Cookbook"}

Given a Situation with the following Visualize data:

{
    "visualize": {
        "origin": "Cookbook",
        "cookbook_name": "Default Cookbook",
        "recipe_name": "Description"
    }
}

The function returns true, since the value of cookbook matches the Visualize data.

Now consider this filter:

{"cookbook":"MyCookbook"}

In this case the function returns false, since the value of cookbook does not match the Visualize data.