Visual Builder

Get Involved. Join the Conversation.

Topic

    Jaeyshree Kumaran
    Error Handling in VBCS
    Topic posted May 10, 2019 by Jaeyshree KumaranRed Ribbon: 250+ Points, tagged Action Flows, Business Objects, Composite Component, Custom Code, Database, JET, Layout, Process, REST, Security, Services, Stage / Publish / DevOps, UI, Validation, Web 
    156 Views, 5 Comments
    Title:
    Error Handling in VBCS
    Summary:
    Is there any way to handle exception in action chains similar to try-catch block in Java?
    Content:

     If I run an action chain and there is an error thrown at middle while executing the action chain, there should be a error handling concept that exits the process with an error message. For every if loop, assign variables i need a error handling process. Its an urgent requirement. 

    Version:
    Version: 19.1.3

    Comment

     

    • Shay Shmeltzer

      For each operation in the action chain you should be able to define a failure flow (note a small + sign on the right of an action when you drag a new action over).

      The json file for the action flow will be something like this:

            "description": "",
            "variables": {
              "selection": {
                "required": true,
                "type": "any[]",
                "input": "fromCaller"
              }
            },
            "root": "callModuleFunction1",
            "actions": {
              "callModuleFunction1": {
                "module": "vb/action/builtin/callModuleFunctionAction",
                "outcomes": {
                  "failure": "fireNotification1",
                  "success": "fireNotification2"
                }
              },
              "fireNotification1": {
                "module": "vb/action/builtin/fireNotificationEventAction"
              },
              "fireNotification2": {
                "module": "vb/action/builtin/fireNotificationEventAction"
              }
            }

      • Jaeyshree Kumaran

        Hi Shay,

        Thanks for the quick response. Consider the below error.

        I followed your steps and had set the success and failure params. But I still receive the error

        The data passed to the if condition throws error because of datatype mismatch/null values. I receive the error(as in screenshot) in my chrome console only. There is no method to handle it in Action chain. From the user perspective, the page stays static without any alert to the user.

        • Jaeyshree Kumaran
        • Michael Blout

          If I understand, the exception is happening in the evaluation of "condition"?

          Exception handling doesn't exist _yet_ for Chains,

          but I wonder if you could move the condition logic to a module JS method, and handle the exception? Your condition would have to be known to not throw an exception; maybe something like? 

          "condition": "{{ $page.functions.getConditions($chain.variables.getSelectedPicker, $current, $application.variables.currentDate }}"