Skip to main content

         This documentation site is for previous versions. Visit our new documentation site for current releases.      

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

How to write a file to the local file system using a file connector

Updated on September 1, 2021


Your application can write files to the file system of the Process Commander server using Connect File rules. The generated file may contain the contents of an HTML or XML Stream rule, an eForm document, a work object attachment, or a clipboard property.


Suggested Approach

To implement a file connectorr:

  1. From the Application Explorer, create a new Connect File rule by selecting New > Rule > Integration-Connectors > Connect File.
  2. On the Connect File form, complete the necessary fields.
      • Destination Path — Enter the location on the PRPC server for the file..
      • File Name — Enter the name and extension of the file.
      • If File Already Exists — Select the action to take if the specified file is already present in the location. The options are Fail, Append, or Overwrite.
      • Keep File Open — Select to enable multiple iterations of the Connect-File method to write to the file, without having to open and reopen the file. If this option is selected, your application processing must eventually execute another Connect-File method with the Close File operation.

Note: Optionally, you can use the global resource setting syntax =PageName.Property for the File Name parameter.

  1. In a new or existing activity, add a step that invokes the Connect-File method.

    In the step parameters section, fill in the following fields:
      • ConnectorName — Using the SmartPrompt, select the Connect File rule you created earlier.
      • Operation —Select the operation used to create the file. The options are:
        Write from HTML Stream RuleThe name of an HTML rule instance defined in the step page class.
        Write from XML Stream Rule


        The name of an XML rule instance defined in the step page class. The third key part of this XML rule must be 'MapFrom'.
        Write from eForm


        The name of a page of class Code-Pega-eForm.
        Write from Work Attachment


        The name of a page of class Data-WorkAttach-File that holds the work object attachment.
        Write from Clipboard Property


        The name of a property (defined in step page class) with or without a leading period, or using the PageName.PropertyName method.

        Close File

        Closes the file to disable writing more content. Use when the Keep File Open option is selected in the Connect File rule to end processing of a file.
      • Parameter — Enter the name of or reference to the input data source, as described in the Operation field. For example if the Operation is Write from HTML Stream Rule, then provide the StreamName of the html rule (Rule-Obj-HTML instance) in the Parameter field. If the input value contains a "." character, the system will look for a property rule. You can also input literal values by surrounding the text with double quotes, or complex function calls.
If the Operation is Close File, you can leave the Parameter field blank.
  1. If you are writing a file as a part of flow processing, add an Integrator shape to your flow that references the Activity rule you edited or created in step 3. The referenced activity rule should be of the type Connect.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us