Skip to main content

Veritran Docs

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

[en] 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.

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

  1. [en] Create the module.

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

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

    Nota

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

  4. [en] Create the screen or screens where the interfaces content of the module will be designed.

  5. [en] Create the module interface or interfaces, depending on the screens previously created.

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

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

[en] 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.

[en] 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.