HTTP – Trigger Configuration (Magic xpi 3.x)
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.
Note:
|
-
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 Service Repository. This field is read-only.
Note:
|
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 Service Repository. Click here for more information.
Note:
|
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 Service Repository. This field is read-only.
|
Data Type
|
The variable's data type as you defined it in the Service Repository. 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 Service Repository. For more information, click here.
-
Place the HTTP component into a flow's trigger area to open the Component Properties dialog box.
-
Click the Settings tab, and select the required Service Name from the drop-down list. Click Configuration to open the Component Configuration: HTTP dialog box. Enter the relevant information.
Note:
|
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.
|