Share:

Error message

System.InvalidOperationException: Can not set field "ActivePairing" of BusinessEntityItem "Prologics.EnterpriseServer.DataContracts.DataBase.ProcessExecution.WorkflowItem": Item is not selected 
at Prologics.EnterpriseServer.DataContracts.DataBase.ProcessExecution.WorkflowItem.SetFieldValue(IBusinessEntityItemShared item, IBusinessEntityFieldShared field, Object value) 
at FireStart.WorkflowExecution.ActionHandler.BusinessEntityActionHandler.addOrSetValues(WorkflowItem itemInstance, IBusinessEntityItemShared itemDefinition, List`1 values) 
at FireStart.WorkflowExecution.ActionHandler.BusinessEntityActionHandler.setSingleItem(List`1 itemInstances, IBusinessEntityItemShared itemDefinition, ValueTuple`2 itemValues, WorkflowItem parentItem, Stack`1 temporaryPathItems) 
at FireStart.WorkflowExecution.ActionHandler.BusinessEntityActionHandler.execute() 
at FireStart.WorkflowExecution.ActionHandler.ActionHandler`1.ExecuteAction(Int64 actionId, Int32 retry)

Reason

A business entity can have 0 to n items selected. It's a list, not a single data row. BUT if there is exactly one item in the list, it is possible to write directly to it, without the need to loop over the list. If you try to write to a business entity and get an "Item is not selected" error, that means that there are either 0 items or more than 1 item selected. 

Most of the time that happens if there is a flaw in the data or in the condition of the preceding Select BE Item activity, so you get either no result or multiple results when you expect exactly one data row to match. 

Every business entity has a hidden filed BE_ITEM_COUNT. You could use this field in your workflow to handle this case at runtime accordingly if you think it is a case that should have special consideration.



Previous | Next