Clearing Custom DataClass from Resource in Workflow

book

Article ID: 171938

calendar_today

Updated On:

Products

Workflow Solution

Issue/Introduction

When creating a custom Workflow that connects to a SMP Resource that has a multi-row data class, letting the process clear the rows, and then attempting to save the resource results in an error.  Essentially, if you fetch a resource having a multi-row data class and you clear all rows from that data class and then try to save the resource, the data classes DataRows member gets set to null, which is not a valid value in the ResourceModelService on the SMP. Instead it should be an empty array. Specifically, the generated ResourceService code for saving a resource was actively checking for empty multi-row data classes and setting them to NULL.

 

 

 

 

##Exception 
Symantec.Workflow.Components.Resource.CreateResourceNS7\\Create Resource for SMP 
\\0941b1dd-ce9f-11e7-b2c3-00505689485f\\System.Reflection.TargetInvocationException 
\\Exception has been thrown by the target of an invocation. 
\\System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: Error saving resource: SoftwarePurchase - 83bb7061-fb7c-4179-aec7-066928a6db3c ---> System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Object reference not set to an instance of an object. 
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) 
at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) 

at Symantec.Workflow.Core.Generators.Smp7ResourceServiceBase.SaveResource[TResourceType](TResourceType resource, List`1 dataClasses, GuidTable guidTable, String nsName, ProxySecurityToken token, Boolean useHttps) 
--- End of inner exception stack trace --- 
at Symantec.Workflow.Core.Generators.Smp7ResourceServiceBase.SaveResource[TResourceType](TResourceType resource, List`1 dataClasses, GuidTable guidTable, String nsName, ProxySecurityToken token, Boolean useHttps) 
at
AltirisOutput7.ResourceService.SaveSoftwarePurchase(SoftwarePurchase softwarePurchase, String nsName, ProxySecurityToken token, Boolean useHttps) 

--- End of inner exception stack trace --- 
at
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) 

at
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) 

at
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 

at
Symantec.Workflow.Components.Resource.CreateResourceNS7.Run(IData data) 

at LogicBase.Core.ExecutionEngine.SinglePathProcessComponentExecutionDelegate.Execute(IData data, IOrchestrationComponent comp, String& outputPath, IExecutionEngine engine, TLExecutionContext context) 
at LogicBase.Core.ExecutionEngine.AbstractExecutionEngine.RunComponent(TLExecutionContext context, IData data, IOrchestrationComponent comp)

Cause

The data classes DataRows member gets set to NULL, which is not a valid value in the ResourceModelService on the SMP.

Environment

Workflow Solution 8.1x

Resolution

This is a defect.  A code change is required to the Symantec.Workflow.Core assembly.  This will be found in the 8.1 Ru7 build.