Create query for work item state returning NullPointException
Hi Everyone,
I follow the tutorial https://rsjazz.wordpress.com/2012/11/19/using-expressions-for-automation/ to create a work item state query expression as code snippet below:
-----------------------------------------------
IQueryableAttribute stateGroupAttribute = QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE).findAttribute(projectAreaHandle,IWorkItem.STATE_PROPERTY, auditableCommon, monitor);
Expression openStates = new VariableAttributeExpression(stateGroupAttribute, AttributeOperation.NOT_EQUALS, new StatusVariable(IWorkflowInfo.CLOSED_STATES));
-----------------------------------------------
It works correct to filter out work items in Unresolved state group while I test it in Jetty server. But once I deploy the plugin to WAS server then the server console shows the error below indicating that there is a NullPointException when calling VariableAttributeExpression. Anyone knows how to fix this issue? Thanks a lot.
------------------------------------------------
2018-06-20 10:31:55,670 [ccm: AsynchronousTaskRunner-2 @@ 10:31] ERROR com.ibm.team.repository - CRJAZ0852I An exception occurred while executing the task "Send_Reminder_Letter_taskID", contributed by component "com.ibm.team.repository". The task will be removed from the schedule. <o:p> </o:p> java.lang.NullPointerException <o:p> </o:p> at com.ibm.team.workitem.common.expression.AttributeExpression.getValueType(AttributeExpression.java:186) <o:p> </o:p> at com.ibm.team.workitem.common.expression.AttributeExpression.<init>(AttributeExpression.java:72) <o:p> </o:p> at com.ibm.team.workitem.common.expression.VariableAttributeExpression.<init>(VariableAttributeExpression.java:36) <o:p> </o:p> at com.delta.workitem.asynchronousTask.SendReminderLetter.queryCriteriaGeneral(SendReminderLetter.java:474) <o:p> </o:p> at com.delta.workitem.asynchronousTask.SendReminderLetter.distinctWhichProjectCriteria(SendReminderLetter.java:331) <o:p> </o:p> at com.delta.workitem.asynchronousTask.SendReminderLetter.fetchOwnerFromDelayWorkItems(SendReminderLetter.java:291) <o:p> </o:p> at com.delta.workitem.asynchronousTask.SendReminderLetter.dueWorkitemQuery(SendReminderLetter.java:258) <o:p> </o:p> at com.delta.workitem.asynchronousTask.SendReminderLetter.runTask(SendReminderLetter.java:200) |
2 answers
Ralph Schoon (63.3k●3●36●46)
| answered Jun 20 '18, 1:57 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER https://rsjazz.wordpress.com/2012/11/19/using-expressions-for-automation/ uses client API. Why would that be deployed on an application server?
Comments Hi Ralph,
Do you mean the query expression APIs can only be used in client side? I thought it requires auditable"Common" then it would be possible to run on both serve and client side.
I also notice that this nullpointexception occurs when it tries to find the attribute for query expression through QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE).findAttribute. Is there any server side API can handle this? Thanks for your reply.
In my example there is client API. E.g. I needed at least IQueryClient and to get that IWorkItemClient. I am not sure if this can be achieved in the Server/Common API. I am sorry.
Also, check the include statement for package names that include .client. This is not going to be available in a WAS server. but could be available in Jetty through the client SDK.
Kenery Wang
commented Jun 22 '18, 3:39 a.m.
Hi Ralph, please find my comment on below Answer section because of the character limit of Comment section. |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.