Single File Pickup

Clovertech Forums Cloverleaf Single File Pickup

  • Creator
    Topic
  • #122171
    Jason Russell
    Participant

      Want to see if anyone has done something similar to this. I have a few ideas on how to handle this, but I’d rather not have a lot of moving parts, and want to try to not have to test this repeatedly.

      So we’re doing a batch file, but the downstream system can only handle (or only wants to handle) a specific number messages, once a day. Splitting the bulk message into subsets of messages isn’t a difficult, that is in place. What I’m wanting to do from here is only pick up one of those split groups per day. So the bulk split may create 5 different files, I want the fileset-local to only pick up one of those a day. Can this be done natively?

      If not, it would probably take a scheduled task via cron/scheduler to rename a file once a day to something the inbound can pick up, but I’m hoping to avoid that to simplify troubleshooting.

    Viewing 2 reply threads
    • Author
      Replies
      • #122172
        Jim Kosloskey
        Participant

          Have you investigated the DirParse UPoC of the Fileset Protocol?

          In the simplest form, if you want only the oldest to be picked up, your DirParse routine would be presented with a list of the files found during directory parse. I believe the default is timestamp order meaning the oldest would be the first in the list (I think). Then simply remove all but the first file in the list and return the list to the engine.

          If timestamp is not oldest first, then specify full detail on the parse and now you will get the date/time of each file found (I think) and you can have logic to handle that.

          As to timing, use advanced scheduling to have this only run once per day.

          • This reply was modified 1 week, 3 days ago by Jim Kosloskey. Reason: add once per day handling

          email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

        • #122175
          Jason Russell
          Participant

            So each instance of the trigger only happens once, so if it picks up a file based on the directory, it won’t pull the others until the next time trigger?

            • #122176
              Jim Kosloskey
              Participant

                Each time the scheduled event happens (in your case when the advanced scheduling says it should), the protocol scans the directory specified and creates a list of files found. If there is a DirParse UPoC stack, the first proc in the stack is presented with the list. The proc(s) can then 9if they choose) manipulate that list and return the manipulated list. ONLY the files in the returned list are processed during this scheduled event (in your case, one file).

                It would then be your responsibility to make sure all of the files eventually get processed. For example, if you create more than 30 files and there are only 30 days in a particular month, you would not have processed all of the files by the end of the month. But that may be OK in your scenario as the protocol will continue to pick up one file per day. You just need to be aware it will not be precise.

                If you want to go into any more detail, let’s take this off-line – email me.

                email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

            • #122177
              Jim Kosloskey
              Participant

                Jason, did you get this resolved?

                email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

            Viewing 2 reply threads
            • You must be logged in to reply to this topic.