Flow

Runs a previously published process flow. This process flow is run under the control of the server configuration, rather than under the control of a channel. Channel services may not be available within the process flow. The flow command can be used to test process flows, including verifying that the process flow produces the expected result. The flow command is also useful when executed as a scheduled activity.

The process flow execution is not directly connected to the resources of iWay Service Manager (iSM). As a result, the use of published transforms, subflows, providers, or other resources that are external to the process flow itself may not be located.

To issue a flow command, enter the following:

flow <flowname> [-input filepath] [-xml|-json|-flat][-output filepath] [-iwp exported path] [-commit] [-debug] [-deep] [-tree] [-expect filepath][-map ...]

The following table lists and describes the parameters for the flow command.

Parameter

Description

flowname

Is the name of the process flow. The process flow must have been published to the system area of the configuration under which it is to be run.

-input filepath

A file containing the input to be supplied to the process flow. If parsed (non-flat), then the input must be in a form to be parsed for execution. The following switches determine the input type:

  • -xml. The input is an XML document that is parsed into an internal form for execution. This is the default value.
  • -json. The input is in JSON format that is parsed into an internal form for execution.
  • -flat. The input is not parsed, but is presented as a string to the process flow.

-output filepath

The output of the process flow is presented in this file. If -output is not present, then the process flow output is not presented.

iSM unique file naming is supported. For example:

-output /myarea/fileout/test###.txt

-iwp filepath

Executes an unpublished process flow exported from iWay Integration Tools (iIT). In this case, the flowname operand is used only for documentation purposes and is ignored, although it must be provided.

-commit

Commits the named process flow. In addition, this parameter runs the process flow transactionally. If this parameter is omitted, then the process flow is not run under transactional control.

-debug

Sets the trace log to debug mode for this execution.

-deep

Sets the trace log to deep mode for this execution.

-tree

Sets the trace log to tree mode for this execution.

-expect filepath

If present, then the output will be compared to the expected output. This is often useful to validate a process flow against a prior version. The formats and layouts must match.

-map <pairs>

Adds token=value pairs to the standard signal document if used, as the parameter map.The pairs will also be set as DOC level special registers in the execution environment. This must be the last switch on the line, and all tokens that follow it are considered as token=value pairs. The equal (=) character and comma (,) characters are optional. For example:

-map a=b, c d

Example

Run a published process flow named status.mail. Pass in the name of the channel to monitor. The process flow must look in the standard signal document to get the channel name to monitor. The specific details of the process flow are not shown here.

flow status.mail -map channel chan1

Because no input was specified in the command, a standard signal document will be passed to the process flow, which will have the following structure:

<signal type='flow' timestamp='time' version='2' protocol='command'>
	<parms count='1'>
		<parm name='channel>chan1</parm>
	</parms>
</signal>

If the optional -expects switch is used, then the process flow result is compared on a character-by-character basis with the contents of a named file. If the result of the process flow matches the expected result, then the following command is emitted to the output trace:

match

If the two do not match, then the process flow emits the following command:

nomatch

In this case, information showing the location of the mismatch and what was found is traced. For example, consider the following regression test of a process flow named passthru.

Enter command:>flow passthru _file(c:/docs/flowin.xml) -expect c:/docs/expect.xml
Flow 'passthru' OK, not committed
Unequal compare:
-- Lengths are not equal
Length expected=54, actual=53
Difference starts at char 46,  expected=c'b'/d'98', actual=c'<'/d'60'
Partial Expected: >aaaab</Test>
Partial Actual: >aaaa</Test>
Expected: <?xmlversion='1.0'encoding='UTF-8'?><Test>aaaab</Test>
Actual  : <?xmlversion='1.0'encoding='UTF-8'?><Test>aaaa</Test>
nomatch
Enter command:>