Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Add the FileWriter component from File category in the Micro Service Palette to the Fiorano Orchestrator.


    Figure 8: Adding FileWriter component in REST_Service_Example event process
     
  2. Double-click the FileWriter component to open Configuration Property Sheet (CPS).
  3. In the Interaction Configuration dialog box, click the Attributes tab to configure the attributes.
  4. Select the Is input Binary ?' checkbox  checkbox to write the data as bytes and click the FileWriter Configuration Ellipsis Image Modified button.


    Figure 9: Selecting Binary Input
     
  5. In the FileWriterConfig dialog box, provide the following values and clock click OK:
    1. File Name: The name of the file to which the input data has to be written. If the file with this name does not exist, a new file is created
    2. Target Directory: Provide the location to save the file.
    3. Working Directory: Location to save the file during intermediate processing.
    4. Error Directory: Location to save the file in case the processing does not get successful.


      Figure 10: Providing File Name and storage locations
       
  6. Click Next, clear the Enable Scheduling option and click Finish to save the FileWriter configuration.

...

  1. Connect the FileWriter with RESTStub in the following manner:
    1. RESTStub output port to FileWriter input port.
    2. FileWriter output port to RESTStub input port.
      Image Removed
      Image Added
      Figure 11: Connecting RESTStub with FileWriter
       
  2. Replace the names of 'route1' and 'route2' with 'UploadRequest' and 'UploadResponse' respectively to match the scenario. After clicking on the respective route, do any of the following to change the name:
    1. Press F2, change the name and click OK.


      Figure 12: Renaming using Keyboard action 'F2'
       
    2. Go to Name property under General tab in Properties, change the name and press ENTER


      Figure 13: Renaming using General Properties
       
  3. The routes show up with the changed names
    Image Removed
    Image Added
    Figure 14: Connection with route names changed 

...

  1. Right-click UploadResponse, point to Configure Transformation and select Mapper Project to open Fiorano Mapper editor.


    Figure 15: Navigating to Mapper Project for Route Transformation
     
  2. In the Output Structures panel, click Status under Response. 'Status' appears in Funclet View panel.


    Figure 16: Working on Funclet View
     
  3. In the Funclet View panel, drag the function element Constant to the Funclet easel. Double-click it, edit the name as '200' and click OK.


    Figure 17: Adding Constant from String Functions
     
  4. Connect the source node of the constant '200' to the destination node of Status.


    Figure 18: Connecting Constant with new name '200' to the Status element
     
  5. Similarly, connect source node of the constant 'application/jasonjson' to the destination node of MediaType (select from Representation under Output Structures panel).


    Figure 19: application/json constant connected to Media Type element

  6. Add the following elements to the Funclet easel in the following manner:
    1. Click ANY present under Element in Output Structures panel
    2. Drag FullName present under FileInfo in Input Structures panel.
    3. Add two Constant functions from String Functions and change their name as below:
      • { "FilePath" : "
      • " }
    4. Add Concat from String Functions.


      Figure 20: Adding Constant functions, FullName from FileInfo, Concat and ANY
       
  7. Connect the elements added in Step#6 in the following order:
    1. Source node of { "FilePath" : " to the destination node '1' of Concat.
    2. Source node of FullName to the destination node '2' of Concat. Destination node '3' appears after this conncetion.
    3. Source node of " } to the destination node '3' of Concat.
    4. Source node of Concat to the destination node of ANY.
    Adding the elements in the above order helps to generate Display output in the following format:
    { "FilePath" : "<TARGET_FILE_PATH>" }:


    Figure 21: Functions and elements connected to generate Display output
     
  8. Click Save icon (or File ??Save) to save the transformation configuration and close the Mapper Project editor.

...

  1. Add the FileReader component from File category in the Micro Service Palette to the Fiorano Orchestrator.


    Figure 27: Adding FileReader component to REST_Client_Example event process
     
  2. Double-click the FileReader component to open Configuration Property Sheet (CPS).
  3. In the Interaction Configuration dialog box, select the 'Is input Binary ?' checkbox to write the data as bytes and click the FileReader Configuration Ellipsis button.


    Figure 28: Selecting Binary File
     
  4. In the FileReaderConfig dialog box, provide the following values and click OK:
    1. File Name: The name of the file to be read. A pattern of file names can also be provided using wildcard character * (asterisk symbol).
      Example: *.* includes all the files and *.jpg includes the files with .jpg extension.
    2. Source Directory: The directory which holds the file(s) to be read. All the files in this directory whose names match the pattern specified for the File name property will be processed.

      Info

      Working Directory and Error Directory are optional. Select the Use Working Directory check box to use working directory.


    3. Figure 29: Providing File Name and storage location
       

  5. Click Next and clear Enable Scheduling check box to allow Feeder component to provide input.


    Figure 30: Disabling Scheduler Configurations
     
  6. Click Finish to save the FileReader configuration.

Anchor
_Toc385260000
_Toc385260000
Connecting FileReader and

...

RESTConsumer

In the REST_Client_Example event process, perform the following actions:

...

Note

By default, REST component sends an XML response with an embedded JSON content. Perform the following actions if you want to extract only the JSON content, or else skip this section and move directly to Running the Example section.

 

  1. Right-click ExtractJSON route, point to Configure Transformation and select Mapper Project to open Fiorano Mapper editor.
  2. In the Mapper Project, perform the following actions in Output Structures panel:
    1. Click the Add icon on the upper-right part of the page and select XML option.
    2. In the Load Output XML Structure dialog box, add the following text in XML Content editor:<output>output</output>
    3. Click DTD icon to generate DTD element. The message appears in Generated DTD section. Click Finish.

    Figure 37: Configuring to generate JSON message
     
  3. Connect ANY element present in Input Structures panel to output element that appears in Output Structures panel.


    Figure 38: Connecting ANY element to output
     
  4. In the Menu, go to Tools and select XSLT Properties. In XSLT Properties dialog box, select 'text' from Output Method drop-down.


    Figure 39: Configuring XSLT Properties 
  5. Click Save icon (or File >Save) to save the transformation configuration and close the Mapper Project editor

...

Adaptavist ThemeBuilder EngineAtlassian Confluence