Skip to main content

Veritran Docs

Invoke a Transaction

To integrate your transaction in your app, you need to call it from a process. In the examples below, you will learn how to integrate the login transaction created in the use case scenario in a login process, and how to invoke this process from a submit button.

  1. In your app's branch, go to Branch Design > Processes.

  2. Click + New lambda process.

  3. In the right panel, add a name that represents your process' function, and a description to summarize its goal. For this example, type Validate_login, Process that validates a user login.

  4. In the lambdas editor's left panel, click Transactions, and then drag the Execute transaction block into the canvas. Connect the block to the On start.

    execute_trx.gif
  5. Use the search bar next to the canvas to look for your transaction and call it from the process. Search by transaction's code only. In this case, search for the 1058 code. The search bar will retrieve a block with your transaction's information and its inputs and outputs.

  6. Drag the results to the blank space next to Execute transaction block.

    Transaction_Lambda.gif
  7. Now, complete the process' inputs, which is the information the process will capture and transfer to the transaction. This process receives the user and password, which will then be transferred to the login transaction's Start node for their validation.

    Go to the editor's left panel, click Global Variables and add the Get text block next to the user and password inputs.

    Lambda_gettext.gif
  8. Add a Text block next to each Get text block created during the previous step. In the user text block, type 3 to enter the register where the username is stored. In the password text block, type 4 to enter the register where the password is stored.

    gettext_registers.png
  9. The Outputs section is automatically detecting the values the parameters are receiving when the transaction is executed. These are the End node's inputs.

  10. Go to the Next section in the left panel, and add the Request next render sequence block, to indicate the action that should execute after the login. Select the sequence, layout and views where you want to direct the user once logged in by clicking the blank spaces.

    lambda_next.gif

Then, invoke this process from your app's login screen. For this example, set the Validate_login process on the "submit" button in your login screen.

  1. Go to your app's screens page and edit your login screen.

  2. Click the "submit" button set on the screen, and go to the Actions tab in the right panel. In the On Click field, click the three-dot icon, and the Create new link modal window appears.

  3. Select the Lambda option in the first drop-down menu, and then the login process on the second one.

    lambda_component.gif

This way, the user logs in, clicks the submit button, and triggers the login process, which at the same time, triggers the login transaction.