| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- abstract class Exec
- association Conn_exec [0..*] Exec -> Exec [0..*] {
- String from;
- String to;
- }
- abstract class Data
- association Conn_data [0..*] Data -> Data [0..*] {
- String from;
- String to;
- }
- class Start [1..1] (Exec, Data) {
- optional ActionCode ports_exec_out;
- optional ActionCode ports_data_out;
- ```
- err = check_slot_code_type(this, "ports_exec_out", list[str] | set[str], True)
- err.extend(check_slot_code_type(this, "ports_data_out", list[str] | set[str], True))
- if len(err) == 0:
- err = check_all_connections(this, [
- [],
- eval(get_slot_value_default(this, "ports_exec_out", "['out']")),
- [],
- eval(get_slot_value_default(this, "ports_data_out", "[]"))
- ])
- err
- ```;
- }
- class End [1..1] (Exec, Data) {
- optional ActionCode ports_exec_in;
- optional ActionCode ports_data_in;
- ```
- err = check_slot_code_type(this, "ports_exec_in", list[str] | set[str], True)
- err.extend(check_slot_code_type(this, "ports_data_in", list[str] | set[str], True))
- if len(err) == 0:
- err = check_all_connections(this, [
- eval(get_slot_value_default(this, "ports_exec_in", "['in']")),
- [],
- eval(get_slot_value_default(this, "ports_data_in", "[]")),
- []
- ])
- err
- ```;
- }
- abstract class Rule (Exec, Data)
- {
- String file;
- }
- class Match (Rule)
- {
- optional Integer n;
- ```
- check_all_connections(this, [
- ["in"],
- ["success", "fail"],
- ["in"],
- ["out"]
- ])
- ```;
- }
- class Rewrite (Rule)
- {
- ```
- check_all_connections(this, [
- ["in"],
- ["out"],
- ["in"],
- ["out"]
- ])
- ```;
- }
- class Action (Exec, Data)
- {
- optional ActionCode ports_exec_in;
- optional ActionCode ports_exec_out;
- optional ActionCode ports_data_in;
- optional ActionCode ports_data_out;
- optional ActionCode init `check_code_syntax(get_value(get_target(this)))`;
- ActionCode action `check_code_syntax(get_value(get_target(this)))`;
- ```
- err = check_slot_code_type(this, "ports_exec_in", list[str] | set[str], True)
- err.extend(check_slot_code_type(this, "ports_exec_out", list[str] | set[str], True))
- err.extend(check_slot_code_type(this, "ports_data_in", list[str] | set[str], True))
- err.extend(check_slot_code_type(this, "ports_data_out", list[str] | set[str], True))
- if len(err) == 0:
- err = check_all_connections(this, [
- eval(get_slot_value_default(this, "ports_exec_in", "['in']")),
- eval(get_slot_value_default(this, "ports_exec_out", "['out']")),
- eval(get_slot_value_default(this, "ports_data_in", "[]")),
- eval(get_slot_value_default(this, "ports_data_out", "[]"))
- ])
- err
- ```;
- }
- class Modify (Data)
- {
- optional ActionCode rename;
- optional ActionCode delete;
- ```
- err = check_slot_code_type(this, "rename", dict[str,str])
- err.extend(check_slot_code_type(this, "delete", list[str] | set[str]))
- if len(err) == 0:
- if not (eval(get_slot_value_default(this, "rename", "dict()")).keys().isdisjoint(
- eval(get_slot_value_default(this, "delete", "set()")))
- ):
- err.append("rename and delete should be disjoint.")
- err.extend(check_all_connections(this, [
- [],
- [],
- ["in"],
- ["out"]
- ]))
- err
- ```;
- }
- class Merge (Data)
- {
- ActionCode ports_data_in;
- ```
- err = check_slot_code_type(this, "ports_data_in", list[str] | set[str], True, mandatory = True)
- if len(err) == 0:
- err = check_all_connections(this, [
- [],
- [],
- eval(get_slot_value(this, "ports_data_in")),
- ["out"]
- ])
- err
- ```;
- }
- class Store (Exec, Data)
- {
- ActionCode ports;
- ```
- err = check_slot_code_type(this, "ports", list[str] | set[str], True, mandatory = True, blacklist = ["in", "out"])
- if len(err) == 0:
- err = check_all_connections(this, [
- [*(ports:= eval(get_slot_value(this, "ports"))), "in"],
- [*ports, "out"],
- ports,
- ["out"]
- ])
- err
- ```;
- }
- class Schedule (Exec, Data)
- {
- String file;
- ```
- check_all_connections(this, [
- {get_slot_value(conn, "to") for conn in get_incoming(this, "Conn_exec")},
- {get_slot_value(conn, "from") for conn in get_outgoing(this, "Conn_exec")},
- {get_slot_value(conn, "to") for conn in get_incoming(this, "Conn_data")},
- {get_slot_value(conn, "from") for conn in get_outgoing(this, "Conn_data")}
- ])
- ```;
- }
- class Loop(Exec, Data)
- {
- ```
- check_all_connections(this, [
- ["in"],
- ["it", "out"],
- ["in"],
- ["out"]
- ])
- ```;
- }
- class Print(Exec, Data)
- {
- optional Boolean event;
- optional String label;
- optional ActionCode custom `check_jinja2_code(get_source(this), "custom")`;
- ```
- check_all_connections(this, [
- ["in"],
- ["out"],
- ["in"],
- []
- ])
- ```;
- }
|