Page 1 of 1
File Monitor Trigger
Posted: Thu Feb 22, 2007 8:45 am
by squaremonkey
We currently use RoboTask to perform a series of updates to various Pervasive SQL database tables and use File Monitor, monitoring the Order Master Table, as the Trigger.
The problem is that the Order Master Table is accessed frequently by the ERP System, launching the RoboTasks even though the changes to the Order Master Table may not have been relevant to the tasks.
Is there a way to modify the File Monitor so that it will launch the RoboTasks only if changes to a specific field reference within the table are made? For example: if OrderMaster.OrdNum_10 like '5%'
Any assistance would be greatly appreciated.
File Monitor Trigger
Posted: Thu Feb 22, 2007 10:58 pm
by Oleg
What does mean "if OrderMaster.OrdNum_10 like '5%'"? Maybe, you mean some SQL query. Describe in more detail please. Probably I will can help you.
I'm afraid that "File monitor" is not fit for monitoring of database changes.
File Monitor Trigger
Posted: Fri Feb 23, 2007 4:31 am
by squaremonkey
The Work Order Table contains a field named OrdNum_10 where it lists the Order Number, an 8 digit numeric field. The first digit of the OrdNum_10 field indicates the type of order it is. For example, order numbers beginning with 2 are purchase orders, numbers beginning with 7 are customer orders and orders beginning with 5 are internal work orders.
What I would like to be able to do is trigger the RoboTasks only when the changes to the OrdNum_10 field are numbers beginning with 5.
File Monitor Trigger
Posted: Fri Feb 23, 2007 4:55 am
by Oleg
Do you want to detect changes in specified row (i.e. only in one value) or you want to scan all rows by condition OrdNum_10 like '5%' and detect the changes in any row?
How many rows (approx) does the query return:
select OrdNum_10 from OrderMaster where OrderMaster.OrdNum_10 like '5%' ?
File Monitor Trigger
Posted: Fri Feb 23, 2007 6:01 am
by squaremonkey
I want to scan all rows by the condition OrdNum_10 like '5%' to detect any changes.
The query select OrdNum_10 from OrderMaster where OrderMaster.OrdNum_10 like '5%' will return approx. 1000 rows.
File Monitor Trigger
Posted: Fri Feb 23, 2007 7:04 am
by lonnie16
And this may help the detection. ( maybe )
Is the target machine loafing most of the time? If so, output the query to a thousand line text file, and call it the master. Then every five minutes, pull and build a new text file from a query at that moment. You see where I'm going... Comparing text files is a piece of cake for robotask. ( and the cpu meter will periodically blip )
File Monitor Trigger
Posted: Fri Feb 23, 2007 9:21 am
by Oleg
See this example, please. This task retrieve all values from OrdNum_10 field and saves in variable Current_Value. Next RoboTask compares variables Current_Value and Old_Value. If values are different then raises the message and saves current value into Old_Value.
This task is starting by cyclic trigger every 60 sec.
You can put some another steps (or start another task) instead of message.
File Monitor Trigger
Posted: Fri Feb 23, 2007 10:06 am
by squaremonkey
Yes, I understand the approach. The example was very helpful.
Thank you for the help and for such a fine product.