HTTP – Trigger Configuration (Magic xpi 4.7)
You can use the HTTP component as a trigger. In this case, the HTTP component lets the Magic xpi Server accept an HTTP request from a Web server. The HTTP trigger waits for a request sent in a specific syntax. The request prompts the component to invoke the flow. In addition, this request can pass parameters from the Web.
The HTTP trigger can receive BLOBs from HTML pages and pass them to the flow. When the trigger receives a BLOB, it updates the UserBLOB of the invoked flow with the value of that BLOB.
|
-
To use the HTTP trigger with IIS, check if the ASP.NET feature is installed. You do this in the Windows Features dialog box (accessed by clicking Turn Windows features on or off in the Programs and Features dialog box), under Internet Information Services.
-
The RequesterTimeoutSec setting in the Mgreq.ini file determines the timeout for the HTTP trigger. If the RequesterTimeoutSec is shorter that the time it takes to execute the recovery policy on a crashed flow, then the recovery will not happen.
-
If the returned BLOB is empty, the body itself will also be empty and will not contain any default HTML content.
-
For more information about the C.HTTP_BODY context variable, and how to enable it in the Mgreq.ini file's HTTPvars entry, click here and here.
-
For more information about deploying Web requesters and SOAP servers, click here.
|
The Component Configuration: HTTP dialog box contains the following fields:
|
|
Service Details
|
Service Name
|
The name of the service that you defined in the Settings dialog box's Services section. This field is read-only.
|
When calling an HTTP trigger from an external application, the service name should be concatenated with a #.
|
|
Endpoint Name
|
Select an endpoint from the drop-down list. Endpoints are created in the Settings dialog box's Services section. Click here for more information.
|
When calling an HTTP trigger from an external application, the endpoint name should be concatenated with a #.
|
|
Argument Details
|
Argument Name
|
The name of the argument as you defined it in the Settings dialog box's Services section. This field is read-only.
|
Data Type
|
The variable's data type as you defined it in the Settings dialog box's Services section. This field is read-only.
|
Format
|
The number of characters that the data type holds.
|
Mandatory
|
This read-only field displays either No or Yes, depending on whether you selected the Mandatory check box in the Endpoint dialog box. Click here for more information.
|
Default Value
|
This read-only field displays the default value that was entered in the Endpoint dialog box. Click here for more information.
|
Mapping Variable
|
The arguments should be mapped to an internal Magic xpi variable by selecting the variable selection box in this column. These are the parameters sent from the external Internet browser to Magic xpi and will then be used within the flow. Each mandatory argument should be mapped to a variable.
Click to open the Variables List. Choose the required variable, and click Select.
|
Additional Details
|
Return Value
|
This is a BLOB variable that will be passed back to the Internet browser for display. It is in the form of a valid HTML script.
Click to the right of the field to open the Variables List and select the variable where the value is returned.
|
Validation Expression
|
An expression that defines limits to the trigger. Click to open the Expression Editor to create an expression. If you have a list of expected values, you can use the validation expression to check that the returned value is what you expected. For example, if one of the fields is a percentage grade in an exam, the value can be 0 to 100.
You can use all variable types in the validation expression. This lets you save time by identifying potential problems before the flow is launched. If the validation fails, the process will not continue.
|
To configure the HTTP component as a trigger, follow these steps:
-
Define HTTP as a service in the Settings dialog box's Services section. For more information, click here.
-
Place the HTTP component into a flow's trigger area to open the Properties pane.
-
In the Setting section, select the required Service Name from the drop-down list.
-
Double-click or right-click on the component and select Configuration from the context menu to open the Component Configuration: HTTP dialog box. Enter the relevant information.
|
You can also create conditions for triggering the flow by creating a validation expression. See the Validation Expression property (above) for more information.
|
-
When you have finished configuring your HTTP trigger, click OK to save the settings and to exit the dialog box. Alternatively, you can click Cancel to exit the dialog box without saving your settings.
|
To see our video demonstration about controlling the returned HTTP headers when working with an HTTP trigger, click here.
|