I need to write a new adapter operation that implements AdapterScript01. However, I don’t always want the operation to publish a document the first run after it’s been enabled.
For example, I have a configured operation that fires every 30 seconds. I disable the operation, and then sometime later I enable it. Based on some logic I decide I don’t want the operation to fire at 30 so I return null. Then it should continue to fire 60, 90, 120 …etc.
Is there any way which the operation or adapter can know that the operation was just enabled and on it’s first run?
I have a situation where a process needs to be triggered 2 times a day, say at 9:00 am and 3:00pm.
The reason I’m trying to put it into an adapter operation is that I have a custom adapter that already has two notification operations. Basic Notification (my terminology) which will publish a document every X seconds and Block Notification (my terminology again) which will publish a document every X seconds except during periods of time of my choosing.
Therefore, an adapter operation makes it re-usable and keeps all my notification implementations in one place.
Topstar, this is an Enterprise adapter issue. The scheduler is great for IS, but will not help aww, unfortunately.
aww, I have solved a similar issue by creating an ILA and using it as a timer. The ADL is available in the Shareware section of the Web site at [url=“wmusers.com”]wmusers.com.
The script is designed to sleep for a specified period of time and then publish a document to the Broker. Reviewing it may help you understand some architectural concepts but you will need to perform some modification to (or replace entirely) the code.
In your project, it sounds like you will want to create a component that constantly checks if a Date object satisifies some condition(s).
Is it 09:00:00.0? Is it 15:00:00.0? Is it Monday, Tuesday, Wednesday, Thursday, or Friday?
If the conditions are met, publish a document. Otherwise, do nothing. You should write all of this code within a Custom Code step and do the publish action using the Java API. If you need help with this, let me know. (I do not have the API handy so I can’t write the code out for you right now!)
If you require Thread.sleep(), remember that the entire adapter will sleep for (at least) the time specified in your method call. Because an adapter executes as a thread itself, you lose control of it during a sleep period. In short, all other components running on the adapter will be unavailable until the thread awakes. Therefore, if you are using Thread.sleep(), the adapter it runs on should not have any other components.
For some reason I could not import the adl running 4.1.1/4.5.x. However, I believe I have found a solution that is actually not that difficult to do. Anybody know how I can paste my java code into these posts? Do I have to wrap it with any special tags?
For formatting help, check out the link on the left side of the page (Discussion > How to Format Posts). I recommend using the \fixed tag in the section “Simple Features”.
Be sure to check your “Preview” for proper formatting!
I downloaded the enable-disable code , and replaced it with code generated by wM in my custom step, but get all kinds of compile errors, like ‘class Notification should be in a file Notification.java’.??
Any clues of how I can import this code in my IC and use it?