Welcome Guest! Log in
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…

Using File Wait to check files presence and act in consequence

    During development, there may be a need to know if some files exists or not, how many files there are in a folder, etc.

    We are going to see in this article how to use the File Wait process Action to check if some files are present, and how to act differently if it is the case, or not.


    File Wait Process Action

    Process overview


    Here is a simple process, in which we wait for 2 text files, located in C:\Temp, during 1 second (1000ms).



    Then, we are using the result of the File Wait action to separate our process in three branches, depending on the number of files found.

    We are using Empty Actions just for the example, but any other action can be put here.

    To do that, we are using a different condition on each successfull link (green arrows), to test the result of the File Wait.

    To indicate a condition : Left click on a link to select it > Properties View > Condition Box in the Execution Tab



    For All Files exist we set ${FileWait/FILE_NB}$ == 2

    For No Files found ${FileWait/FILE_NB}$ ==0

    For Wrong number of Files ${FileWait/FILE_NB}$ == 1


    The syntax to use the variables published by the File Wait Action (or any action) is :




    Suggest a new Article!