Debugging LN sessions

Debugging LN sessions through LN UI

LN Studio can attach to a running LN UI and can debug sessions started in LN UI. Unlike when you debug sessions through BW or Web UI, the sessions are started from LN UI and not from LN Studio.

Note: 
  • To debug sessions, a debug Connection Point is required.

    See Defining connectivity settings.

  • In a multi-tenant environment you cannot debug with LN Studio. You can use the Debug Workbench, see the Debug and Profile 4GL (ttadv1123m000) session.
  • In a multi-tenant environment you cannot debug BFlows with LN Studio. You can run BFlows in the LN UI to see the result.

To debug a session:

  1. Connect to LN Studio from LN UI.
    1. Start LN UI and select > Debug and Profile 4GL. The Debug and Profile 4GL (ttadv1123m000) session starts.
    2. Select your activity and select the Debug Mode check box.
    3. If LN runs in an on-premises environment, select the debug UI: In the Debug UI field, select LN Studio or Debug Workbench.

      In a multi-tenant environment, the debug workbench is selected automatically.

    4. Click OK to save the settings.
  2. Set breakpoints.

    See Using breakpoints.

  3. Debug a session.

    Start a session in LN UI. The session is started in debug mode.

    See Debugging LN sessions.

Step 1 is only required at the beginning, before you start the first session. Subsequent sessions automatically start in debug mode using the established connection.

Debugging LN sessions through BW or Web UI

From the Eclipse workbench you can run LN sessions in debug mode. In debug mode, you can suspend and resume the execution, inspect variables, and evaluate expressions.

For each session that you want to run in debug mode, you must generate, or manually create, a run configuration. In this configuration you can specify execution parameters.

To run a session in debug mode for the first time, use one of these procedures:

  • Manually create a run configuration and then run the session in debug mode
  • Automatically generate a run configuration and then run the session in debug mode
Note: 
  • To debug sessions, a debug Connection Point is required.

    See Defining connectivity settings.

  • In a multi-tenant environment you cannot debug with LN Studio. You can use the Debug Workbench, see the Debug and Profile 4GL (ttadv1123m000) session.
  • In a multi-tenant environment you cannot debug BFlows with LN Studio. You can run BFlows in the LN UI to see the result.

Manually create a run configuration and then run the session in debug mode

  1. Set breakpoints

    Edit the involved script or library, and set breakpoints before you start the debug process. For example, set breakpoints in the session's UI script, or in a library called by the session.

    You can set these types of breakpoints:

    • Line breakpoints
    • Method breakpoints
    • Watchpoints

    For details, see Using breakpoints.

    Note: 
    • Before you can set breakpoints in a UI script, you must add the corresponding session to your activity.
    • Before you can set breakpoints in a library, you must add the library to your activity.
  2. Add a new configuration
    1. On the Run menu, select Debug Configurations, or click the Debug Configurations command on the Debug button pull-down menu. The Debug - Create, manage, and run configurations dialog is displayed.
    2. In the left pane, right-click Infor LN Session and select New. A new configuration is added in the left pane.
    3. In the Sessions tab, select an activity from the list.
    4. Select the session that calls the script or library you want to debug. The name of the configuration is automatically filled with the name of the selected session.

      To select a session, perform one of these actions:

      • Select a session linked to your activity from the list.
      • Click Browse to select a session that is not linked to your activity. The Browse session dialog starts. In this dialog you can select a session on the LN server.
      • Specify a session code.
      Note: You can only select sessions that belong to the packages displayed in the Component Explorer
    5. Specify the launch mode for the session.

      See Configurations.

    6. Select the company in which you want to start the session.
    7. Optionally: Specify additional execution parameters, such as profiling parameters and environment variables, in the other tabs. See the dialog help.

    8. Click Apply to save the settings.
    Note: Debug configurations can also be used to start sessions in run mode.

    See Running LN sessions.

  3. Debug the session

    Click Debug in the Debug dialog. The session is started in debug mode.

    See Debugging LN sessions.

Automatically generate a run configuration and then run the session in debug mode

Complete these steps:

  1. Set breakpoints.

    See "Manually create a run configuration and then run the session in debug mode".

  2. In the nullActivity Explorer, right-click the session and select Debug As > Infor LN Session. A run configuration is generated automatically. The session starts in debug mode.

    See "Manually create a run configuration and then run the session in debug mode".

You can modify a generated run configuration in various ways. For example:

  • In the Activity Explorer, right-click the session and select Debug As. Then select Debug Configurations.
  • On the Run menu, select Debug Configurations.
  • Click the Debug Configurations command on the Debug button pull-down menu.

The Run - Create, manage, and run configurations dialog is displayed.

See Configurations.

Restarting a session in debug mode

The workbench keeps a history of all configurations launched.

To restart the most recent launch, click the Debug button in the toolbar.

You can restart any previous launch in various ways. For example:

  • Select a previous launch on the Debug button pull-down menu.
  • On the Run menu, select Debug History and select a previous launch from the sub-menu.
  • On the Run menu, select Debug Configurations, or click the Debug Configurations command on the Debug button pull-down menu. The Debug - Create, manage, and run configurations dialog is displayed. Select the desired configuration and click Debug.
  • In the Activity Explorer, right-click the session and select Debug As > Infor LN Session.

Debugging a session in the Debug perspective

Use the views and commands in the Debug perspective to examine the execution and debug the session:

Note: 
  • The Variables view displays all variables that are in scope. If a session contains a lot of variables, the performance can be affected. To boost the performance, display local variables only, or close the Variables view and use the Expressions view.
  • Try to keep the list of expressions in the Expressions view limited. This is, because all expressions are evaluated each time a session suspends, which can affect the performance adversely.
  • The session in the previous example is started through Web UI. To start sessions through Web UI you must start Web UI first.