我如何才能在 IBM Case Manager 中获得另一个解决方案?
How can I get cases another solution in IBM Case Manager?
我有两个解决方案。
我怎样才能获得其他解决方案?
我认为icm.util.SearchPayload可以让你得到当前解决方案的案例。
buildPayload: function (values) {
if (!values) {
console.log("An invalid values is received!");
return;
}
var searchPayload = new icm.util.SearchPayload();
// CURRENT SOLUTION
var solution = this.widget.solution;
var params = {};
params.ObjectStore = solution.getTargetOS().id;
params.ceQuery = "SELECT t.[FolderName], t.[LastModifier], t.[DateLastModified], t.[CmAcmCaseTypeFolder], t.[CmAcmCaseState], t.[CmAcmCaseIdentifier], t.[DateCreated], t.[Creator], t.[Id], t.[ContainerType], t.[LockToken], t.[LockTimeout], t.[ClassDescription], t.[DateLastModified], t.[FolderName] FROM [CmAcmCaseFolder] t where ";
params.ceQuery += "t.[CmAcmCaseIdentifier] LIKE '%%' AND ";
for (var key in values) {
var attr = values[key].attr;
if (attr.dataType === "xs:string") {
params.ceQuery += "t.[" + key + "] LIKE '%" + values[key].value + "%' AND ";
} else {
params.ceQuery += "t.[" + key + "] = " + values[key].value + " AND ";
}
}
params.ceQuery = params.ceQuery.substring(0, params.ceQuery.length - 4);
var that = this;
this.widget.solution.retrieveCaseTypes(function (types) {
console.log(params.ceQuery);
params.caseType = types && types.length > 0 && types[0].name; // default to the first case type
params.solution = solution;
searchPayload.setModel(params);
var payload = searchPayload.getSearchPayload(function (payload) {
that.widget.onBroadcastEvent("icm.SearchCases", payload);
console.log(payload);
that.displayPayload(payload);
});
//
});
},
可能是
ecm.model.desktop.retrieveSolutions?
谢谢!
解决方案:
define(["dojo/_base/declare",
"dojo/_base/lang",
"dojo/_base/array",
"icm/base/Constants",
"icm/model/Case",
"ecm/LoggerMixin",
"icm/model/_DesktopMixin"],
function(declare, lang, array, Constants, Case, LoggerMixin, _DesktopMixin){
return declare("icm.custom.pgwidget.customSearchWidget.CustomWidgetContentPaneEventListener", [LoggerMixin, _DesktopMixin], {
searchTemplate: null,
widget: null,
constructor: function(widget){
this.widget = widget;
},
buildPayload: function(values) {
if(!values) {
console.log("An invalid values is received!");
return;
}
console.log("retrieveSolutions");
var that = this;
this.retrieveSolutions(function(solutionList) {
array.forEach(solutionList, function(solution) {
if (solution.id === "CBFPSFED_57_2") {
console.log("CBFPSFED_57_2");
var searchPayload = new icm.util.SearchPayload();
var params = {};
params.ObjectStore = solution.getTargetOS().id;
params.ceQuery = "SELECT t.[FolderName], t.[LastModifier], t.[DateLastModified], t.[CmAcmCaseTypeFolder], t.[CmAcmCaseState], t.[CmAcmCaseIdentifier], t.[DateCreated], t.[Creator], t.[Id], t.[ContainerType], t.[LockToken], t.[LockTimeout], t.[ClassDescription], t.[DateLastModified], t.[FolderName] FROM [CmAcmCaseFolder] t where ";
params.ceQuery += "t.[CmAcmCaseIdentifier] LIKE '%%' AND t.[JR572_name] LIKE '%%%'";
solution.retrieveCaseTypes(function(types) {
console.log(types);
console.log(params.ceQuery);
params.caseType = types && types.length > 0 && types[0].name; // default to the first case type
params.solution = solution;
searchPayload.setModel(params);
var payload = searchPayload.getSearchPayload(function(payload) {
that.widget.onBroadcastEvent("icm.SearchCases", payload);
console.log("buildPayload");
console.log(payload);
});
});
}
});
});
},
_eoc_: null
});
});
要点:
icm/model/_DesktopMixin
this.retrieveSolutions(函数(解决方案列表){
我有两个解决方案。 我怎样才能获得其他解决方案?
我认为icm.util.SearchPayload可以让你得到当前解决方案的案例。
buildPayload: function (values) {
if (!values) {
console.log("An invalid values is received!");
return;
}
var searchPayload = new icm.util.SearchPayload();
// CURRENT SOLUTION
var solution = this.widget.solution;
var params = {};
params.ObjectStore = solution.getTargetOS().id;
params.ceQuery = "SELECT t.[FolderName], t.[LastModifier], t.[DateLastModified], t.[CmAcmCaseTypeFolder], t.[CmAcmCaseState], t.[CmAcmCaseIdentifier], t.[DateCreated], t.[Creator], t.[Id], t.[ContainerType], t.[LockToken], t.[LockTimeout], t.[ClassDescription], t.[DateLastModified], t.[FolderName] FROM [CmAcmCaseFolder] t where ";
params.ceQuery += "t.[CmAcmCaseIdentifier] LIKE '%%' AND ";
for (var key in values) {
var attr = values[key].attr;
if (attr.dataType === "xs:string") {
params.ceQuery += "t.[" + key + "] LIKE '%" + values[key].value + "%' AND ";
} else {
params.ceQuery += "t.[" + key + "] = " + values[key].value + " AND ";
}
}
params.ceQuery = params.ceQuery.substring(0, params.ceQuery.length - 4);
var that = this;
this.widget.solution.retrieveCaseTypes(function (types) {
console.log(params.ceQuery);
params.caseType = types && types.length > 0 && types[0].name; // default to the first case type
params.solution = solution;
searchPayload.setModel(params);
var payload = searchPayload.getSearchPayload(function (payload) {
that.widget.onBroadcastEvent("icm.SearchCases", payload);
console.log(payload);
that.displayPayload(payload);
});
//
});
},
可能是
ecm.model.desktop.retrieveSolutions?
谢谢!
解决方案:
define(["dojo/_base/declare",
"dojo/_base/lang",
"dojo/_base/array",
"icm/base/Constants",
"icm/model/Case",
"ecm/LoggerMixin",
"icm/model/_DesktopMixin"],
function(declare, lang, array, Constants, Case, LoggerMixin, _DesktopMixin){
return declare("icm.custom.pgwidget.customSearchWidget.CustomWidgetContentPaneEventListener", [LoggerMixin, _DesktopMixin], {
searchTemplate: null,
widget: null,
constructor: function(widget){
this.widget = widget;
},
buildPayload: function(values) {
if(!values) {
console.log("An invalid values is received!");
return;
}
console.log("retrieveSolutions");
var that = this;
this.retrieveSolutions(function(solutionList) {
array.forEach(solutionList, function(solution) {
if (solution.id === "CBFPSFED_57_2") {
console.log("CBFPSFED_57_2");
var searchPayload = new icm.util.SearchPayload();
var params = {};
params.ObjectStore = solution.getTargetOS().id;
params.ceQuery = "SELECT t.[FolderName], t.[LastModifier], t.[DateLastModified], t.[CmAcmCaseTypeFolder], t.[CmAcmCaseState], t.[CmAcmCaseIdentifier], t.[DateCreated], t.[Creator], t.[Id], t.[ContainerType], t.[LockToken], t.[LockTimeout], t.[ClassDescription], t.[DateLastModified], t.[FolderName] FROM [CmAcmCaseFolder] t where ";
params.ceQuery += "t.[CmAcmCaseIdentifier] LIKE '%%' AND t.[JR572_name] LIKE '%%%'";
solution.retrieveCaseTypes(function(types) {
console.log(types);
console.log(params.ceQuery);
params.caseType = types && types.length > 0 && types[0].name; // default to the first case type
params.solution = solution;
searchPayload.setModel(params);
var payload = searchPayload.getSearchPayload(function(payload) {
that.widget.onBroadcastEvent("icm.SearchCases", payload);
console.log("buildPayload");
console.log(payload);
});
});
}
});
});
},
_eoc_: null
});
});
要点:
icm/model/_DesktopMixin
this.retrieveSolutions(函数(解决方案列表){