Project

General

Profile

Reference.TYPE_EXISTING

It is reference that is set in the definition section of the contract.

For reference you should specify conditions by which will be checked contract with

Reference.isMatchingWith(Approvable a, Collection<Contract> contracts)

This type of reference can be set with conditions:

  • role (list of role names)
  • origin
  • fields (list of field names)
  • EBNF3 conditions:
condition = (all_of | any_of | simple condition)

all_of = "all_of", {condition}

any_of = "any_of", {condition} 

simple condition = (operation_expression | operator_expression)

operation_expression = field_selector, right_operation

operator_expression = field_selector, operator, (constant | field_selector)

constant = ("null" | number | string | true | false)

field_selector = ("this" | "ref" | some_ref_name), ("definition", ".",  field_name) | ("state", ".", field_name)

field_name = (special_name | "data.", user_field_name)

user_field_name = any_string_id

special_name = "created_at", "origin", "creator", "issuer", "owner", etc.....

operation = "defined" | "undefined" 

operator = "<" | ">" | "<=" | ">=" | "!=" | "==", "matches"

F. e. you can set referenes by adding following to definition section in the dsl file:

 # reference contains the conditions which must be specified for the other contracts to link
 reference:
  name: ref_name
  # At least 1 condition is expected. The other is optional.
  where:
    roles:
      - owner
 #  origin: ~
    fields:
      - description
      - transactional_units_left