Skip to main content

Veritran Docs

[en] Create a Lambda Process

Ten en cuenta que, ya que las transacciones varían según la funcionalidad que deseas construir y los requisitos del cliente, es posible que encuentres diferentes enfoques sobre cómo crear una transacción similar.

Considera este escenario:

Requisitos previos

[en] For this example, it is contemplated the use of:

  • [en] a transaction that decrypts and validates the information provided by the user. To learn how to create the login validation transaction, refer to Create a Configurable Transaction;

  • [en] a login screen from which the lambda process will be invoked;

  • [en] a landing screen to be redirected once the information is validated;

  • [en] and a lambda process containing the logic with the behavior of the app in case the information provided is invalid.

Nota

[en] Even though the last three items are not indispensable for the creation of the lambda process, it is suggested to have them ready beforehand to complete the configuration of the process.

[en] How to create a lambda process to validate user and password in a login
  1. Ve a Branch Edition > Processes.

  2. En la pestaña Lambda Processes, haz clic en + New lambda process.

  3. En la pestaña Settings que se abre por defecto, completa la información sobre la transacción que estás construyendo.

    1. [en] In the Name field, add a name to the lambda process that represents its functionality. For this example, set USR_LOGIN.

    2. [en] In the Description field, add a short text that explains the aim of the logic created. If there is a transaction included in the process, add its code to the process description to easily track it. For this example, set Validates user and password in a login with trx 1058.

    3. Para este ejemplo, establece el valor String.

  4. Para hacerlo, sigue estos pasos:

    set_trx_variable.gif
    1. Busca la categoría de bloques Call APIs en el menú de bloques de la izquierda o utiliza la barra de búsqueda.

    2. [en] Click to open the category and click Make a Variable... to create a new one.

    3. [en] Set the variable name and click Ok to finish the creation process. For this example, set trx_login.

    4. [en] Then, find the set variable to block, drop it into the canvas and connect it to the on start block.

    5. [en] Select the trx_login variable from the variables dropdown.

    6. [en] Then, find the transaction created to validate the login using the search bar. For this example, search for the transaction code 1058. Drag the transaction block into the canvas and connect it to the set variable to block.

    Buenas prácticas

    [en] Setting the transaction as a variable is considered a good practice as it improves the readability of the lambda process and allows you to easily reuse the transaction within the lambda process as many times as you may need.

  5. Haz clic para abrir la categoría y ver las funciones disponibles.

    execute_trx.gif
  6. [en] Then, find the trx_login variable in the Variables block category and drag it into the execute transaction block.

  7. Haz clic para abrir la categoría y ver las funciones disponibles.

    next_sequence.gif
  8. [en] Select the sequence, layout and view of the landing screen you want to open once the information is validated. For this example, select S001, contents1 and V01 respectively.

  9. Haz clic para abrir la categoría y ver las funciones disponibles.

    set_error.gif
  10. Para este ejemplo, establece el registro 3.

  11. Busca la categoría de bloques Call APIs en el menú de bloques de la izquierda o utiliza la barra de búsqueda. Haz clic para abrir la categoría y ver las funciones disponibles.

    Save_register.gif
  12. Para este ejemplo, establece el registro 1200.

  13. Busca la categoría de bloques Call APIs en el menú de bloques de la izquierda o utiliza la barra de búsqueda. Haz clic para abrir la categoría y ver las funciones disponibles.

  14. [en] Complete the text block with the error message. For this example, set Invalid user or password.

  15. Haz clic para abrir la categoría y ver las funciones disponibles.

  16. [en] Select the process lambda previously created to be executed after the error message is shown. For this example, select APP_ERROR_TRX.

    next_lambda_error.gif
  17. [en] Before saving, you can run the process through the simulator to test the logic of the lambda process and ensure that it works as expected. This step is optional.

  18. Haz clic en Save en la barra de acciones. Se abrirá el modal para agregar el mensaje de commit, completa la descripción de los últimos cambios realizados y, si corresponde, los detalles del ticket de JIRA relacionado, luego haz clic en Save nuevamente para finalizar el proceso de creación.