Browse Source

More documentation

Yentl Van Tendeloo 8 years ago
parent
commit
07dac382a7
1 changed files with 35 additions and 11 deletions
  1. 35 11
      doc/wrappers.rst

+ 35 - 11
doc/wrappers.rst

@@ -82,38 +82,62 @@ Functions
 
    Overwrites the model previously known under the name *model_name* with the model code in *new_model_code*.
    This operation differs from first deleting the model and then recreating it, as all metadata of the model is kept, such as access permissions.
+   The new model can be kept empty, in which case the model will be cleared.
 
 .. function:: user_logout()
 
-   Expl
+   Logs out the current user, thereby closing the task.
+   Subsequent operations will no longer have any effect, as the task was terminated.
+   To log in as a different user, the *init* operation has to be executed again.
 
 .. function:: user_delete()
 
-   Expl
+   Delete the current user and thereafter log out.
+   This removes the current user, making it impossible to log in as this user again.
+   Existing models tied to this user, such as those the user is an owner of, remain bound to the (removed) user.
+   While it is possible to recreate a new user with the same name, model permissions will not be inherited to this new user with the same name.
 
 .. function:: model_render(model_name, mapper_name)
 
-   Expl
+   Render the model by name of *model_name* using the mapper by name of *mapper_name*.
+   Both parameters have to be known models in the Modelverse.
+   Outputs a JSON representation of the rendered model.
 
 .. function:: transformation_between(source, target)
 
-   Expl
+   List all transformations that originate at *source* and end at *target*.
+   Transformations can still be selected, even if they take more source models than those specified in the parameters.
 
-.. function:: transformation_add_MT(source_metamodels, target_metamodels, operation_name, code)
+.. function:: transformation_add_MT(source_metamodels, target_metamodels, operation_name, code, callback=lambda: None)
 
-   Expl
+   Create a new model transformation operation.
+   The new transformation takes *source_metamodels* as input, and generates *target_metamodels* as output.
+   Both parameters are dictionaries of the form {name: metamodel_name}.
+   The name is used later on in the model transformation as a prefix to the type.
+   A single metamodel_name can be used for multiple names.
+   Note that the target metamodel names may overlap with the source metamodel names, but the metamodel type should be identical.
+   The operation is henceforth known by *operation_name* and is provided as a model in the string *code*.
+   Optionally, a callback is defined which performs some operations on the merged metamodel, for example to define tracability links between (previously unrelated) metamodels.
+   In the background, this operation does all necessary RAMification and model merging.
 
-.. function:: transformation_add_AL(source_metamodels, target_metamodels, operation_name, code)
+.. function:: transformation_add_AL(source_metamodels, target_metamodels, operation_name, code, callback=lambda: None)
 
-   Expl
+   Creates a new action language operation.
+   Similar to *transformation_add_MT*, but now does not require RAMification.
+   The *code* parameter also is not specified as a Modelverse model (.mvc), but as action language (.alc).
 
-.. function:: transformation_add_MANUAL(source_metamodels, target_metamodels, operation_name)
+.. function:: transformation_add_MANUAL(source_metamodels, target_metamodels, operation_name, callback=lambda: None)
 
-   Expl
+   Creates a new manual operation.
+   Identical to *transformation_add_AL*, but does not take any code as content.
 
 .. function:: transformation_execute_AL(operation_name, input_models_dict, output_models_dict, callback=lambda i: None)
 
-   Expl
+   Executes the Action Language model *operation_name* with *input_models_dict* as inputs and *output_models_dict* as outputs.
+   For both dicts, the contents describe the mapping between the parameter names of the operation to the names in the Modelverse.
+   Values in *input_models_dict* must be existing models, whereas values in *output_models_dict* can be non-existing upon invocation.
+   A *callback* function can be defined when the action language model requires user input or output.
+   This callback function can be used to communicate with the executing action language directly.
 
 .. function:: transformation_execute_MANUAL(operation_name, input_models_dict, output_models_dict, callback=lambda i: None)