Products | Versions |
---|---|
TIBCO ActiveMatrix BusinessWorks Plug-in for Files for Unix and Windows | - |
Not Applicable | - |
When a TIBCO ActiveMatrix Adapter for Files (FA) publisher starts publishing a partial input file, ( a file is currently used/locked by another third party system) FA throws the following error.
***
Requirement to implement logic which can detect when a third party application has completed processing a file and notify TIBCO ActiveMatrix Adapter for Files (FA) to publish a particular file. Refer to the attachment (Filename: FABWPOC.zip) having POC for the following possible solutions.
1). Use File Poller to Notify FA.
This Solution will work if your third party application writes data to an input file and saves the input file once the file is completely written. Once the file is written, the third party application will save the file. As the TIBCO BusinessWorks (BW) process is configured to track the file modified event on the input file, it will trigger FA to start publishing the file.
Data Flow.
Input File saved by third party app --> File poller> Create trigger file --> FA publisher published file
For details, refer to Process Definition (File Poller) in attached POC code.
2). Use a timer. HERE
You can have a timer activity scan the input directory and check whether the third party application writes data to the input file. If the third party application is writing data to the file, then the file will be locked and it will not allow a rename modification. Try to rename the file to check if the file is locked. If the file is not locked, create a trigger file to notify the FA to publish a particular input file.
Data Flow.
timer > check if file locked >Create trigger file for completed files--> FA publisher published file.
For details, refer to the Process Definition (Timer) in attached POC code.
In both of the above cases we have created a trigger file to notify the FA publisher to publish the input file. You can use a JMS topic publisher as well to notify a FA publisher to publish an input file. There is another variant solution such as changing the file adapter directory at run time, but it will need again or using non-TIBCO shell or Java script to identify that the file is locked by rename or any other activity.
Note that the samples provided (attached) are for demonstration purposes. You will need to customize and test in your environment.