dojo ICM广播案例列表搜索

oogrdqng  于 2022-12-16  发布在  Dojo
关注(0)|答案(1)|浏览(145)

我试图预览类似的IBM Case Manager案例,当案例打开时,我收到错误onBroadcastEvent不是一个函数,它不包含在self中。我正在使用连接到脚本适配器(发送工作项)

require(["icm/model/properties/controller/ControllerManager", "ecm/model/Desktop" ], function(ControllerManager, Desktop) {

  var solution = Desktop.currentSolution;   
  var params = {};  
  var self = this;    

  var prefix = solution.prefix;    

  params.ObjectStore = solution.getTargetOS().id;    

  var custID = payload.workItemEditable.propertiesCollection.LSS_IdentificationValue.value;

  console.log ("Customer ID: ",custID);    

  var caseObj = payload.workItemEditable.icmWorkItem.caseObject;    

  caseObj.retrieveCachedAttributes(function(caseObject) {      

  var caseID = caseObject.caseIdentifier;      

  console.log ("Case ID: ",caseID);        

  /* Find all of these */      

  var criterion1 = new ecm.model.SearchCriterion({"id": prefix+"IdentificationValue", "name" : "Identification Type", "selectedOperator": "STARTSWITH", "defaultOperator": "STARTSWITH", "dataType": "xs:string"});      

  criterion1.value = custID ;      

  criterion1.defaultValue = custID ;      

  criterion1.setValues( [custID]);        

  params.criterions = [criterion1];      

  params.CaseType = ""; /* all case types */      

  params.solution = solution;        

  var searchPayload = new icm.util.SearchPayload();      
  searchPayload.setModel(params);        
  searchPayload.getSearchPayload(function(payload) {          
  self.onBroadcastEvent("icm.SearchCases", payload);      
  });  

  });            
});
pdsfdshx

pdsfdshx1#

你的“这个”在“var self =这个;“驻留在匿名函数中,因此这可能是Window对象。
这个代码块在一个scriptadapter中,我理解的对吗?在这种情况下,把你的赋值移到第一行,在require之前。然后你自己就会得到scriptadapter(上面有onBroadcastEvent函数)。

var self = this; 
  require(["icm/model/properties/controller/ControllerManager", "ecm/model/Desktop" ], function(ControllerManager, Desktop) {

  var solution = Desktop.currentSolution;   
  var params = {};
  ....

相关问题