Using V2.0.16(b241352008)
Getting the following NPE:
Null Pointer Exception
Stop Occurances.Root Container.Packaging Group.packagingMinsTable.summedData
at com.inductiveautomation.factorypmi.application.binding.ExpressionPropertyAdapter.runExpression(ExpressionPropertyAdapter.java:92)
at com.inductiveautomation.factorypmi.application.binding.ExpressionPropertyAdapter$1.run(ExpressionPropertyAdapter.java:59)
at com.inductiveautomation.ignition.client.util.EDTUtil$ProcessQueue.run(EDTUtil.java:126)
at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "values[0]" is null
at com.automation_pros.simaids.expressions.AsMap.execute(AsMap.java:58)
at com.inductiveautomation.ignition.client.expressions.ClientDynamicDispatchFunction.execute(ClientDynamicDispatchFunction.java:43)
at com.inductiveautomation.ignition.client.expressions.ClientDynamicDispatchFunction.execute(ClientDynamicDispatchFunction.java:43)
at com.inductiveautomation.ignition.common.expressions.FunctionExpression.execute(FunctionExpression.java:69)
at com.inductiveautomation.ignition.common.expressions.SubscriptExpression.execute(SubscriptExpression.java:50)
at com.inductiveautomation.ignition.common.expressions.functions.BaseFunction.executeAll(BaseFunction.java:64)
at com.automation_pros.simaids.expressions.SimpleIterator.execute(SimpleIterator.java:177)
at com.inductiveautomation.ignition.client.expressions.ClientDynamicDispatchFunction.execute(ClientDynamicDispatchFunction.java:43)
at com.inductiveautomation.ignition.client.expressions.ClientDynamicDispatchFunction.execute(ClientDynamicDispatchFunction.java:43)
at com.inductiveautomation.ignition.common.expressions.FunctionExpression.execute(FunctionExpression.java:69)
at com.inductiveautomation.factorypmi.application.binding.ExpressionPropertyAdapter.runExpression(ExpressionPropertyAdapter.java:83)
... 15 common frames omitted
Expression producing exception
selectStar(
{Root Container.Packaging Group.packagingMinsTable.pivotedData},
asMap(
forEach(
groupBy(
{Root Container.Packaging Group.packagingMinsTable.last8HistoricalData},
it()['path']
),
asList(
it()[0],
round(sum(it()[1],'value')/60.0,1)
)
)
)[it()['Occurrence']],
'Last 8',
'F',
asMap(
forEach(
groupBy(
{Root Container.Packaging Group.packagingMinsTable.historicalData},
it()['path']
),
asList(
it()[0],
round(sum(it()[1],'value') / 60.0,1)
)
)
)[it()['Occurrence']],
'Last 24',
'F'
)
Sample pivotedData
"#NAMES"
"Occurrence","_7A","_8A","_9A","_10A","_11A","_12P","_1P","_2P","_3P","_4P","_5P","_6P","_7P","_8P","_9P","_10P","_11P","_12A","_1A","_2A","_3A","_4A","_5A","_6A"
"#TYPES"
"str","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F","F"
"#ROWS","5"
"productlevel_at_sp","60.0","60.0","60.0","60.0","60.0","47.2","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0"
"cap_supply","60.0","60.0","60.0","60.0","60.0","47.2","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0"
"downstream_stop_request","60.0","60.0","60.0","60.0","60.0","47.2","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0"
"empty_bottles_present","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0","0.0"
"empty_bottles_primied","60.0","60.0","60.0","60.0","60.0","47.2","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0","60.0"
Sample historicalData
"#NAMES"
"path","value","quality","timestamp"
"#TYPES"
"str","L","I","date"
"#ROWS","120"
"Stacker","0","192","2024-08-14 11:00:00.000"
"Dynac","564","192","2024-08-14 11:00:00.000"
"Labeler","561","192","2024-08-14 11:00:00.000"
"Laner","121","192","2024-08-14 11:00:00.000"
"Caser","416","192","2024-08-14 11:00:00.000"
"Stacker","25","192","2024-08-14 12:00:00.000"
"Dynac","0","192","2024-08-14 12:00:00.000"
"Labeler","0","192","2024-08-14 12:00:00.000"
"Laner","0","192","2024-08-14 12:00:00.000"
"Caser","0","192","2024-08-14 12:00:00.000"
"Stacker","0","192","2024-08-14 13:00:00.000"
"Dynac","0","192","2024-08-14 13:00:00.000"
"Labeler","371","192","2024-08-14 13:00:00.000"
"Laner","0","192","2024-08-14 13:00:00.000"
"Caser","0","192","2024-08-14 13:00:00.000"
"Stacker","0","192","2024-08-14 14:00:00.000"
"Dynac","1087","192","2024-08-14 14:00:00.000"
"Labeler","270","192","2024-08-14 14:00:00.000"
"Laner","86","192","2024-08-14 14:00:00.000"
"Caser","1919","192","2024-08-14 14:00:00.000"
"Stacker","160","192","2024-08-14 15:00:00.000"
"Dynac","143","192","2024-08-14 15:00:00.000"
"Labeler","948","192","2024-08-14 15:00:00.000"
"Laner","0","192","2024-08-14 15:00:00.000"
"Caser","1049","192","2024-08-14 15:00:00.000"
"Stacker","1118","192","2024-08-14 16:00:00.000"
"Dynac","0","192","2024-08-14 16:00:00.000"
"Labeler","4","192","2024-08-14 16:00:00.000"
"Laner","212","192","2024-08-14 16:00:00.000"
"Caser","1809","192","2024-08-14 16:00:00.000"
"Stacker","135","192","2024-08-14 17:00:00.000"
"Dynac","0","192","2024-08-14 17:00:00.000"
"Labeler","0","192","2024-08-14 17:00:00.000"
"Laner","3391","192","2024-08-14 17:00:00.000"
"Caser","0","192","2024-08-14 17:00:00.000"
"Stacker","3168","192","2024-08-14 18:00:00.000"
"Dynac","0","192","2024-08-14 18:00:00.000"
"Labeler","0","192","2024-08-14 18:00:00.000"
"Laner","0","192","2024-08-14 18:00:00.000"
"Caser","0","192","2024-08-14 18:00:00.000"
"Stacker","0","192","2024-08-14 19:00:00.000"
"Dynac","0","192","2024-08-14 19:00:00.000"
"Labeler","0","192","2024-08-14 19:00:00.000"
"Laner","0","192","2024-08-14 19:00:00.000"
"Caser","0","192","2024-08-14 19:00:00.000"
"Stacker","673","192","2024-08-14 20:00:00.000"
"Dynac","0","192","2024-08-14 20:00:00.000"
"Labeler","0","192","2024-08-14 20:00:00.000"
"Laner","0","192","2024-08-14 20:00:00.000"
"Caser","9","192","2024-08-14 20:00:00.000"
"Stacker","1194","192","2024-08-14 21:00:00.000"
"Dynac","208","192","2024-08-14 21:00:00.000"
"Labeler","587","192","2024-08-14 21:00:00.000"
"Laner","0","192","2024-08-14 21:00:00.000"
"Caser","985","192","2024-08-14 21:00:00.000"
"Stacker","0","192","2024-08-14 22:00:00.000"
"Dynac","1474","192","2024-08-14 22:00:00.000"
"Labeler","108","192","2024-08-14 22:00:00.000"
"Laner","0","192","2024-08-14 22:00:00.000"
"Caser","1568","192","2024-08-14 22:00:00.000"
"Stacker","0","192","2024-08-14 23:00:00.000"
"Dynac","0","192","2024-08-14 23:00:00.000"
"Labeler","1588","192","2024-08-14 23:00:00.000"
"Laner","0","192","2024-08-14 23:00:00.000"
"Caser","1710","192","2024-08-14 23:00:00.000"
"Stacker","0","192","2024-08-15 00:00:00.000"
"Dynac","2651","192","2024-08-15 00:00:00.000"
"Labeler","1467","192","2024-08-15 00:00:00.000"
"Laner","0","192","2024-08-15 00:00:00.000"
"Caser","0","192","2024-08-15 00:00:00.000"
"Stacker","0","192","2024-08-15 01:00:00.000"
"Dynac","63","192","2024-08-15 01:00:00.000"
"Labeler","374","192","2024-08-15 01:00:00.000"
"Laner","0","192","2024-08-15 01:00:00.000"
"Caser","130","192","2024-08-15 01:00:00.000"
"Stacker","0","192","2024-08-15 02:00:00.000"
"Dynac","110","192","2024-08-15 02:00:00.000"
"Labeler","0","192","2024-08-15 02:00:00.000"
"Laner","0","192","2024-08-15 02:00:00.000"
"Caser","276","192","2024-08-15 02:00:00.000"
"Stacker","0","192","2024-08-15 03:00:00.000"
"Dynac","461","192","2024-08-15 03:00:00.000"
"Labeler","0","192","2024-08-15 03:00:00.000"
"Laner","0","192","2024-08-15 03:00:00.000"
"Caser","777","192","2024-08-15 03:00:00.000"
"Stacker","19","192","2024-08-15 04:00:00.000"
"Dynac","768","192","2024-08-15 04:00:00.000"
"Labeler","615","192","2024-08-15 04:00:00.000"
"Laner","0","192","2024-08-15 04:00:00.000"
"Caser","672","192","2024-08-15 04:00:00.000"
"Stacker","121","192","2024-08-15 05:00:00.000"
"Dynac","103","192","2024-08-15 05:00:00.000"
"Labeler","54","192","2024-08-15 05:00:00.000"
"Laner","0","192","2024-08-15 05:00:00.000"
"Caser","238","192","2024-08-15 05:00:00.000"
"Stacker","239","192","2024-08-15 06:00:00.000"
"Dynac","813","192","2024-08-15 06:00:00.000"
"Labeler","230","192","2024-08-15 06:00:00.000"
"Laner","0","192","2024-08-15 06:00:00.000"
"Caser","362","192","2024-08-15 06:00:00.000"
"Stacker","550","192","2024-08-15 07:00:00.000"
"Dynac","0","192","2024-08-15 07:00:00.000"
"Labeler","0","192","2024-08-15 07:00:00.000"
"Laner","34","192","2024-08-15 07:00:00.000"
"Caser","773","192","2024-08-15 07:00:00.000"
"Stacker","0","192","2024-08-15 08:00:00.000"
"Dynac","598","192","2024-08-15 08:00:00.000"
"Labeler","214","192","2024-08-15 08:00:00.000"
"Laner","37","200","2024-08-15 08:00:00.000"
"Caser","302","192","2024-08-15 08:00:00.000"
"Stacker","553","200","2024-08-15 09:00:00.000"
"Dynac","0","200","2024-08-15 09:00:00.000"
"Labeler","77","200","2024-08-15 09:00:00.000"
"Laner","0","200","2024-08-15 09:00:00.000"
"Caser","1306","200","2024-08-15 09:00:00.000"
"Stacker","0","200","2024-08-15 10:00:00.000"
"Dynac","0","200","2024-08-15 10:00:00.000"
"Labeler","0","200","2024-08-15 10:00:00.000"
"Laner","0","200","2024-08-15 10:00:00.000"
"Caser","0","200","2024-08-15 10:00:00.000"
Sample last8HistoricalData
"#NAMES"
"path","value","quality","timestamp"
"#TYPES"
"str","L","I","date"
"#ROWS","40"
"Stacker","0","192","2024-08-15 03:00:00.000"
"Dynac","461","192","2024-08-15 03:00:00.000"
"Labeler","0","192","2024-08-15 03:00:00.000"
"Laner","0","192","2024-08-15 03:00:00.000"
"Caser","777","192","2024-08-15 03:00:00.000"
"Stacker","19","192","2024-08-15 04:00:00.000"
"Dynac","768","192","2024-08-15 04:00:00.000"
"Labeler","615","192","2024-08-15 04:00:00.000"
"Laner","0","192","2024-08-15 04:00:00.000"
"Caser","672","192","2024-08-15 04:00:00.000"
"Stacker","121","192","2024-08-15 05:00:00.000"
"Dynac","103","192","2024-08-15 05:00:00.000"
"Labeler","54","192","2024-08-15 05:00:00.000"
"Laner","0","192","2024-08-15 05:00:00.000"
"Caser","238","192","2024-08-15 05:00:00.000"
"Stacker","239","192","2024-08-15 06:00:00.000"
"Dynac","813","192","2024-08-15 06:00:00.000"
"Labeler","230","192","2024-08-15 06:00:00.000"
"Laner","0","192","2024-08-15 06:00:00.000"
"Caser","362","192","2024-08-15 06:00:00.000"
"Stacker","550","192","2024-08-15 07:00:00.000"
"Dynac","0","192","2024-08-15 07:00:00.000"
"Labeler","0","192","2024-08-15 07:00:00.000"
"Laner","34","192","2024-08-15 07:00:00.000"
"Caser","773","192","2024-08-15 07:00:00.000"
"Stacker","0","192","2024-08-15 08:00:00.000"
"Dynac","598","192","2024-08-15 08:00:00.000"
"Labeler","214","192","2024-08-15 08:00:00.000"
"Laner","37","200","2024-08-15 08:00:00.000"
"Caser","302","192","2024-08-15 08:00:00.000"
"Stacker","553","200","2024-08-15 09:00:00.000"
"Dynac","0","192","2024-08-15 09:00:00.000"
"Labeler","77","192","2024-08-15 09:00:00.000"
"Laner","0","200","2024-08-15 09:00:00.000"
"Caser","1306","192","2024-08-15 09:00:00.000"
"Stacker","0","200","2024-08-15 10:00:00.000"
"Dynac","251","192","2024-08-15 10:00:00.000"
"Labeler","2268","192","2024-08-15 10:00:00.000"
"Laner","0","200","2024-08-15 10:00:00.000"
"Caser","563","192","2024-08-15 10:00:00.000"
I have corrected why values[0] was null, but thought you would like to have the report either way.