define NODE1={"organization": "org.testexample", "name": "testNode1"}
define NODE2={"organization": "org.testexample", "name": "testNode2"}


define ARG=-1

component Foo(arg) in -> out {
  """
  Foo(arg)
  Documentation please
  """

  init : flow.Init(data=arg)

  .in > init.in
  init.out > .out
}

src : Foo(arg=ARG)
delay : std.ClassicDelay(delay=0.1)
print : io.Print()

src.out > print.token
src.out > delay.token
delay.token > src.in

src.out(routing="round-robin")

# define rules
rule src_rule: node_attr(node_name=NODE1)

rule dst_rule: node_attr(node_name=NODE1) & node_attr(node_name={"name": "testNode2"})
rule src_rule: node_attr(node_name=NODE1) | node_attr(node_name=NODE2) & ~current()
rule combined_rule: dst_rule & src_rule | current()
rule long: node_attr(node_name={"name": "testNode2"}) & node_attr(owner={"personOrGroup": "me"}) & node_attr(adress={"locality": "Lund"})
rule not_rule: ~node_attr(node_name={"name": "testNode2"})

# define a group
group group_name: actor, some_group

# apply rules, '*' indicates optional rule
apply src: combined_rule
apply delay, print: long
apply src, print: dst_rule | node_attr(node_spec=NODE1) & ~current()
