Class structure ID expressions
Integration Composer associates class structure IDs (classstructureid) with IT assets. This association is based on the item number or numbers specified in the expression for the itemnum property. Consequently, you must modify the expression for the classstructureid property to return class structure IDs for the item numbers that you specified previously.
Define class structure IDs for computers based on the way that your enterprise implements asset management.
The mapping expression returns class structure IDs for computers. The expression contains the class structure IDs that you create in the Maximo® database for your enterprise, based on the way that you manage computer assets.
Sample expression for classstructureid property
{
String itemnum = 'Deployed Asset.Systemrole';
String classstructureid = null;
if(!isNull(itemnum))
{
if(itemnum.equalsIgnoreCase("DESKTOP") || itemnum.equalsIgnoreCase("Network PC") || itemnum.equalsIgnoreCase("Standalone
PC") || itemnum.equalsIgnoreCase("PC") || itemnum.equalsIgnoreCase("ComputerSystem")) {
itemnum = getProperty("assetinit.properties", "assetinit_systemrole_item_computer");
} else if(itemnum.equalsIgnoreCase("Network Portable") || itemnum.equalsIgnoreCase("Standalone Portable") ||
itemnum.equalsIgnoreCase("NOTEBOOK")) {
itemnum = getProperty("assetinit.properties", "assetinit_systemrole_item_portable");
} else if (itemnum.equalsIgnoreCase("LAPTOP")){
itemnum = getProperty("assetinit.properties", "assetinit_systemrole_item_laptop");
} else if(itemnum.equalsIgnoreCase("Server") || itemnum.equalsIgnoreCase("Windows 2003 Server") ||
itemnum.equalsIgnoreCase("PowerEdge 500C Server")) {
itemnum = getProperty("assetinit.properties", "assetinit_systemrole_item_server");
} else if (itemnum.equalsIgnoreCase("Unix Server") ) {
itemnum = getProperty("assetinit.properties", "assetinit_systemrole_item_unixserver");
} else {
itemnum = null;
LogManager.logInfo("skipCurrentInstance()- Computer.classstructureid, the Deployed Asset.Systemrole <" +'Deployed
Asset.Systemrole' +"> is not mapped to itemnum ");
skipCurrentInstance();
}
if (!isNull(itemnum)) {
//check classstructureid in the cache
Map itemClassstructureidMap = (HashMap)getAttribute("assetinit_itemclassstructureidmap");
if (itemClassstructureidMap==null)
{
itemClassstructureidMap=new HashMap();
setAttribute("assetinit_itemclassstructureidmap", itemClassstructureidMap);
}
if(itemClassstructureidMap.containsKey(itemnum))
{
classstructureid = (String) itemClassstructureidMap.get(itemnum);
}
else
{
String sql = "select classstructureid from " + getTargetTableOwner() + ".item where itemnum = '" + itemnum + "'";
classstructureid = executeTargetSQL(sql,null);
itemClassstructureidMap.put(itemnum, classstructureid);
}
}
if(isNull(classstructureid))
{
LogManager.logInfo("skipCurrentInstance()- Computer.classstructureid, the Deployed Asset.Systemrole mapped itemnum <"
+itemnum +"> does not exist in item table");
skipCurrentInstance();
}
}
else
{
LogManager.logInfo("skipCurrentInstance()- Computer.classstructureid, the Deployed Asset.Systemrole is null ");
skipCurrentInstance();
}
return(classstructureid);
}