|
@@ -17,6 +17,8 @@ String function constraint_Natural(params : Element):
|
|
|
|
|
|
Element function constraint_String(params : Element):
|
|
|
Element self
|
|
|
+ log("Invoked!")
|
|
|
+ log("params: " + dict_to_string(params))
|
|
|
self = params["model"]["model"][params["name"]]
|
|
|
if (is_physical_string(self)):
|
|
|
return "OK"!
|
|
@@ -76,7 +78,7 @@ Element function initialize_SCD(location : String):
|
|
|
model_add_edge(scd, "attr_name_name", "attr_name", "name_value")
|
|
|
model_add_edge(scd, "class_inh_element", "Class", "Element")
|
|
|
model_add_edge(scd, "attribute_inh_element", "Attribute", "Element")
|
|
|
- model_add_edge(scd, "simple_inh_element", "SimpleAttribute", "Element")
|
|
|
+ model_add_edge(scd, "simple_inh_attribute", "SimpleAttribute", "Attribute")
|
|
|
model_add_edge(scd, "association_inh_element", "Association", "Element")
|
|
|
model_add_edge(scd, "attributelink_inh_element", "AttributeLink", "Element")
|
|
|
|
|
@@ -95,7 +97,7 @@ Element function initialize_SCD(location : String):
|
|
|
retype(scd, "attr_name_name", "attr_name")
|
|
|
retype(scd, "class_inh_element", "Inheritance")
|
|
|
retype(scd, "attribute_inh_element", "Inheritance")
|
|
|
- retype(scd, "simple_inh_element", "Inheritance")
|
|
|
+ retype(scd, "simple_inh_attribute", "Inheritance")
|
|
|
retype(scd, "association_inh_element", "Inheritance")
|
|
|
retype(scd, "attributelink_inh_element", "Inheritance")
|
|
|
|
|
@@ -130,11 +132,11 @@ Element function initialize_SCD(location : String):
|
|
|
model_define_attribute(scd, "Element", "constraint", True, "ActionLanguage")
|
|
|
|
|
|
// Define some constraints
|
|
|
- instantiate_attribute(scd, "Natural", "constraint", constraint_Natural)
|
|
|
- instantiate_attribute(scd, "String", "constraint", constraint_String)
|
|
|
- instantiate_attribute(scd, "Boolean", "constraint", constraint_Boolean)
|
|
|
- instantiate_attribute(scd, "Location", "constraint", constraint_Location)
|
|
|
- instantiate_attribute(scd, "ActionLanguage", "constraint", constraint_ActionLanguage)
|
|
|
+ instantiate_attribute_code(scd, "Natural", "constraint", constraint_Natural)
|
|
|
+ instantiate_attribute_code(scd, "String", "constraint", constraint_String)
|
|
|
+ instantiate_attribute_code(scd, "Boolean", "constraint", constraint_Boolean)
|
|
|
+ instantiate_attribute_code(scd, "Location", "constraint", constraint_Location)
|
|
|
+ instantiate_attribute_code(scd, "ActionLanguage", "constraint", constraint_ActionLanguage)
|
|
|
|
|
|
return scd!
|
|
|
|
|
@@ -147,7 +149,7 @@ Element function initialize_PN(location_SCD : String, location_PN : String):
|
|
|
pn = instantiate_model(scd)
|
|
|
instantiate_node(pn, "Class", "Place")
|
|
|
instantiate_node(pn, "Class", "Transition")
|
|
|
- instantiate_node(pn, "AttributeValue", "Natural")
|
|
|
+ instantiate_node(pn, "SimpleAttribute", "Natural")
|
|
|
instantiate_link(pn, "Association", "P2T", "Place", "Transition")
|
|
|
instantiate_link(pn, "Association", "T2P", "Transition", "Place")
|
|
|
model_define_attribute(pn, "Place", "tokens", False, "Natural")
|
|
@@ -155,7 +157,7 @@ Element function initialize_PN(location_SCD : String, location_PN : String):
|
|
|
model_define_attribute(pn, "T2P", "weight", False, "Natural")
|
|
|
|
|
|
// Add constraint on the Natural
|
|
|
- instantiate_attribute(pn, "Natural", "constraint", constraint_Natural)
|
|
|
+ instantiate_attribute_code(pn, "Natural", "constraint", constraint_Natural)
|
|
|
|
|
|
export_node(location_PN, pn)
|
|
|
|
|
@@ -201,6 +203,9 @@ Void function initialize_AL(scd_location : String, export_location : String):
|
|
|
Element model
|
|
|
Element scd_model
|
|
|
|
|
|
+ if (element_neq(import_node(export_location), read_root())):
|
|
|
+ return!
|
|
|
+
|
|
|
scd_model = import_node(scd_location)
|
|
|
model = instantiate_model(scd_model)
|
|
|
|