User Tools

Site Tools


Event Processing Examples

Example 1: Local Data Extraction

Local text files are sometimes used as inputs to an EASAP via a FILE CHOICE. Extracting fresh content from these files prior to a run can provide useful user feedback and error checking. This example follows Material Property Database Example. First set up that example and then modify the Tree, below:

  • Right-click tabbed_pane1
    • Select Child→Add FILE CHOICE (named file_choice1)
      • Set: Label:'Material Properties file:'
      • Set: Path Type:'Full Path'
  • Right-click file_choice1
    • Select Child→Add BUTTON (named button1)
      • Set Label:'Re-Extract:'
      • Set Type:'BUTTON'
  • Right-click button1
    • Select Child→Add EVENT PROCESSING (named event_processing1)
    • Expand event_processing1
  • Right-click event1
    • Select Child→Add BUTTON PRESSED (named button_pressed1)
      • Set Buttons: button1
  • Right-click action_group1
    • Select Child→Add DATA PROCESSING ACTIONS (named data_processing_actions1)
  • Right-click extract1 from the prior example
    • Select Cut
  • Right-click data_processing1
    • Select Delete (we use data_processing_actions1 instead)
  • Right-click data_processing_actions1
    • Select Paste (Child)
  • Select extract1
    • Set Type:'FILE CHOICE'
    • Set File: file_choice1
    • Select Sibling→Add REFRESH OBJECTS
      • Set Objects: choice_list1 (this updates the EASAPs user interface)

The Tree should look similar to: Save and Test.

The EASAP user interface after materials.txt is uploaded and 'Re-Extract' button is clicked:


This EASAP executes as follows:

  • file_choice1 prompts the User for a file to upload
  • A User selects a file then clicks 'Upload'
  • The User clicks button1 which generates an EVENT, button_pressed1
  • action_group1 is triggered
  • extract1 is run on the uploaded file
  • choice_list1 is populated from extract1
  • The User may decide to repeat these steps with another file

In this example extract1 is an explicit object (see Setting Explicit Object Values)

Example 2: Processes Branch Control

On occasions it is useful to allow an EASAP to have various states, such that different sequences of PROCESS objects run according to the state. This can be done by using a SET SCALAR object under a DATA PROCESSING ACTIONS object to set explicit scalar object values, and then setting the Run if parameters in the Process objects with logical expressions that depend on the explicit scalar values.


Tip: Remember to initialize the explicit SCALAR value via an APPLICATION OPENED event and SET SCALAR action objects.

Example 3: Database Access

Placing many database READ's under a DATA PROCESSING will require them all to be read on any refresh action, such as a user clicking on the Refresh button or executing a MENU ACTION object with its Action parameter set to ‘Refresh’. This approach can be slow and result in poor EASAP responsiveness. Placing database Read objects under a DATABASE ACTION within an Actions branch will reduce the number of database reads and result in a more responsive EASAP. Additionally, it will reduce load on the database server.