Execute Method

The Execute Method action executes a method in the specified thing by sending a method.exec TR50 command to the deviceWISE Cloud. The target Thing can be a gateway or an application.

  • When the target Thing is a gateway, the method to execute in the gateway will be associated with a trigger.
  • When the target Thing is something other than a gateway, such as an application, the method to execute is controlled by that application.

A thing method, defined using the Management Portal, defines the method name, key, input variables and output variables.

In the gateway case, the trigger that will be executed is defined as a TR50 Method event type. To create a TR50 Method trigger, see TR50 Method.
The deviceWISE Cloud provides the communication support between the Execute Method action and the TR50 Method event trigger. Both gateways must have a started TR50 connection.

In the application case, the deviceWISE Cloud provides the communication support between the Execute Method action and the application. Both the gateway and the application must have a started TR50 connection.

A Thing method can optionally define:

  • Input variables, which would be passed from the Execute Method action
  • That a response be provided back to the Execute Method action
  • Output variables, which would be passed back to the Execute Method action when a response is specified.

   

Parameter descriptions

Parameter Description
TR50 Connection The TR50 connection to use to send this execute method command.

 (Optional) If not specified, the Default TR50 connection is used.

Thing Definition ID
The Thing definition id, as defined in the deviceWISE Cloud. The Workbench retrieves the thing definitions from the deviceWISE Cloud based on the TR50 Connection parameter.
Thing Definition Method The Thing definition method, as defined in the deviceWISE Cloud. The methods are retrieved from the thing definition specified by the Thing Definition ID parameter.
Wait for Response An indication to wait for the response from the thing method (from the target thing). The options are True or False.
  • If True is selected, the S&F Profile parameter will not be available.
  • If False is selected, the Timeout (secs) parameter will not be available.

For more information on the Wait for Response, Timeout (secs), and TTL (secs) parameters, see the section Execute Method action and TR50 S&F considerations.

Timeout (secs) When the Wait for Response option is true, the value used to specify the time in seconds to wait for the thing method's response from the target thing.
TTL (secs) Time To Live (TTL) - The time for the execute method command to be held in the deviceWISE Cloud, waiting for the target thing to retrieve it. If the TTL expires before the execute method command is retrieved, the execute method command is discarded and will not be delivered to the target thing.
S&F Profile Available when the Wait for Response parameter is False.

The S&F profile to use if the data from the action can not be sent to the deviceWISE Cloud.

If the default "None" is selected, then the optional TR50 S&F feature will not be used for this action.

If the data for this action is stored in a S&F queue, then the action's Store and Forward Route will be used to determine the next action to execute.

For more information, see TR50 S&F Profile Management tab.

Input tab

Input Description
Input variables Input variable parameters will be available for each method notification variable.
ThingKey The thing key of the thing to execute the method.
In the gateway case, the trigger that will be executed is defined as a TR50 Method event type.

Output tab

Output Description
Output variables Output variable parameters will be available for each method completion variable.

Thing method, TR50 Method trigger and Execute Method action definition considerations

When defining a Execute Method action, the Workbench obtains the information about thing methods by retrieving information from the deviceWISE Cloud specifically from the Organization that the TR50 connection is defined to use.

A common trigger development pattern is:

  1. Define the Thing method using the Management Portal in the appropriate organization that you will use for your TR50 connection. This centralized information will be accessed for you by the Workbench when defining the TR50 Method trigger and the calling Execute Method action. The definition of the thing method includes:
    • The name of the method
    • Input variables (will be supplied by the Execute Method action)
      Send Response option of True or False
      Output variables (when Send Response is True, returned from the TR50 Method trigger to the Execute Method action).
      For more information, see Defining Methods.
  2. Define the TR50 Method trigger on the gateway where it will execute. When defining the TR50 Method trigger, information is retrieved from the deviceWISE Cloud by the references to the:
    • Thing Definition ID
    • Thing Definition Method.
  3. Save the TR50 Method trigger.
    For more information, see TR50 Method.
  4. On the gateways that need to execute the TR50 Method trigger, define your triggers and add the Execute Method action.
    When defining the Execute Method action, the information is retrieved from the deviceWISE Cloud for all of the currently defined thing methods on gateways (things) that are in the same deviceWISE Cloud organization.
  5. Select the desired Thing method and complete the assignment of any input and output variables.
  6. Save the trigger, which will include all of the thing method information retrieved from the M2M Service.
  7. When the trigger is edited again for any reason, the deviceWISE Cloud will be queried for the current thing method information.
  8. If the Thing method is changed (for example: different input variables, Send Response option changed from False to True, change to output variables), all other triggers that use the thing method in an Execute Method action will need to be edited and updated.

Execute Method action and TR50 S&F considerations

Since the Execute Method action executes a method in the specified thing by sending a method.exec TR50 command to the deviceWISE Cloud, which is then retrieved by the target thing (a gateway or an application), the end to end behavior of the Execute Method action is dependent on the target thing and the action parameters selected.

Wait for Response

  • When the Wait for Response option is True, the Timeout (secs) value used to specify the time in seconds to wait for the thing method's response from the target thing.
    • If the target thing is not retrieving, executing, and responding to the method.exec TR50 commands in a timely fashion, the Execute Method action may timeout.
      This does not cause the method.exec TR50 command to be discarded or invalidated in any way.
    • If the Execute Method action does time out, the TR50 command may still be retrieved, executed and responded to by the target thing, but any response and output parameters will not be available to the Execute Method action.
  • When the Wait for Response option is False, the Execute Method action completes when the corresponding method.execute TR50 command is given to the TR50 component on the gateway.
    • The TR50 command may be retrieved, executed and responded to by the target thing, but any response and output parameters will not be available to the Execute Method action.

TTL (secs)

  • The TTL (secs) value (TTL=Time To Live) is the time for the method.exec TR50 command to be held in the deviceWISE Cloud, waiting for the target thing to retrieve it. If the TTL expires before the execute method command is retrieved, the execute method command is discarded and will not be delivered to the target thing.

TR50 S&F considerations

  • The Execute Method action must have the Wait for Response parameter set to False for the S&F Profile parameter to appear and a selection of a profile.
  • This means that the Execute Method action completes when the corresponding method.execute TR50 command is given to the TR50 component on the gateway.
  • The result of the Execute Method action and the route taken: Success, Failure or Store and Forward is based solely on the ability to build the method.execute TR50 command, give it to the TR50 component on the gateway, and the current value of the TR50 connection's Store & Forward State (Standby, Ready to Store, Storing, Forwarding).
    The result does not provide any knowledge of the execution of the TR50 method in the remote gateway or application.
  • The method's output parameters (if any are defined) will not be able to be returned to the Execute Method action.
Related topics

TR50 Method

Defining Methods

TR50 Store and Forward