def run():
    print(
        "***************** Codeable Models Class Relations *****************")
    generator = PlantUMLGenerator()
    generator.generate_class_models("codeable_models_model", [
        codeable_models_all, {}, codeable_models_hierarchy, {
            "render_associations": False,
            "render_attributes": False
        }, bundles_model, {
            "render_attributes": False,
            "included_associations": [bundle_elements_relation]
        }, classifier_model, {
            "included_associations": [
                inheritance_relation, classifier_association_relation,
                classifier_attribute_relation
            ]
        }, metaclass_model, {
            "excluded_associations": [inheritance_relation]
        }, stereotype_model, {
            "excluded_associations": [
                inheritance_relation, classifier_association_relation,
                association_source_relation, association_target_relation
            ]
        }, class_model, {}, object_model, {}, association_model, {
            "excluded_associations": [inheritance_relation]
        }, link_model, {}
    ])
    print(
        f"... Generated models in {generator.directory!s}/codeable_models_model"
    )
Ejemplo n.º 2
0
def run():
    print(
        "***************** Microservice Component Model 3: Meta-modelling example (instance model) *****************"
    )
    print("*** Stereotypes and Extended Introspection")
    print_stereotypes_and_extended_introspection()
    print("*** Instances Introspection")
    print_instances_introspection()
    print("*** Tagged Values")
    print_tagged_values()
    print("*** Default Values")
    print_default_values()
    print('*** Plant UML Generation')
    generator = PlantUMLGenerator()
    generator.object_model_renderer.left_to_right = True
    generator.generate_object_models("microservice_component_model3", [
        microservice_component_model3, {},
        microservice_component_model3_instance_model_no_attribute_or_tag_values,
        {
            "render_attribute_values": False,
            "render_tagged_values": False
        }
    ])
    # avoid doing this step twice, it is also called in ..._class_model.py
    # generator.generate_class_models("microservice_component_model3", [component_meta_model3, {}])
    print(
        f"... Generated models in {generator.directory!s}/microservice_component_model3"
    )
Ejemplo n.º 3
0
def run():
    print("***************** Microservice Component Model 1: Meta-modelling example (class model) *****************")
    print('*** Plant UML Generation')
    generator = PlantUMLGenerator()
    generator.class_model_renderer.left_to_right = True
    generator.generate_class_models("microservice_component_model1",
                                    [microservice_component_model1_class_model, {}])
    print(f"... Generated models in {generator.directory!s}/microservice_component_model1")
Ejemplo n.º 4
0
def run():
    print("***************** Shopping Model Example 1 *****************")
    print('*** Plant UML Generation')
    generator = PlantUMLGenerator()
    generator.generate_class_models(shopping_model.name, [shopping_model, {}])
    print(
        f"... Generated models in {generator.directory!s}/{shopping_model.name!s}"
    )
Ejemplo n.º 5
0
def run():
    print("***************** Shopping Model Example 2 *****************")
    print('*** Attribute introspection examples')
    print_attribute_introspection_examples()

    print('*** Plant UML Generation')
    generator = PlantUMLGenerator()
    generator.generate_class_models(shopping_model.name, [shopping_model, {}])
    print(f"... Generated models in {generator.directory!s}/{shopping_model.name!s}")
Ejemplo n.º 6
0
def run():
    print(
        "***************** Shopping Model Instance Model 1 (Using Shopping Model 4) *****************"
    )
    print('*** Plant UML Generation')
    generator = PlantUMLGenerator()
    generator.generate_object_models("shopping_instance2",
                                     [shopping_instance2_all, {}])
    print(
        f"... Generated models in {generator.directory!s}/shopping_instance2")
def run():
    print("***************** Shopping Activity Model 1: Meta-modelling example (Instance Model) *****************")

    print("*** Classes introspection")
    print_classes_introspection_examples()

    print('*** Plant UML Generation')
    generator = PlantUMLGenerator()
    generator.object_model_renderer.left_to_right = True
    generator.generate_object_models(shopping_activity_instance_model.name, [shopping_activity_instance_model, {}])
    print(f"... Generated models in {generator.directory!s}/{shopping_activity_instance_model.name!s}")
def run():
    print(
        "***************** Microservice Component Model 2: Meta-modelling example (Instance Model) *****************"
    )
    print('*** Plant UML Generation')
    generator = PlantUMLGenerator()
    generator.object_model_renderer.left_to_right = True
    generator.generate_object_models(
        "microservice_component_model2",
        [microservice_component_model2_instance_model, {}])
    print(
        f"... Generated models in {generator.directory!s}/microservice_component_model2"
    )
Ejemplo n.º 9
0
def run():
    print("***************** Shopping Model Example 3 *****************")

    print("*** Association introspection")
    print_association_introspection_examples()

    print("*** Class introspection\n")
    print_class_introspection_examples()

    print('*** Plant UML Generation')
    generator = PlantUMLGenerator()
    generator.generate_class_models("shopping_model3", [
        shopping_model_all, {}, shopping_model_persons, {},
        shopping_model_orders, {}
    ])
    print(f"... Generated models in {generator.directory!s}/shopping_model3")
Ejemplo n.º 10
0
def run():
    print(
        "***************** Shopping Activity Model 2: Meta-modelling example (class-level) *****************"
    )

    print("*** Classes introspection")
    print_classes_introspection_examples()

    print('*** Plant UML Generation')
    generator = PlantUMLGenerator()
    generator.class_model_renderer.left_to_right = True
    generator.generate_class_models(shopping_activity_class_model.name, [
        shopping_activity_class_model, {
            "render_metaclass_as_stereotype": True
        }
    ])
    print(
        f"... Generated models in {generator.directory!s}/{shopping_activity_class_model.name!s}"
    )
Ejemplo n.º 11
0
def run_all():
    generator = PlantUMLGenerator()
    generator.delete_gen_dir()

    for method in [
            run_shopping_model1, run_shopping_model2, run_shopping_model3,
            run_shopping_instances1, run_shopping_instances2,
            shopping_activities1_class_model,
            shopping_activities1_instance_model,
            run_shopping_shopping_activity_model2,
            run_microservice_component_model1_class_model(),
            run_microservice_component_model1_instance_model(),
            run_microservice_component_model2_class_model(),
            run_microservice_component_model2_instance_model(),
            run_microservice_component_model3_class_model(),
            run_microservice_component_model3_instance_model(),
            run_metamodel_rendering, run_codeable_models_class_relations
    ]:
        run_in_process(method)

    return generator.directory
def run():
    print(
        "***************** Microservice Component Model 3: Meta-modelling example (class model) *****************"
    )
    print("*** Stereotypes and Extended Introspection")
    print_stereotypes_and_extended_introspection()
    print("*** Instances Introspection")
    print_instances_introspection()
    print("*** Tagged Values")
    print_tagged_values()
    print("*** Default Values")
    print_default_values()
    print('*** Plant UML Generation')
    generator = PlantUMLGenerator()
    generator.class_model_renderer.left_to_right = True
    generator.generate_class_models("microservice_component_model3", [
        microservice_component_model3, {},
        microservice_component_model3_no_tagged_values, {
            "render_tagged_values": False
        }
    ])
    generator.class_model_renderer.left_to_right = False
    generator.generate_class_models("microservice_component_model3",
                                    [component_meta_model2, {}])
    print(
        f"... Generated models in {generator.directory!s}/microservice_component_model3"
    )
Ejemplo n.º 13
0
def run():
    print(
        "***************** Rendering Predefined Meta-Models *****************")
    generator = PlantUMLGenerator()
    generator.generate_class_models("component_metamodel",
                                    componentMetamodelViews)
    print(
        f"... Generated models in {generator.directory!s}/component_metamodel")
    generator.generate_class_models("microservices_metamodel",
                                    microservice_metamodel_views)
    print(
        f"... Generated models in {generator.directory!s}/microservices_metamodel"
    )
    generator.generate_class_models("activity_metamodel",
                                    activity_metamodel_views)
    print(
        f"... Generated models in {generator.directory!s}/activity_metamodel")
def run():
    print("***************** Shopping Activity Model 2: " +
          "Example combining object, class, and meta-del *****************")

    print('*** Plant UML Generation')
    generator = PlantUMLGenerator()
    generator.generate_class_models("workflow_class_model",
                                    [workflow_class_model, {}])
    generator.object_model_renderer.left_to_right = True
    generator.generate_object_models("shopping_trace_object_model", [
        shopping_trace_object_model, {},
        shopping_trace_object_model_with_objects, {}
    ])
Ejemplo n.º 15
0
def run():
    print(
        "***************** Shopping Model Instance Model 1 (Using Shopping Model 4) *****************"
    )

    print("*** Attribute Getting / Setting")
    print_attribute_getting_setting_examples()

    print("*** Link Introspection")
    print_link_introspection_examples()

    print('*** Plant UML Generation')
    generator = PlantUMLGenerator()
    generator.generate_object_models("shopping_instance1", [
        shopping_instance1_order_model, {
            "render_association_names_when_no_label_is_given": True
        }, shopping_instance1_staff_model, {
            "render_association_names_when_no_label_is_given": True
        }
    ])

    # change links to generate the "wrong" staff model as well
    delete_links({manager: [crm1, crm2]})
    add_links({manager: [crm1, crm2]}, association=staff_reports_to_relation)

    shopping_instance1_staff_model.name = shopping_instance1_staff_model.name + "_wrong"
    generator.generate_object_models("shopping_instance1", [
        shopping_instance1_staff_model, {
            "render_association_names_when_no_label_is_given": True
        }
    ])

    # correct the links again
    delete_links({manager: [crm1, crm2]})
    add_links({manager: [crm1, crm2]}, role_name="managed")

    print(
        f"... Generated models in {generator.directory!s}/shopping_instance1")