The Inbound File Adapter can be used for polling and processing new files in a specified directory. With the Adapter Configuration Wizard you can create this File Adapter Service quite easily. Especially if you follow an example! In step 7 of the wizard I decided to deviate from my example and checked the â€˜Use trigger fileâ€™ checkbox.
Then an extra field with â€˜Trigger File Detailsâ€™ appears in the wizard window where you can enter the directory and the trigger file name.
After deploying the application it seemed to work as expected. I could write more files to the directory and they were not yet processed. Only after I wrote the start.txt file in the specified directory the process started working. But this behavior is only executed once! From now on new files are processed at once again.
If you want this behavior for each polling cycle it appears that there is an extra parameter that you have to add manually to the JCA file:
<property name="TriggerFileStrategy" value="EveryTime"/>
Despite of the note in the documentation: â€œYou must not manually change the value of polling parameters in JCA files. You must use the Adapter Configuration Wizard to modify this parameter.â€
With the TriggerFileStrategy property you can control the strategy that is used for the triggering mechanism. The value can be one of the following:
EndpointActivation: The adapter looks for the trigger file every time the composite is activated. Note: The composite gets activated every time you start the container or redeploy the application, or retire or activate the composite application from Oracle Enterprise Manager. Every time you restart the container, the composite application is not triggered until it sees the trigger file in the specified directory.
OnceOnly: The adapter looks for the trigger file only once in its lifetime. Once it finds the trigger file, it remember that across restarts and redeployments.
EveryTime: The adapter looks for the trigger file on each polling cycle.
The default value for TriggerFileStrategy is EndpointActivation.