|
@@ -1074,6 +1074,35 @@ String function cmd_process_execute(process : String, mapping : Element):
|
|
|
else:
|
|
|
return "Model not found: " + process!
|
|
|
|
|
|
+String function cmd_process_signature(process : String):
|
|
|
+ // Execute a process model until it reaches termination
|
|
|
+ String process_id
|
|
|
+ String result
|
|
|
+ Element signature
|
|
|
+ Element keys
|
|
|
+ String key
|
|
|
+
|
|
|
+ process_id = get_entry_id(process)
|
|
|
+ if (process_id != ""):
|
|
|
+ if (allow_read(current_user_id, process_id)):
|
|
|
+ Element pm
|
|
|
+ pm = get_full_model(process_id, get_entry_id("formalisms/ProcessModel"))
|
|
|
+ if (element_eq(pm, read_root())):
|
|
|
+ return "Specified model cannot be interpreted as a ProcessModel: " + process!
|
|
|
+
|
|
|
+ result = "Success: "
|
|
|
+ signature = PM_signature(pm)
|
|
|
+ keys = dict_keys(signature)
|
|
|
+ while (set_len(keys) > 0):
|
|
|
+ key = set_pop(keys)
|
|
|
+ result = result + key + " : " + cast_string(signature[key]) + "\n"
|
|
|
+
|
|
|
+ return result!
|
|
|
+ else:
|
|
|
+ return "Permission denied to model: " + process!
|
|
|
+ else:
|
|
|
+ return "Model not found: " + process!
|
|
|
+
|
|
|
String function cmd_transformation_between(source_dict : String, target_dict : String):
|
|
|
Element result
|
|
|
Element subresult
|
|
@@ -2226,6 +2255,8 @@ Void function user_function_skip_init(user_id : String):
|
|
|
output(cmd_model_add(single_input("Model type?"), single_input("Model name?"), single_input("Model textual representation?")))
|
|
|
elif (cmd == "process_execute"):
|
|
|
output(cmd_process_execute(single_input("Process to execute?"), dict_input("Model bindings to use?")))
|
|
|
+ elif (cmd == "process_signature"):
|
|
|
+ output(cmd_process_signature(single_input("Process to execute?")))
|
|
|
elif (cmd == "transformation_between"):
|
|
|
output(cmd_transformation_between(dict_input("Source signature?"), dict_input("Target signature?")))
|
|
|
elif (cmd == "model_render"):
|