Support Article
Click action shows Empty Work Item Handle message at first run
SA-67786
Summary
On click of a menu item, the work item does not open and an error message displays. However, from the second run, the work item opens correctly.
Error Messages
Empty WorkItem handle
Steps to Reproduce
- Create a Menu Item.
- Configure Action 1 to RunActivity (set the handle of the work item to a property, Prop1).
- Configure Action 2 to OpenWorkByHandle and refer .Prop1 as InsHandle.
- At runtime, click the Menu Item
Root Cause
The Change tracker' enabled actions are not supported on menus, as on other controls such as buttons. Menus resolve property references in actions while rendering and stamps them directly in the action JSON. Hence, if the property value changes in any of the menu actions, then its value is not propagated to subsequent actions in the action set.
For example,
Consider an action set with two actions configured.
Action 1 a Run Activity which sets a value to the .myworkhandle property.
Action 2 is the Open work by handle with .myworkhandle as property reference.
The initial value of the .myworkhandle property is empty.
The action JSON stamped on the menu has value of the .myworkhandle property, which is empty, for the Open work by handle action.
During a click, the Run Activity is called first. The .myworkhandle value is changed but not communicated to the client. The Open work by handle action is called, but it has an empty value for the work item handle. Hence the Empty Work Item Handle message displays.
The next time when the menu is opened, .myworkhandle already has a value that is set by the previous click. Therefore, the action JSON has a new value and the work item opens correctly.
Resolution
An enhancement request, FDBK-28765, is created for consideration by Pega Product Management.
Published January 18, 2019 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.