Introduction
JS7 - Notice Boards implement dependencies between a number of workflows:
- One or more workflows wait for each other based on Notices that they expect and that they post. One or more posting workflows hold a JS7 - PostNotices Instruction while one or more expecting workflows include the JS7 - ExpectNotices Instruction or JS7 - ConsumeNotices Instruction. Expecting workflows wait until a Notice arrives from a posting workflow.
- Notice Boards are used to manage the creation of Notices and the desired dependency scheme:
- JS7 - Global Notice Boards implement hard dependencies that are applied without exception,
- Schedulable Notice Boards implement soft dependencies based on the JS7 - Daily Plan and consider dependencies for days only for which posting workflows are scheduled by related orders.
Schedulable Notice Boards are introduced starting from the following release:
FEATURE AVAILABILITY STARTING FROM RELEASE 2.7.4
The article offers a tutorial to users who wish to implement workflow dependencies.
Schedulable Notice Boards
Notices
Notices are limited in scope to a specific Daily Plan date.
Notices can be posted and deleted by workflows and by users. Notices exist for the lifetime of the related instance of a Notice Board (Plan) unless they are deleted by ConsumeNotices Instructions or by the user.
Notices from Schedulable Notice Boards specify a Notice ID that holds the Daily Plan date.
- For each Daily Plan date an instance of the Notice Board (Plan) is created which is assigned the Notices and orders for the related Daily Plan date.
- Notices from posting workflows are announced when adding orders to the Daily Plan. On days for which no order for a posting workflow is announced, the expecting workflow can be configured to ignore the Notice condition. Example
- Behavior with Global Notice Boards:
- For the posting Workflow 1 orders are created for Mon-Fri. For the expecting Workflow 2 orders are created for Mon-Sun.
- As a result the Notice condition will not be resolved for Workflow 2 during weekends. The workflow will not continue unless a Notice is posted by the user.
- Behavior with Schedulable Notice Boards:
- For the posting Workflow 1 orders are created for Mon-Fri. For the expecting Workflow 2 orders are created for Mon-Sun.
- As no Notices are announced from Workflow 1 for weekends, the Workflow 2 can be configured to ignore the Notice condition and to continue or to skip execution of instructions inside the ConsumeNotices Instruction.
- Behavior with Global Notice Boards:
Plans
Plans are spaces created internally in JS7 to resolve dependencies from Notices.
Currently, Plans have a fixed duration of 24 hours that corresponds to the Daily Plan date. Future versions of JS7 will offer parallel Plans for an arbitrary duration such as weeky, monthly Plans.
The purpose of a Plan is to specify the begin and end of a period of Daily Plan dates that share Notices. This allows an overlapping Daily Plan, for example with Monday's Notices being considered independently from Tuesday's Notices. Should Monday's Daily Plan be exceeded to a later point in time on Tuesday, Wednesday etc., for example in case of orders not being completed on Monday, then such orders will stick to Monday's Daily Plan date to resolve dependencies.
Tuesday's orders will resolve dependencies within the scope of Tuesday's Plan independently from Monday's Plan. Overlapping allows to run Monday's and Tuesday's Daily Plan in parallel without interfering scope of Notices.
- Some users wish to complete Monday's Daily Plan before starting orders for Tuesday's Daily Plan. This is possible in JS7, either by manual control of the completion of Monday's orders or by transitioning such orders automatically, for example using the JS7 - JITL OrderStateTransitionJob.
- Some users wish Monday's Daily Plan to overlap with Tuesday's Daily Plan in case that Monday's orders are late. This is the default behavior of JS7.
Plans can be created/opened, closed and deleted:
Creating Plans
Plans are automatically created when orders are scheduled, for example from the JS7 - Daily Plan Service and when manually adding orders.
- Plans hold announcements of Notices that will be created by posting Workflows triggered from orders for a given Daily Plan date. In other words: if an order is scheduled for a workflow that holds a PostNotices Instruction, then an announcement is created for the order's Daily Plan date at the point in time when the order is added.
- If an announcement is available, then orders in expecting workflows will wait for Notices from Schedulable Notice Boards.
- If no announcement is available, then orders in expecting workflows can be configured to skip or to immediately process subsequent instructions in a workflow.
Closing Plans
When a Plan is closed, then no orders can be added. The Plan still can hold Notices and unfinished orders that can continue for any duration.
A closed Plan can be opened, allowing to add orders for the related/past Daily Plan date.
By default Plans are automatically closed 1 day after Daily Plan date. The value can be changed from the age_of_plans_to_be_closed_automatically
setting in the JS7 - Settings page. For details see JS7 - Daily Plan Service.
Users have the option to manually close a Plan from the Daily Plan -> Dependencies view.
Deleting Plans
Plans are automatically deleted if they previously have been closed and if no orders are present. On deletion all Notices related to a Plan will be dropped.
No operations are applicable to a deleted Plan.
Configuration
Examples
Download
Examples for configuration of Notice Boards, workflows and schedules are available for download: schedulable_notice_boards.zip
Import
For import of examples see JS7 - Inventory Export and Import.
Examples by default will be imported to the /SchedulableNoticeBoards/Examples folder. Users can prepend an existing folder on import.
Notice Boards
The SYN-ExNoticeSchedulableAny Notice Board is specified of type schedulable like this:
- No Notice ID is specified.
- Notices for the Notice Board created from any orders will match.
The SYN-ExNoticeSchedulableIdentifier Notice Board is specified of type schedulable like this:
- The Notice ID is assigned a quoted string as an identifier.
- Notices for the Notice Board created from any orders will match.
The SYN-ExNoticeGlobalUserOK Notice Board is specified of type global. The Notice Board is intended for user intervention in later examples.
- The Notice Board type is global as otherwise for each Daily Plan date a Notice will have to be posted by the user.
- If the Notice Board were of schedulable type, then it might trigger Notice conditions when not announced.
Workflows
Expecting Workflows
The SYN-ExNoticeSchedulableExpectAny workflow makes use of the JS7 - ExpectNotices Instruction to wait for Notices of the SYN-ExNoticeSchedulableAny Notice Board:
- The ExpectNotices Instruction holds the quoted name of the Notice Board in its expression:
'SYN-ExNoticeSchedulableAny'
- The ExpectNotices Instruction is configured to
Skip
the current condition if no Notices from posting workflows are announced for the related day.
The SYN-ExNoticeSchedulableExpectAnyPlusIdentifier workflow makes use of the JS7 - ExpectNotices Instruction to wait for Notices from both the SYN-ExNoticeSchedulableAny and SYN-ExNoticeSchedulableIdentifier Notice Boards:
- The ExpectNotices Instruction holds the quoted names of Notice Boards in its expression:
'SYN-ExNoticeSchedulableAny' && 'SYN-ExNoticeSchedulableIdentifier'
- The
&&
operator specifies a logical and. - The
||
operater specifies a logical or.
- The
- The ExpectNotices Instruction is configured to
Skip
the current condition if no Notices from posting workflows are announced for the related day.
The SYN-ExNoticeSchedulableConsumeAnyPlusIdentifier workflow makes use of the JS7 - ConsumeNotices Instruction to wait for Notices from both the SYN-ExNoticeSchedulableAny and SYN-ExNoticeSchedulableIdentifier Notice Boards and alternatively to accept a Notice from user intervention:
- The workflow acts similar to the previous example, except for the fact that it will delete referenced Notices if they are present.
- The ConsumeNotices Instruction holds the quoted names of Notice Boards in its expression:
('SYN-ExNoticeSchedulableAny' && 'SYN-ExNoticeSchedulableIdentifier') || 'SYN-ExNoticeGlobalUserOK'
- The
&&
operator specifies a logical and. - The
||
operater specifies a logical or. - Parantheses are used to express the order of evaluation.
- The
- The example boils down to the fact that the condition will be resolved if Notices for both SYN-ExNoticeSchedulableAny and SYN-ExNoticeSchedulableIdentifier Notice Boards are present or if the user or some other workflow posts a Notice from the global SYN-ExNoticeGlobalUserOK Notice Board.
- The ConsumeNotices Instruction is configured to
Process
the instructions and jobs included in the block if no Notices from posting workflows are announced for the related day.
Posting Workflows
The SYN-ExNoticeSchedulablePostAny Workflow makes use of the JS7 - PostNotices Instruction to post a Notice to the SYN-ExNoticeSchedulableAny Notice Board:
- The PostNotices Instruction specifies the name of the Notice Board:
SYN-ExNoticeSchedulableAny
The SYN-ExNoticeSchedulablePostAnyPlusIdentifier workflow makes use of the JS7 - PostNotices Instruction to post Notices to both the SYN-ExNoticeSchedulableAny and SYN-ExNoticeSchedulableIdentifier Notice Boards:
- A PostNotices Instruction can hold references to one or more Notice Boards.
- Instead of posting both Notices from a single PostNotices Instruction the example makes use of separate PostNotices Instructions to implement the condition that the second Notice is posted only if some later job was successfully completed.
Schedules
Orders for Expecting Workflows
Schedules are created to add Orders to expecting workflows:
- Orders are scheduled for Monday to Sunday.
- Examples make use of 4am start time in the UTC time zone.
Further schedules for expecting workflows look similar to the above example.
Orders for Posting Workflows
Schedules are created to add Orders to posting Workflows:
- Orders are scheduled for Monday to Friday.
- The example makes use of 9am start time in the UTC time zone for the first Notice
The example makes use of 11am start time in the UTC time zone for the second Notice:
Visualization
Daily Plan Dependencies
Users can check dependencies from the Daily Plan -> Dependencies sub-view.
Display of Dependencies
When switching to a day in the calendar widget to which orders have been added that are already started, for example for the current day, then the picture can look like this:
- The blue color of posting workflows indicates normal operation.
- The yellow/green color of expecting workflows indicates that orders are in the waiting state with ExpectNotices or ConsumeNotices Instructions.
- The numeric indicator in expecting workflows specifies the number of waiting orders. Clicking the numeric indicator invokes a popup window that will display the orders.
- The yellow/green color to and from Notice Boards indicates that orders are in the waiting state in expecting workflows and that orders for posting workflows have not been started or did not yet reach the related PostNotices Instruction in the workflow.
Between 4am and 9am we find the following picture when orders for expecting workflows have been started:
At 9am the SYN-ExNoticeSchedulablePostAny order is started and changes the picture until 11am like this:
- The SYN-ExNoticeSchedulablePostAny Notice is posted from the related workflow.
- The order for the expecting workflow SYN-ExNoticeSchedulableExpectAny did meet the Notice condition and did pass & leave the workflow.
After 11am when all dependencies are resolved - more precisely: when all Notices have been posted and all orders for expecting workflows have passed the ExpectNotices or ConsumeNotices Instructions - then the picture looks like this:
- The blue color of posting and expecting workflows indicates normal operation.
- The grey color to and from Notice Boards indicates that Notices have been posted and have been consumed, i.e. they do no longer exist.
- Blue/grey colors indicate the desired situation with dependencies between workflows being resolved.
The Dependencies sub-view will show similar results for weekends when no orders are started and no Notices are announced from posting workflows. Orders in expecting workflows will proceed depending on the Wait/Skip/Process settings in ExpectNotices and ConsumeNotices Instructions.
When switching to a future day in the calendar widget to which orders have been added, for example next day's Daily Plan date, then the picture is different:
- The blue color of posting and expecting workflows indicates normal operation.
- The orange color to and from Notice Boards indicates that orders are available but either are in scheduled or pending state and did not yet start or did start but did not reach the workflow position that holds the PostNotices Instruction or ExpectNotices/ConsumeNotices Instruction.
Operations on Dependencies
The calendar widget in the Daily Plan -> Dependencies view offers the following operations for the Plan of a given Daily Plan date:
- Open Plan
- The operation is availablen when a Plan is closed. It allows to add orders to a past Daily Plan date in case that not all jobs for a previous date have been executed and that dependencies have not been resolved. The functionality is not available for JS7 - Global Notice Boards that resolve Notices from orders for the current date or future date for which they are added.
- A Plan remains closed as long as orders are available with the Plan.
- Close Plan
- The operation is available when a Plan is open. When closing a Plan, then no new orders can be added.
- When no more orders are present, then a closed Plan will be deleted automatically and cannot be reopened.
Workflows View
Users can check and can manage dependencies from the Workflows view.
- For posting and expecting workflows orders are displayed. Consider the "Order Filter" button that limits the future period for which orders will be visible. A yellow/green color indicator specifies the waiting state of orders.
- Users can identify the Notice Boards used for each PostNotices, ExpectNotices and ConsumeNotices Instruction. For Notice Boards checkboxes are offered that can be checked to perform a bulk operation that will post Notices to related orders.
Further Resources
- JS7 - Notice Boards
- JS7 - PostNotices Instruction
- JS7 - ExpectNotices Instruction
- JS7 - ConsumeNotices Instruction