码迷,mamicode.com
首页 > 其他好文 > 详细

Siebel Presumed Child Property Set

时间:2014-09-17 18:33:12      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   os   ar   strong   for   div   

Scripts presume the existence of a child property set. For example see the following code snippet

function CheckAndImport()
{. . .  . .
bsAdapter.InvokeMethod("Query",vInputs,vOutputs);
var vInMsg = vOutputs.GetChild(0);
vInputs.Reset();
vOutputs.Reset();
vInputs.AddChild(vInMsg);    
vInputs.SetProperty("MapName","Midea Price List Item Import");
bsTransfer.InvokeMethod("Execute",vInputs,vOutputs);
var vOutMsg = vOutputs.GetChild(0);
. . . . . }

This could lead to unhandled errors and corrupt data, since when an operation is performed on a nonexistent child, an error is thrown.

Recommendation

Ensure that the presence of the child property set is always checked by ensuring the GetChildCount() method of the parent returns a positive number.

An example used in the scenario is based on the preceding code: BY DW

function CheckAndImport()
{. . .  . .
bsAdapter.InvokeMethod("Query",vInputs,vOutputs);
if(vOutputs.GetChildCount()>0)
{
var vInMsg = vOutputs.GetChild(0);
vInputs.Reset();
vOutputs.Reset();
vInputs.AddChild(vInMsg);    
vInputs.SetProperty("MapName","Midea Price List Item Import");
bsTransfer.InvokeMethod("Execute",vInputs,vOutputs);
var vOutMsg = vOutputs.GetChild(0);
}
. . . . . }

 

Siebel Presumed Child Property Set

标签:style   blog   color   io   os   ar   strong   for   div   

原文地址:http://www.cnblogs.com/Flamo/p/3977622.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!