...
- Download sort_orders.zip
- Extract the archive to any folder within the
./config/live
folder of your JobScheduler installation. - The archive will extract the files included to a folder
sort_orders.
- You can store the sample files to a different folder, the solution does not make use of specific folder names.
Pattern
Flowchart |
---|
job_chain [label="Job Chain\ntriggered by File Orders\or Ad Hoc Orders",fillcolor="orange"]
job_sorter [label="Job check_predecessor",fillcolor="lightskyblue"]
job_next_job [label="Next Job", fillcolor="lightskyblue"]
sorter_orders_completed [shape=diamond,label="list of orders completed?",fillcolor="white"]
order_C [shape="ellipse",label="File Order C\n ",fillcolor="violet"]
order_B [shape="ellipse",label="File Order B\n ",fillcolor="violet"]
order_A [shape="ellipse",label="File Order A\n ",fillcolor="violet"]
order_sort [label="Sort Orders",fillcolor="white"]
order_A -> job_chain
order_B -> job_chain
order_C -> job_chain
job_chain -> job_sorter
job_sorter -> sorter_orders_completed
sorter_orders_completed -> job_next_job [label=" yes "]
sorter_orders_completed -> order_sort [label=" Suspend Order "]
order_sort -> job_check_predecessor |
Implementation
Components
- The solution implements a job
sorter
that can be added to the top of any job chain.- This job implements a
spooler_process()
function that suspends all incoming orders. - This job is configured for one task and with an idle timeout attribute, i.e. it executes incoming orders sequentually.
- After the last order this job waits for the duration specified with the
idle_timeout
attribute for new orders.- The idle timeout is configured by
<job idle_timeout="10">
with thesorter
job definition. - With the idle timeout being expired this job will execute its
spooler_exit()
function and will sort all orders that have previously been suspended.- Sorting is done in alphabetical order.
- The orders are reinserted to the next job node that follows the
sorter
job in the job chain.
- The idle timeout is configured by
- This job implements a
- The sample included makes use of a job chain
job_chain1
that includes the job nodes for thesorter
job and ahello
job.
...