Project

General

Profile

Actions

Cruxflowdesign » History » Revision 1

Revision 1/21 | Next »
Shuvam Misra, 21/09/2023 01:10 PM


Algorithms and data structures for the flow engine

We will refer heavily to the algorithms and data structures of the BRE here.

Here too, we need a rules schema, rulesets and a matching engine.

Rules schema

In the BRE, each rules schema has two parts: the pattern schema and the action schema. Each rules schema block is tagged with a class attribute, specifying which class the schema applies to. There is one rules schema for each class of entities.

In the flow engine, there is no class -- there is a process instead. A workflow schema applies to a process.

The pattern schema specification is identical here to that used in the BRE.

The flow schema is much simpler. The output of a flow engine matching exercise is just one step ID. Therefore the flow schema here is a list of possible steps.

"ruleschema": {
    "process": "customerkyc",
    "patternschema": {
        "attr": [{
            "name": "cat",
            "type": "enum",
            "vals": [ "textbook", "notebook", "stationery", "refbooks" ]
        },{
            "name": "mrp",
            "type": "float"
        },{
            "name": "fullname",
            "type": "str",
        },{
            "name": "ageinstock",
            "type": "int"
        },{
            "name": "inventoryqty",
            "type": "int"
        }]
    }
    "flowschema": {
        "steps": [ "initialdoc", "aadhaarcheck", "pancheck", "bankdetails", "referenchk", "complete" ]
    }
}

Updated by Shuvam Misra over 1 year ago · 1 revisions