How to trigger change model/ request using flow designer

Vinay2509
Tera Contributor

Hi Team,

 

I have requirement, I need to create subflow which gets  some inputs. using same inputs we need to instantiate equipment instance via change model/change request in subflow it self.

 

How to achieve this?

 

@Aneesh-D  - Please check if you have idea?

2 REPLIES 2

Aneesh-D
Tera Guru
Tera Guru

@Vinay2509 ,

 

The Create Equipment Change Request is implemented behind the scenes by executing 

createCIFromTemplate method from TNITemplateService script include in Network Inventory Core. 
 
AneeshD_0-1712534184567.png

 

if you are planning to keep the inputs same as the change request and assuming you will have task details as well in the input, you can create a new Action that would create equipment using the above script include method. A simplified script would look  like below.

 

 

(function execute(inputs, outputs) {

  
    new TNITemplateService().createCIFromTemplate(parentId, inputs.inventory_template, undefined, undefined, overrideValues, inputs.changeTaskId, true, inputs.stockroom_location, inputs.asset, rackSlotDetails);

    // if you want any related equipment to be created you can use the existing action "Create Related CIs"

})(inputs, outputs);

 

 

Please refer an out of the box action "Create Related CIs" to get familiar with the concept.

 

Please let me know if any further assistance required.

@Aneesh-D Thanks for response! But this will not work for our requirements

Basically we need to do OMT-TNI integration.

OMT has main flow, TNI has subflow,  TNI subflow will receive inputs from OMT main flow , and TNI subflow should create ONT instance using change request capabilty.

 

So basically, for integration TNI should give record producer action to OMT to add in main flow, so that will get inputs.

 

We did it,

 

Now question is,  in TNI subflow should handle errors , if flow fails, need to go give failed response to OMT

I have 15 steps in subflow, I need to send specific error message where it or on which action it fails.

 

how to handle this?