Inflight change/cancel

Gargichatterjee
Tera Contributor

Hi,

I have a scenario, wherein the order will take multiple days to complete. I want to implement inflight cancel/change on this order. These actions will not be through the UI, rather I need them to be implemented programmatically. In addition to this, I need to do undo transactions as well. To explain this, suppose the network is reserved, workforce appointment is booked and PONR is not yet reached. The customer can cancel the order. So the network reservation as well as workforce reservation needs to be rollbacked(undone). How can I achieve this, please suggest.

 

Thanks.

1 ACCEPTED SOLUTION

Hi @Gargichatterjee ,

That is a good question. And here's how you can build it.

 

In the example below, I have two external system callouts - Reserve TN and Book Appointment.

Make use of the Order Task action to represent these.

Build a separate subflow for happy path + compensation actions as shown below.

Thus once the Order Task for 'Reserve TN' moves to In Progress, next step will be to call an extension subflow or a Flow (up to you) with the 3 different switch cases for the Revision Actions.

 

Within the Order Task, you have an option to configure the Inflight behaviour which will tell OM if the Order Task is to be re-executed or skipped based on the type of Inflight Change. If this is not configured, the Order Task will always be re-executed which will call the extension subflow and process the steps based on the Revision Operation (i.e. Happy path v/s Inflight Change v/s Inflight Cancel)

 

You can extend this logic further based on your requirements.

ShashankInamdar_0-1701091058750.png

 

Hope this helps.

 

Regards

Shashank

View solution in original post

17 REPLIES 17

That's great, @ShashankInamdar. Wonderful explanation.

 

Now two questions from me. ðŸ™‚

  1. "you have an option to configure the Inflight behaviour which will tell OM if the Order Task is to be re-executed or skipped based on the type of Inflight Change" - Is it related to Inflight Change Type & Inflight Change Option. If not, then?
  2. Regarding cancel, shouldn't we cancel, instead of close complete, the order task after calling REST - Release TN step?

Thanks,

Molay


@MolayD21 wrote:

That's great, @ShashankInamdar. Wonderful explanation.

 

Now two questions from me. ðŸ™‚

  1. "you have an option to configure the Inflight behaviour which will tell OM if the Order Task is to be re-executed or skipped based on the type of Inflight Change" - Is it related to Inflight Change Type & Inflight Change Option. If not, then? <Correct>
  2. Regarding cancel, shouldn't we cancel, instead of close complete, the order task after calling REST - Release TN step? <Perhaps. Depends on how you want to look at this. A close complete indicates the execution logic of the Order Task is done. A Canceled indicates the Task itself was cancelled. So, this is open to interpretation and OM will not prescribe to one way or the other>

Thanks,

Molay


 

Hi @ShashankInamdar ,

 

I can cancel the service order and the logic is getting executed for the same through the configured subflow. But when I am cancelling the product order itself, then the corresponding subflow is not getting executed. What can be the reason for that? When we are cancelling the order itself then all the service orders should also be revised hence there corresponding logics should also be executed. At least that is the behavious we want to achieve.

Please suggest.

Thanks.

 

One more thing I noticed that, in case of inflight cancel, the service orders, which were there during order decomposition their states are getting changed to scheduled. But, if few of them are already executed and completed, there is no re-execution of those tasks for the undo transactions.

For example, the following I am getting as part of inflight cancel. But what we expect is that, there should be an order task generated which will undo SO0001 as well. Please suggest what is to be done here.

 

Thanks.

  Current StateAfter inflight cancel
    
Product OrderORD0001In progressCancellation in progress
Order Line ItemORDL00001  
Product OrderPO0001  
Service OrderSO0001Close completeClose complete
Inflight cancel --->SO0002In progressScheduled
 SO0003draftScheduled
 SO0004draftScheduled

Hi @Gargichatterjee 

I suspect you have not configured the 'Cancel Task Fields' on the Order Task. Please check below for an example. If no Cancel Task Field is configured, on the cancellation, for an already completed Order Task it remains in a completed state. The additional configuration will allow you to put the task back in an 'In Progress' state.

ShashankInamdar_0-1701175443270.png

Once the Order Task is back in 'In Progress', the extension subflow can be invoked as shown below ->

ShashankInamdar_1-1701175560836.png

 

Extension subflow -->

ShashankInamdar_2-1701175623829.png