I'm looking to implement a custom chart in Maximo that pulls Asset mbo values and populates a chart that is visible on the Assets application. Like so:
I can successfully render a chart and pull data from a hardcoded Asset Mbo, but I can't figure out how make the chart dynamic for an individual Asset. E.g Asset AB100001 is selected from the list tab, but Asset AB234560 is hardcoded into the jsp code, so data from Asset AB234560 will be rendered on every chart, for every asset.
My jsp code looks something like this example, where this developer is getting meter data and displaying it on the same type of jsp chart:
<%@ include file="../common/componentheader.jsp"%>
<%
String width = component.getProperty("width");
String height = component.getProperty("height");
String assetnum = boundComponent.getString();
MboSetRemote readingsSet = s.getMboSet("MEASUREMENT");
readingsSet.setWhere("ASSETNUM = '11450' and METERNAME = 'O-PRESSUR'");
readingsSet.reset();
String readingData = "[";
for (MboRemote r = readingsSet.moveFirst(); r != null; r = readingsSet.moveNext())
{
readingData += "{'Offset_ms':" + r.getDate("MeasureDate").getTime() +
",'Value':" + r.getDouble("MeasurementValue") + "},";
};
readingData += "]";
%>
This is almost exact what I need, except you'll notice that he hardcodes the assetnum when using the setWhere in line 3:
readingsSet.setWhere("ASSETNUM = '11450' and METERNAME = 'O-PRESSUR'");
Is there a way to use a binding variable in the setWhere function to dynamically pull the assetnum, instead of using the string '11450'?
Link to a blog post with this situation: http://vietmaximo.blogspot.com/2018/03/maximo-custom-control-part-iv-create.html