Strap and another application can talk to each other

Introduction

There are four methods for programmatically controlling a running Strap instance: Here we explain bidirectional information exchange at runtime via named pipes and script output to employ Strap for another locally running application.

Running a script when Strap is started

An initial script which is interpreted at program start can be given with a command line parameter -script=file path. It is possible to have more than one -script parameters. A list of all script commands is printed with the program parameter -help=script.

Sending further script lines

Application can also communicate with Strap at runtime using a . Strap will continuously interpreting text lines passing through the pipe.

The example below will work also on Windows even though named pipes are not supported and the command mkfifo does not exist (which leads to an error message). With the echo command in the 2nd line, testPipe will be created as a plain file. Strap will observe all script files and if a file increases in size, it will interpret the new text lines.
This is illustrated with the following Example for MacOS, Linux and Windows:
      mkfifo testPipe
      echo > testPipe
      java -jar strap.jar -script=testPipe 
    
In another terminal you can write script commands to testPipe:
      echo aa_sequence hello , sequence1 >> testPipe
      echo aa_sequence world , sequence2 >> testPipe
    

Obtaining Information from Strap

There are script commands to write information to an output file specified with the command line parameter -scriptOutput=file-path.
Author: christoph.gille @ charite .de