How to trigger a RT-Action form a server set-action?

Prerequisite: HowToCreateEmptyFESAProject

Aim: Setting a property should trigger a specific real-time action

Works with: FESA 5.0.2, Eclipse plugin 2.9.9, (31.07.2019)
  • in the design
    • events->add child: sources (maybe have to create events node first)
    • events->sources-> add child: on-demand (name = My_on_demand_source)
    • events->logical-events-> add child: logical event (name = My_on_demand_logical_event, type = on-demand)
    • actions->set-server-action-> add child: triggered-event-source (on-demand-event-source = My_on_demand_event_source)
    • scheduling-units-> add child: scheduling unit (name = My_on_demand_scheduling_unit, rt-action-ref = My_on_demand_rt_action, logical_event_ref = My_on_demand_logical_event)
    • validate & synchronize
    • edit My_on_demand_rt_action.cpp to do something
    • alternatively the above steps can be done via using the rt-action wizard:
      • Select wizard: "Insert RT"
        • Inser rt
          • Logical event name: My_on_demand_logical_event
          • Logical event type: on-demand
          • Rt action name: My_on_demand_rt_action
          • Scheduling unit name: My_on_demand_scheduling_unit
        • Add triggered On-demand Event Source
          • On-demand Event Source Name: My_on_demand_event_source
          • choose triggering actions: select the set action
  • in the deploy file

    • scheduler->concurrency-layer (maybe neuen anlegen) -> add child: scheduling-unit (scheduling-unit-name-ref = CLASSNAME::My_on_demand_scheduling_unit)

    • validate & synchronize

  • in the instance file: (first synchronize the source code form the design)
    • classes->CLASSNAME->events-mapping-> add child: My_on_demand_logical_event
    • classes->CLASSNAME->events-mapping->My_on_demand_logical_event-> add child: event-configuration (name = My_on_demand_event_config)
    • !!! It can happen that the event-configuration gets a child called "Timer" when it actually should be "OnDemand", fix: replace "Timer" with "OnDemand" and make sure it has the correct on-demand-event-source-ref !!!
    • classes->CLASSNAME->device-instance->events-mapping-> add child: My_on_demand_logical_event (event-config-ref = My_on_demand_event_config)
    • prio-managment->classes->CLASSNAME-> add child: on-demand-event-sources
    • ?? Add the Event-srouce to prio-managment->classes->CLASSNAME->on-demand-event-sources ?? does not work always !?! In the xml design view, the new EventSrouce is not listed when trying to add it as child. ... however, this seems to happen only when the instance file is edited before the deploy file.
    • IMPORTANT This has to be done for every instance that should use the new events. If you use a different instance file with the event mapping missing, there will be no error or hint that something is missing, but the event will not fire at runtime!

Todo:
  • the same recipe can be used to create a new eventSource that triggers an already existing RT-Action. However, it is not clear how to use the wizard in that case. One can create a new RT-Action via the wizard just to delete it afterwards, but what else has to be adjusted?

Known quirks:
  • the wizard may add a triggered-event-source to the generated rt-action that triggers the on-demand-event-source that triggers the rt-action, as a result the rt-action is executed infinitely once triggered
    • FIX: remove the triggered-event-source from the rt-action

-- TobiasHabermann - 15 Oct 2018

This topic: FESA > WebHome > FESA3UserSpace > HowToTriggerARTActionFromServerSetAction
Topic revision: 15 Aug 2019, TobiasHabermann
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback