Skip to content

Playground

Try out Mustang's criteria evaluation directly in your browser. Write a Criteria (DNF or CNF) and an Event (the JSON object representing an incoming event), then click Evaluate to see whether the criteria matches — along with a per-predicate debug trace.

Client-side only

This playground runs entirely in JavaScript. It mirrors Mustang's Java evaluation logic for the most common predicate and detail types. No data leaves your browser.


Supported features

Feature Supported
DNFCriteria (conjunctions of predicates)
CNFCriteria (disjunctions of predicates)
IncludedPredicate
ExcludedPredicate
EqualityDetail
INDetail (set membership)
RangeDetail (numeric)
ExistenceDetail
NonExistenceDetail
RegexDetail
VersioningDetail
ContainsDetail
AnyDetail
UNFCriteria (arbitrary nesting) ❌ (use evaluate() API in Java)
PreOperation transforms ❌ (apply transforms to your event JSON manually)
JSONPath lhs expressions ❌ (use simple dot-path keys e.g. $.age)

Criteria JSON
Event JSON (RequestContext payload)
Enter criteria and event JSON above, then click Evaluate.

Criteria JSON reference

DNFCriteria

{
  "@type": "DNFCriteria",
  "id": "my-criteria",
  "conjunctions": [
    {
      "predicates": [
        {
          "@type": "IncludedPredicate",
          "lhs": "$.fieldName",
          "detail": { "@type": "EqualityDetail", "value": "expected" }
        }
      ]
    }
  ]
}

The criteria matches if any conjunction matches (OR of AND-groups).

CNFCriteria

{
  "@type": "CNFCriteria",
  "id": "my-criteria",
  "disjunctions": [
    {
      "predicates": [
        {
          "@type": "IncludedPredicate",
          "lhs": "$.fieldName",
          "detail": { "@type": "INDetail", "values": ["a", "b"] }
        }
      ]
    }
  ]
}

The criteria matches if every disjunction matches (AND of OR-groups).

Detail types quick reference

@type Required fields Notes
EqualityDetail value String comparison
INDetail values (array) Value must be in list
RangeDetail lowerBound, upperBound Optional includeLowerBound / includeUpperBound (default true)
ExistenceDetail Field must be present and non-null
NonExistenceDetail Field must be absent or null
RegexDetail value (pattern) Full Java-regex syntax
VersioningDetail type (ABOVE/BELOW/EQUAL), value Optional excludeBase (default false)
ContainsDetail value (substring) Case-sensitive
AnyDetail Always matches

lhs field paths

In the playground, use simple dot-notation JSONPath expressions:

$.age          → event["age"]
$.user.city    → event["user"]["city"]
$.order.amount → event["order"]["amount"]

Full JSONPath expressions (filters, wildcards, array indexing) require the Java engine.