RuleAPI:Procedural commands/HostCallBack

From FlexRule Wiki
Jump to: navigation, search

Summary

This command sends a callback to the application hosting the engine, which can be an actual running application, Windows service, Windows Communication Foundation, web service, or any engine host (container).

Parameters

  1. tagValue
    1. Description: Sends a value to the host
    2. Mandatory: No (Either tagRef or tagValue must be supplied.)
  2. tagRef
    1. Description: Sends a value reference to the host
    2. Mandatory: No (Either tagRef or tagValue must be supplied.)
  3. key
    1. Description: Sends a key to the host to make a decision in a specific channel by key value
    2. Type: String
    3. Mandatory: No
  4. responseRef
    1. Description: Receives a response from the host and sets the value on the running context of the rule
    2. Type: String (name of variable)
    3. Mandatory: No

Internal Commands

No internal commands.

Sample

  1. <CallMethod method="Console.Write(&quot;Enter a number? >&quot;)"/>
  2.  
  3. <!-- 
  4.   It sends the request to the user to enter a value
  5.   and stores it back to variable named ‘i’
  6.   So it will be accessible through its rule
  7.   to be used after receiving the value from user input.
  8. -->
  9. <HostCallback tagValue="count!=3" key="askUser" responseRef="i"/>
  10.  
  11. <CallMethod method="Console.Write(&quot;You typed:{0}&quot;,i)"/>