Bulk Insert Items operation


The Bulk Insert Items operation inserts an entry for all the items in the XML document into the BMC Remedy Action Request (AR) System data store. This operation inserts the items in a transaction-based manner. Even if one field in the <items> XML contains an incorrect/invalid value, the entire operation fails. 

The following table describes the operation input elements for the Bulk Insert Items operation:

 Input elements for the Bulk Insert Items operation

Element

Description

Required

<adapter name>

Specifies the name of the adapter in the adapter configuration that is used to execute the operation 

Default value: ARSAdapter

No

<items>

Specifies the XML document containing the elements required to insert records into the BMC Remedy AR System schema

Warning

Note

You must specify values for each field required by BMC Remedy AR System to insert a complete record.

Yes


Warning

Note

Before running the operation, ensure that you specify the value of the Action field in the Call Adapter Activity to bulk-insert.

The following figure shows an XML sample of input elements for the Bulk Insert Items operation: 

<items> XML for the input elements for the Bulk Insert Items operation

<items>
       <item>
         <schema>CHG:ChangeInterface_Create</schema>
         <fields>
           <values>
             <field name="First Name"><![CDATA[Allen]]></field>
             <field name="Last Name"><![CDATA[Allbrook]]></field>
             <field name="Status"><![CDATA[1]]></field>
             <field name="Change Type"><![CDATA[2000]]></field>
             <field name="Change Timing"><![CDATA[4000]]></field>
             <field name="Risk Level"><![CDATA[1]]></field>
             <field name="Location Company"><![CDATA[Calbro Services]]></field>
             <field name="Detailed Description"><![CDATA[11111111111111111111111111111]]></field>
             <field name="Impact"><![CDATA[4000]]></field>
             <field name="Urgency"><![CDATA[3000]]></field>
             <field name="Company"><![CDATA[Calbro Services]]></field>
             <field name="Description"><![CDATA[ESX Host Not Responding]]></field>
             <field name="z1D_Action"><![CDATA[CREATE]]></field>
             <field name="TemplateID"><![CDATA[IDGAA5V0HG8P1ANUBIY8AAAMDMJHUW]]></field>
           </values>
         </fields>
       </item>


The following figure describes the sample adapter request for the Bulk Insert Items operation. 

Sample adapter request XML for the Bulk Insert Items operation

<adapter-request>
 <request-action>bulk-insert</request-action>
 <request-data>
   <remedy-action>
     <items>
       <item>
         <schema>CHG:ChangeInterface_Create</schema>
         <fields>
           <values>
             <field name="First Name"><![CDATA[Allen]]></field>
             <field name="Last Name"><![CDATA[Allbrook]]></field>
             <field name="Status"><![CDATA[1]]></field>
             <field name="Change Type"><![CDATA[2000]]></field>
             <field name="Change Timing"><![CDATA[4000]]></field>
             <field name="Risk Level"><![CDATA[1]]></field>
             <field name="Location Company"><![CDATA[Calbro Services]]></field>
             <field name="Detailed Description"><![CDATA[11111111111111111111111111111111111111111111111111]]></field>
             <field name="Impact"><![CDATA[4000]]></field>
             <field name="Urgency"><![CDATA[3000]]></field>
             <field name="Company"><![CDATA[Calbro Services]]></field>
             <field name="Description"><![CDATA[ESX Host Not Responding]]></field>
             <field name="z1D_Action"><![CDATA[CREATE]]></field>
             <field name="TemplateID"><![CDATA[IDGAA5V0HG8P1ANUBIY8AAAMDMJHUW]]></field>
           </values>
         </fields>
       </item>
       <item>
         <schema>CHG:ChangeInterface_Create</schema>
         <fields>
           <values>
             <field name="First Name"><![CDATA[Allen]]></field>
             <field name="Last Name"><![CDATA[Allbrook]]></field>
             <field name="Status"><![CDATA[1]]></field>
             <field name="Change Type"><![CDATA[2000]]></field>
             <field name="Change Timing"><![CDATA[4000]]></field>
             <field name="Risk Level"><![CDATA[1]]></field>
             <field name="Location Company"><![CDATA[Calbro Services]]></field>
             <field name="Detailed Description"><![CDATA[333333333333333333333333333333333333333333]]></field>
             <field name="Impact"><![CDATA[4000]]></field>
             <field name="Urgency"><![CDATA[3000]]></field>
             <field name="Company"><![CDATA[Calbro Services]]></field>
             <field name="Description"><![CDATA[ESX Host Not Responding]]></field>
             <field name="z1D_Action"><![CDATA[CREATE]]></field>
             <field name="TemplateID"><![CDATA[IDGAA5V0HG8P1ANUBIY8AAAMDMJHUW]]></field>
           </values>
         </fields>
       </item>
       <item>
         <schema>CHG:ChangeInterface_Create</schema>
         <fields>
           <values>
             <field name="First Name"><![CDATA[Allen]]></field>
             <field name="Last Name"><![CDATA[Allbrook]]></field>
             <field name="Status"><![CDATA[1]]></field>
             <field name="Change Type"><![CDATA[2000]]></field>
             <field name="Change Timing"><![CDATA[4000]]></field>
             <field name="Risk Level"><![CDATA[1]]></field>
             <field name="Location Company"><![CDATA[Calbro Services]]></field>
             <field name="Detailed Description"><![CDATA[333333333333333333333333333333333333333333]]></field>
             <field name="Impact"><![CDATA[4000]]></field>
             <field name="Urgency"><![CDATA[3000]]></field>
             <field name="Company"><![CDATA[Calbro Services]]></field>
             <field name="Description"><![CDATA[ESX Host Not Responding]]></field>
             <field name="z1D_Action"><![CDATA[CREATE]]></field>
             <field name="TemplateID"><![CDATA[IDGAA5V0HG8P1ANUBIY8AAAMDMJHUW]]></field>
           </values>
         </fields>
       </item>
       <item>
         <schema>CHG:ChangeInterface_Create</schema>
         <fields>
           <values>
             <field name="First Name"><![CDATA[Allen]]></field>
             <field name="Last Name"><![CDATA[Allbrook]]></field>
             <field name="Status"><![CDATA[1]]></field>
             <field name="Change Type"><![CDATA[2000]]></field>
             <field name="Change Timing"><![CDATA[4000]]></field>
             <field name="Risk Level"><![CDATA[1]]></field>
             <field name="Location Company"><![CDATA[Calbro Services]]></field>
             <field name="Detailed Description"><![CDATA[333333333333333333333333333333333333333333]]></field>
             <field name="Impact"><![CDATA[4000]]></field>
             <field name="Urgency"><![CDATA[3000]]></field>
             <field name="Company"><![CDATA[Calbro Services]]></field>
             <field name="Description"><![CDATA[ESX Host Not Responding]]></field>
             <field name="z1D_Action"><![CDATA[CREATE]]></field>
             <field name="TemplateID"><![CDATA[IDGAA5V0HG8P1ANUBIY8AAAMDMJHUW]]></field>
           </values>
         </fields>
       </item>
       <item>
         <schema>CHG:ChangeInterface_Create</schema>
         <fields>
           <values>
             <field name="First Name"><![CDATA[Allen]]></field>
             <field name="Last Name"><![CDATA[Allbrook]]></field>
             <field name="Status"><![CDATA[1]]></field>
             <field name="Change Type"><![CDATA[2000]]></field>
             <field name="Change Timing"><![CDATA[4000]]></field>
             <field name="Risk Level"><![CDATA[1]]></field>
             <field name="Location Company"><![CDATA[Calbro Services]]></field>
             <field name="Detailed Description"><![CDATA[333333333333333333333333333333333333333333]]></field>
             <field name="Impact"><![CDATA[4000]]></field>
             <field name="Urgency"><![CDATA[3000]]></field>
             <field name="Company"><![CDATA[Calbro Services]]></field>
             <field name="Description"><![CDATA[ESX Host Not Responding]]></field>
             <field name="z1D_Action"><![CDATA[CREATE]]></field>
             <field name="TemplateID"><![CDATA[IDGAA5V0HG8P1ANUBIY8AAAMDMJHUW]]></field>
           </values>
         </fields>
       </item>
     </items>
   </remedy-action>
 </request-data>
</adapter-request>

The following table describes the operation output element for the Bulk Insert Items operation:

 Output element for the Bulk Insert Items operation 

Process output

Description

<adapter response>

Specifies the XML document returned by the adapter request executed on BMC Remedy AR System

<bulk-insert-action-result>

Contains the metadata and XML response entries

<requested-entry-count>

Contains the number of entries passed in the items XML

Example: 5

<created-entry-count>

Contains the number of entries created successfully in BMC Remedy AR System

Example: 5

<status>

Contains the status of the request.

If the status is <success>, all entries are created successfully and the value for the <requested-entry-count> and the <created-entry-count> is the same.

If failed, the status appears as <error> and the value for the <created-entry-count> is 0. If one or more than one entry contains an incorrect value, all entries fail.

<status-reason>

Contains the error message and the reason for the request failure as returned by the BMC Remedy AR System server API.

See Sample adapter response if the request fails.

<failed-item-index>

In case of a failed status, this element value will be the item (in items request XML) index position due to which the bulk operation is aborted/failed.

The following figure illustrates an XML sample of the output elements for the Bulk Insert Items operation: 

XML sample of the output elements for the Bulk Insert Items operation 

<adapter-response>
 <execution-duration>13648</execution-duration>
 <status>success</status>
 <messageBase64 />
 <data>
   <bulk-insert-action-result>
     <metadata>
       <requested-entry-count>5</requested-entry-count>
       <created-entry-count>5</created-entry-count>
       <status>success</status>
     </metadata>
     <entries>
       <entry-id>000000000001910</entry-id>
       <entry-id>000000000001914</entry-id>
       <entry-id>000000000001915</entry-id>
       <entry-id>000000000001916</entry-id>
       <entry-id>000000000001917</entry-id>
     </entries>
   </bulk-insert-action-result>
 </data>
</adapter-response>

The following figure shows a sample adapter response when the request fails. 

Adapter response XML if the request fails

<adapter-response>
 <execution-duration>9937</execution-duration>
 <status>success</status>
 <messageBase64 />
 <data>
   <bulk-insert-action-result>
     <metadata>
       <requested-entry-count>8</requested-entry-count>
       <status>error</status>
       <status-reason>ERROR (48255): ; The contact for the creation of an Change cannot be found, please verify the contact information and try again.</status-reason>
       <failed-item-index>4</failed-item-index>
     </metadata>
     <entries />
   </bulk-insert-action-result>
 </data>
</adapter-response>



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

TrueSight Orchestration Content 23.1