Code Fix: An exception occurs when executing a List Method on an Advanced SmartObject.

  • 16 February 2021
  • 0 replies
  • 8 views

Badge +9
 

Code Fix: An exception occurs when executing a List Method on an Advanced SmartObject.

KB001368

PRODUCT
K2 blackpearl 4.6 to 4.6.6
BASED ON
K2 blackpearl 4.6
LEGACY/ARCHIVED CONTENT
This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.

 

Introduction

When executing an Advanced SmartObject List Method where a filter is applied on the method, an exception occurs.  This will cause the K2 process instance to go into an error state as soon as the event referencing the SmartObject List Method is reached.

 

 

Error Scenario

  • Open K2 Designer for Visual Studio and select to create a new Empty K2 Project.
  • Add a new item to the project and select SmartObject.
  • Name the SmartObject AD Users.
  • Click on Advanced Mode. See image below.

Image

  • Remove all the SmartObject Methods.  See image below.

Image

  • Click Ok on the warning message.
  • Add a new SmartObject method.  See image below.

Image

  • Name the method GetUsers and add the GetUsers Service Object Method from the Active Directory Service2 ServiceObject Server.  See image below.

Image

  • Select Create All and finish the wizard. See image below.

Image

  • Deploy the SmartObject.
  • Create a K2 process and drag an E-mail event to the design canvas.
  • Add the GetUser List Method from the AD User SmartObject to the Message Body of the E-mail event.
  • Add a Filter as per the image below.

 Image

  • Select the DisplayName return property.
  • Select the Return all results that match filter option.
  • Finish the wizard and deploy the process.
  • Start an instance of the process.
  • The process instance will go into an error state.

 

 

Resolution

This Hotfix is contained within the latest Update. Install the update package to resolve the issue.

Note that for running instances to work after the update, a GoTo Activity function needs to be performed to the activity containing the SmartObject reference.  The process instance will then be able to continue.

New Instances will function as expected.

 

Important Note

When configuring an IsNotNull or IsNull filter on an Advanced SmartObject when executing the GetUser method, some of the properties will not return the correct data as per the filter configured.  This is by design and dependant on the way Active Directory returns the data.  See the table below for results.
Image
 

 


0 replies

Be the first to reply!

Reply