Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The JITL OrderStateTransitionJob template can be used to perform a transition on orders  for exampletransitions on orders, see JS7 - Order State Transitions. Examples for state transitions include to

  • continue orders from the FAILED or SUSPENDED state to the IN PROGRESS state and possibly to the RUNNING state in case of a JS7 - Job Instruction,
  • continue orders from the SUSPENDED state to the state they had before being suspended.
  • continue orders  orders from the PROMPTING state to the IN PROGRESS state and possibly to the RUNNING state.

The job template makes use of

...

the JS7 - REST Web Service API to perform JS7 - Order State Transitions.

Usage

When defining the job either:

  • invoke the Job Wizard that is available from the job properties tab in the Configuration view and select the JITL OrderStateTransitionJob and relevant arguments from the Job Wizard.

or

  • specify the JITL job class andcom.sos.jitl.jobs.orderstatustransition.OrderStateTransitionJob Java class name and add arguments specifying what order states to transition..

...

Download (upload .json): pdwOrderStateTransitionJobpwdOrderStateTransitionJob.workflow.json

You can use the job wizard Job Wizard like this:

Explanation:

  • Add an empty job from the instruction panel.
  • Specify a name and a label for the job.
  • Select an Agent.

In a next step invoke the job wizard Job Wizard that you find in the upper right corner of the job property editor. The wizard Job Wizard brings up the following popup window:

Image Modified


Explanation:

  • From the list of available job templates Job Templates select the OrderStateTransitionJob.

Then hit the Next button to make the job wizard Job Wizard display available arguments:


Image RemovedImage Added


Explanation:

  • Required Arguments
    • states : Specifies the liste semicolon separated list of states on which the transition is to will be applied for example failed,;scheduled
    • transition: Specifies the transition to be performed. Possible values are one of cancel, suspend, continue
    • Optional Arguments
      • workflow_folders:  Optionally the identifier of a Controller can be specified to limit results to workflows and jobs executed with the indicated Controller.
      • workflow_search_patterns:  Optionally the identifier of a Controller can be specified to limit results to workflows and jobs executed with the indicated Controller.
      • order_search_patterns:  Optionally the identifier of a Controller can be specified to limit results to workflows and jobs executed with the indicated Controller.
      • persist_duration:  Optionally the identifier of a Controller can be specified to limit results to workflows and jobs executed with the indicated Controller.
      • controller_id:  Optionally the identifier of a Controller can be specified to limit results to workflows and jobs executed orders processed with the indicated Controller.
      • batch_size: Optionally limit the size of REST API requests.
  • Note that the the check box checkbox provided with each argument has to be selected to add the argument is to be added to the arguments of the OrderStateTransitionJob template.

When hitting the Submit button, the wizard adds the required selected arguments to the job which should can look like this:

Image RemovedImage Added

The job arguments can be specified:

...

The Job Documentation including the full list of arguments can be found from: https://www.sos-berlin.com/doc/JS7-JITL/OrderStateTransitionJob.xml

Authentication

The Job makes use of the JS7 - REST Web Service API that is available from JOC Cockpit. 

  • The job is executed with an Agent and requires a network connection to JOC Cockpit.
  • The job has to authenticate with JOC Cockpit, for the related configuration see JS7 - JITL Common Authentication.

Anchor
arguments
arguments
Arguments

...

NameRequiredDefault ValuePurpose
statesyesn/a

Possible values: pending, scheduled, failed, suspended, waiting, inprogress, scheduled,prompting.prompting. Values can be specified in uppercase, lowercase or mixed letters.

Values can be specified from a semicolon separated The values can be a comma seperated list. Each state in the list is handled seperatly as e.g. the continue action for "prompting" is not the same as for "suspended"separately, for example

  • the transition continue for prompting orders will move orders to the IN PROGRESS and possibly to the RUNNING state,
  • the same transition for suspended orders will put orders to the state they had before being suspended.

Example: failed;suspended

transition

yesn/a

Possible values : cancel, suspend, continue.are one of:

  • cancel: Execute cancel for the execute cancel operation on related orders
  • continue: Execute execute resume for operation on failed and suspended orders. Execute confirm for operation on prompting orders.
  • suspend: Execute execute suspend for the operation on orders that are not failed, not finished and not finished suspended.
workflow_foldersno/*A list of workflow folders that contains the orders. hold workflows for which orders should be transitioned.

If more than one folder is specified then folders are separated Items sepearated by semicolon. When ending used with the trailing characters /* then the folder will be searched recursivlylooked up recursively. By default all folders will be looked up recursively.

Example: /folder/sub1;/another_folder/sub2/*

workflow_search_patternsnon/a

A list of search patterns for workflow folders that contains the orders. names of workflow for which orders should be transitioned. The wildcard characters * (zero or more characters) and ? (a single character) can be used. If more than one search pattern is used then they are separated by semicolon.

Example: *myWorkflow*, ;my?orkflow

order_search_patternsno/n/a

A list of search patterns for order names. May contain a folder. Items sepearated If more than one search pattern is used then they are separated by semicolon.

ExampleExamples: *myWorkflow*;/folder/sub1/my?orkflow

persist_durationnon/a

The duration This argument is available for FAILED orders. It specifies the minimum duration for which the order persists is in the failed state.

Available for FAILED orders.

Example: 2d

an ISO 8601 date format with the time offset and milliseconds being optional, e.g.

  • YYYY-MM-DDThh:mm:ss[.s][Z (Z means +00)]
  • YYYY-MM-DDThh:mm:ss[.s][+01:00]
  • YYYY-MM-DDThh:mm:ss[.s][+0100]
  • YYYY-MM-DDThh:mm:ss[.s][+01]
  • a format for a period A format for the duration relative to the current time, e.g. 6h, 12h, 1d, 1w that specifies the quantity followed by a qualifier.
  • Example:  
      • 2d
  • Possible qualifiers are:
    • s (seconds)
    • m (minutes)
    • h (hours)
    • d (days)
    • w (weeks)
    • M (months)
    • y (years
    )
A time offset is optional (e.g. 2d+02:00
    • )

It can also be specified with the parameter timeZone

If timeZone is undefined then UTC is used

The value 0 indicates the current time

controller_idnoActual Current Controller -idIDThe identifier of a Controller can be specified to limit the order resultset to workflows with resulting list of orders to the indicated Controller.
batch_sizeno10000

The maximum number of orders for one that are processed in a single request.

The number of orders that Orders are transitioned in a single transaction. This includes that either all orders in a transaction are transitioned or none. If the number of orders exceeds the batch size then a further transaction is executed.

If the value 1 is used for the batch_size = 1 is used then each order is transitioned individually with a successful or failed result.

The batch size should not exceed a value of approx. 15000 in order to limit the size of requests to the Controller to approx. 4 MB which is a frequently applied limit of Proxy Servers that might be in place between the Agent running the job and JOC Cockpit.

...

The OrderStateTransitionJob template does not return variables:

...

Further Resources

...