Defining Custom Logics with Legacy Interface

You can view and edit custom logics using the previous interface of the script editor.

This task shows you how to:

Create a Custom Logic

Before you begin: From the Display section of the app Preferences, select Enable Legacy Command.
  1. From the Resource Behavior section of the action bar, select Manage Custom Logics .
  2. In the Manage Logics dialog box, click to create a custom logic.
    The Edit Logic dialog box opens.

    Script Editor
    Defines and controls all or part of the simulation.
    Script Sample
    Displays reusable logic relevant to the scenario.
    Check Script
    Detects issues in the script.
    API Help
    Lets you browse for functions and methods associated with a data type. To view the values for related Members, click .
  3. Specify the logic name and select the corresponding type.

    The type dictates the event that triggers logic execution during simulation.

  4. Click Sample Script to use predefined templates and reusable snippets.

    The templates help you create controlled logic that requires similar configurations, allowing for fast and easy controlled logic creation.

  5. From the Sample Scripts dialog box, copy the logic relevant to your scenario and paste the sample in the Script Editor.

    Each logic is associated with several sample scripts that you can reuse to suit your needs.

    Note: The scripts displayed are for the selected logic type only.

  6. Customize the simulation using input attributes.

    These attributes drive the scripts logic. For more information on the data types available as inputs, see SemEL Data Types.

    You can browse the API Help section to see the available functions and methods associated with a data type.

    Tip: Copy a method from the Members tab and Paste it in the script editor.

    1. Click and select the input attribute that you want to add.
    2. Specify the Attribute Name and use it in the script to define the logic.

      Tip: You can also copy and paste the attribute name from the sample script into the Attribute Name field.

  7. Repeat the previous step to define output attributes.

    You can use all the SemEL data types as output attributes. The available outputs depend on the selected logic type. Browse the API Help section to see the available functions and methods associated with a data type.

    Tip: You can also copy and paste the attribute name from the sample script into the Attribute Name field.

  8. Optional: Select to add the input as an output attribute.
  9. Click Check Script to identify syntax or build-time errors in the script.

    For more information on how to resolve the errors, see Troubleshooting.

  10. Click Ok to validate and exit the dialog box.

Result: During simulation, the script controls the behavior of resources according to the defined inputs and outputs.

Edit a Custom Logic

  1. From the Resource Behavior section of the action bar, select Manage Custom Logics .
  2. In the Manage Logics dialog box, right-click a row in the panel.
  3. Do any of the following:
    1. Select a row and click to edit the custom logic.
    2. Select a row and click to delete the custom logic.
  4. Click Ok to validate and exit the dialog box.

Assign and Unassign Context Resources

  1. From the Resource Behavior section of the action bar, select Manage Custom Logics .
  2. In the Manage Logics dialog box, right-click a row in the panel.
    1. Select AssignRessources in the shortcut menu to assign the custom logic to one or more resources.
    2. Select UnassignRessources in the shortcut menu to unassign the custom logic to one or more resources.

    Tip: You can also use the Custom Logics shortcut menu in the Resource Configuration panel to assign and unassign custom logic to a resource or an operation.

Result: During simulation, context resources let you access and use information from other relevant resources, enabling them to inform and define the logic of their current resource.