Skip to main content

Veritran Docs

How to create a module and invoke a configurable component in your app

After you create a module, you must follow several steps to be able to invoke and use its content from a parent app or module. These steps involve entities that must be configured beforehand, that you will need when you configure the module interfaces. The decision as to whether you need to create these entities or use existing ones depends on the characteristics of the module you need to create and the purpose it will fulfill. To learn more about when you should create a module, read Modules.

The steps below must be taken to invoke and use a module's content.

  1. Create the module.

  2. Define the app layout template or templates to be applied to the views of the module's screens.

  3. Define the view or views to be used in the app screens.

    Note

    Mobile apps usually contain one view that refers to the whole content of the screen.

  4. Create the screen or screens where the content of the module will be designed (either the content involves configured components or screens flows).

  5. Create the module interface or interfaces that will communicate the module with the parent app or module, depending on the screens previously created.

  6. Link the module to the parent app or module where you want to invoke the configured component or screens flow that the interfaces represent.

  7. Invoke the configured component or screens flow from the parent app or module.

The use case below involves creating a module with a component that shows a generic error in the app. In addition, you will set that, when the user closes the error message, the session is closed and the user is redirected to the Login screen.

In this case, you must build a module and make use of its reusable capabilities for two reasons: on one hand, you need to apply it in several screens of the app, so the correct practice would be to use a configurable component and avoid creating one component per screen; on the other hand, considering it is a generic error, it can be reused in any other app or module. These sections below explain how to perform each of the steps specified above.