Connect-File method
Use the Connect-File method to invoke a Connect File rule ( Rule-File-Connect rule type). The rule can create, add contents to, or close an output file.
Parameters
This method has three parameters:
Parameter | Description |
ConnectorName | Enter the Connector Name (second key part) of a Connect File rule, an instance of the Rule-Connect-File rule type. The system uses the class of the step page as the first key part of the rule. |
Operation |
Select to identify the source of output to be added to the file.
|
Parameter |
Identify the key of the
Operation
parameter.
Identify the property, key of the rule, or key of the work item attachment designated in the Operation field.
|
Results
The Connect-File method works as follows:
- Using rule resolution, locates the Connect File rule.
- Uses information in the Service tab of the rule to identify the path and file name of the output file, and processing instructions.
- Locates the rule or other object identified by the Operation and Parameter.
- Opens the file if not already open, and appends the output.
-
Generates the output using stream processing, map eform processing or map structured
processing, if specified. If the map structured rule specifies a character encoding other
than
Default
, output characters are converted to the specified character set using normal Java methods. - Closes the file, unless the Keep File open option on the Connect File rule is selected.
- Updates the value on the clipboard of the status and status message properties identified in the rule.
If the
Operation
is
Close File,
steps 5 and 6 do
not occur and the output file is closed.
Operation of this method is synchronous. Further processing in the activity does not resume until the file processing completes.
Checking the method status
This method updates the pxMethodStatus property. See How to test method results using a transition.
Example
For an example using this method, see the Pega Community article How to write a file to the local file system using a file connector.
Previous topic Connect-EJB method Next topic Connect-FTP method