• 沒有找到結果。

The test Command

在文檔中 TIBCO Flogo® (頁 84-87)

Use the test command in TIBCO Flogo® Enterprise to test your Flogo app. This feature is available in TIBCO Flogo® Enterprise 2.3.0 or greater.

Options Description and Example

-flows

SYNTAX:

./<binary_filename> -test -flows

Lists all flows in the specified <binary_filename> app.

Example:

./MyTestApp -test -flows

where MyTestApp is the app binary.

-flowdata

SYNTAX:

./<binary_filename> test -flowdata <flow-name>

Generates input fields data file for a given flow. For blank flows, the input test data is generated based on the Flow Inputs you provided when creating the flow (in the Input tab of the Flow Inputs & Outputs tab of the blank flow).

For flows created with a trigger input, the input values in the generated file will always be empty.

Example:

./MyTestApp -test -flowdata TestFlow

where MyTestApp is the app binary and TestFlow is a flow within MyTestApp. A JSON file with the filename with format <app-name>_<flow-name>_input.json

gets created. This file contains the generted input fields configured in the Input tab of the Flow Inputs

& Outputs tab of the blank flow.

You can edit this file to set specific values for the input fields and use the file to test your flow using the

-flowin option described below.

-flowin

SYNTAX:

./<binary_filename> -test -flowin

<path-to-input-file>

Test flow against given test data contained in an input JSON file. This file must exist in the location that you specify in the command.

Example:

./MyTestApp -test -flowin /usr/

TestFlow_input.json

where MyTestApp is the app binary and /usr/

TestFlow_input.json is the path to the JSON file containing the input to the flow.

You can also use the test configurations that were exported from Lauch Configuration as the input file in this command.

Options Description and Example

-flowout

SYNTAX:

./<binary_filename> -test -flowout

<path-to-output-file-name>

Write flow output (if applicable) to the specified file.

If a file with the specified name does not already exist in the specified location, Flogo® Enterprise will create the file. If you do not specify a filename, the output will be printed to the console.

Example:

./MyTestApp -test -flowin TestFlow_input.json -flowout TestFlow_output.json

where MyTestApp is the app binary,

TestFlow_input.json is the file containing the input data to the flow and TestFlow_output.json is the path to the JSON file you specify to hold the output from the flow.

Mapper

Use the mapper to enter input values manually or map the input schema elements to output data of the same data type from preceding activities, trigger, or the flow itself. An activity has access to the output data from the trigger to which the flow is attached in addition to the output from any of its preceding activities in the same flow provided that the trigger or activity has an output. This data is displayed in a tree structure under Upstream Output in the Mapper. The input schema for the activity is displayed in the pane to the left of the Upstream Output pane. You can map data coming from the upstream output to the input fields of the activity. Activities also have access to the input fields of a flow to which the activity belongs. You enter the flow input schema in the Input Settings tab of the Flow Inputs and Outputs accordian tab. Within a flow, use the mapper to pass data between the activities, and between the trigger and the activities or the trigger and the flow.

When you click on an activity or trigger in the flow details page, the configuration page for that activity or trigger opens. The following image is an example of the configuration page that would open if you clicked on the InvokeRESTService activity. The image describes the areas of the Mapper.

The left most pane displays the tabs for the configuration fields for that activity or trigger. Each activity or trigger has one or more of the following tabs:

Settings

For triggers, this tab diplays the Trigger settings and Handler settings. Trigger settings are specific to that particular trigger and Handler settings are settings applicable to a specific flow attached to that trigger. Each flow attached to that trigger can have its own handler settings.

Input Settings

This tab allows you to enter the schema for the flow or activity input as the case may be.

Input

This tab displays the schema you entered in the Input Settings tab in a tree format. You can

manually enter values for any elements in the input schema or map any input element to the output from previous activites or trigger in this tab.

Output Settings

This tab allows you to enter the schema for the flow or activity output as the case may be.

Output

This tab displays the schema you entered in the Output Settings tab in a tree format. The schema displayed in this tab is for read-only purpose.

Reply Settings

This tab is specific to triggers that send replies back to the caller, such as the REST or GraphQL triggers. You enter the trigger reply schema in this tab.

Map to Flow Inputs

This tab is specific to triggers that have an output, such as the REST or GraphQL triggers. You manually enter or map the elements from the trigger output (schema set in Output Settings tab) to the flow input elements (schema entered in Input Settings tab of the Flow Inputs & Outputs accordian tab).

Map from Flow Outputs

This tab is specific to triggers that need to send a reply to the caller, such as the REST or GraphQL triggers. You manually enter or map the elements from the output of the flow (schema set in Reply Settings tab) to the flow output elements (schema entered in Output Settings tab of the Flow Inputs & Outputs).

Iterator

Use this tab to enter the iteration details for activities that you want to iterate.

When mapping, you can use data from the following sources:

Literal values - Literal values can be strings or numeric values. These values can either be manually typed in or mapped to a value from the output of the trigger or a preceding activity in the same flow. To specify a string, enclose the string in double quotes. To specify a number, type the number into the text box for the field. Constants and literal values can also be used as input to functions and expressions.

Direct mapping of an input element to an element of the same type in the Upstream Output.

Mapping using functions - The mapper provides commonly used functions that you can use in conjunction with the data to be mapped. The functions are categorized into groups. Click a function to use its output in your input data. When you use a function, placeholders are displayed for the function parameters. You click a placeholder parameter within the function, then click an element from the Upstream Output to replace the placeholder. Functions are grouped into logical categories.

Expressions - You can enter an expression whose evaluated value will be mapped to the input field

在文檔中 TIBCO Flogo® (頁 84-87)

相關文件