Overview


Site Flow is introducing a feature that allows you to modify the task duration of a batch. You may do this through the UI or via the Site Flow API.


This enhancement has two primary use cases:

  1. External imposition: PSPs that decide to use an external imposition service (such as Ultimate Impostrip) must take additional steps to modify their production schedule in Site Flow. Every imposed subbatch would need to be sent to the Site Flow Scheduling System via the API.
  2. Variable production speed: For some production/finishing devices it may be difficult or potentially even impossible to calculate the average production speed, depending on the complexity and size of the job. This affects the accuracy of the schedule.



TABLE OF CONTENTS



Change task duration in the Site Flow UI


Change in the Schedule section


In the PRODUCTION section of Site Flow click SCHEDULE > Schedule. The Schedule dashboard opens.



Select the subbatch you would like to edit by clicking on it.



The subbatch task info window appears. In this window you can modify the task duration by clicking Change at the bottom of the menu.



The Hours and Minutes fields appear. Change the fields to the desired duration and click Save when finished. In this example Duration has been changed to 50 minutes.



Make sure to run Replan after you update a job duration. Click the Replan at + button in the top-left portion of the screen, and select the time you wish to run the replan. Then click the blue Replan button. Note that at least ten minutes must pass between every replan in order for the schedule to update correctly.



Change in the View Batches section


Alternately, you may click BATCHES > View Batches and select the subbatch you wish to edit from the Batch List to the right.



On the Batch details page and select the subbatch that you wish to change the duration for.



The same subbatch task info window appears.



Follow the instructions as explained in the previous steps and click Save when finished.


When you update your job duration, run Replan.


Back to Top




Change task duration through the Site Flow API


You may also change a task duration via a series of API calls. This section walks you through the step-by-step process of changing a task's duration, as well as running a replan on your account's schedule.



Retrieve the job ID


To begin, you need to know the jobSourceIDs of the task. This field is also known as productComponentBatchId and it can be obtained via a Sub-Batch Created Trigger.


An example of a Sub-Batch Created Trigger template may look something like this:



This template returns productComponentBatchId, in this case: 613668452641e63ff2acaa45. This is your jobSourceIds.



Retrieve the job metadata


Your next step is to retrieve the job metadata with an API call. The basic format of the call is:


GET https://pro-api-dev.oneflowcloud.com/api/schedule/default/events?query={"jobSourceIds":["JOB_SOURCE_IDS"]}



By default, this call only returns jobs marked Ready. If you wish to see jobs with other statuses, you may append the status parameter. Per example:


GET https://pro-api.oneflowcloud.com/api/schedule/default/events?query={"jobSourceIds":["JOB_SOURCE_IDS"],"status":["ready","notstarted"]}


This call will return all jobs marked Ready or Not Started.



Let's continue the example and make a call for Ready and Not Started jobs using 613668452641e63ff2acaa45:


GET https://pro-api.oneflowcloud.com/api/schedule/default/events?query={"jobSourceIds":["613668452641e63ff2acaa45"],"status":["ready","notstarted"]}



The resulting JSON will contain taskId (see #1) and duration (measured in seconds) (see #2).



Make the call to change job duration

To change the job duration, you will need to make an API call using scheduleId and taskId. Because there is only one scheduleId instance per account, it is typically written as default. The API call is made in the following format:


PUT https://pro-api.oneflowcloud.com/api/schedule/default/tasks/[taskId]/time



Given the JSON example above, your call will be:


PUT https://pro-api.oneflowcloud.com/api/schedule/default/tasks/6136684b991a1bdc88d22c75/time

------------------------------


{"duration": 120}



This request changes the job duration to 120 seconds. If the call is successful, you will see the change reflected in the UI:



Replan


Finally, you must make a Replan API request. The call looks like this:


PUT https://pro-api.oneflowcloud.com/api/schedule/default/


The body must contain:


{"nextReplan": [unix timestamp]}



The date and time must be in Unix format. For example, a request to run a replan on 14 September 2021 looks like:


PUT https://pro-api.oneflowcloud.com/api/schedule/default/


------------------------------


{"nextReplan": 1631592000}


Back to Top




Workplan notes


A Workplan step can be associated with more than one device. When you replan, Site Flow reorganizes the production to meet the SLA agreement, and will check the production times for all the devices assigned to that event. If the subbatch event configured in the Product Workplan contains more than one enabled device, Site Flow calculates the production times for both, and schedules the fastest device.


Back to Top