locked
Deserialization during cachemetadata RRS feed

  • Question

  • Hi

    Im getting below error when calling cachemetadata on WorflowInspectionServices. What I find wierd is that I have already loaded the xaml using ActivityXamlServices.Load() and created an instance of an Activity. I then call WorkflowInspectionsServices.CacheMetadata(activity) and get this error. Why is deserialization happening in CacheMetaData()?? The exception is thrown randomnly so Im trying to get some more information for troubleshooting.

    Thanks

     Validating the Workflow (CacheMetaData) failed with error: 'Set property 'XXX.ETL.Library.DataFlow.DataTransform.Lookups.LookupTransformPredicate.SourceFieldDefinition' threw an exception.' 
    Stack Trace   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
       at System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(ObjectWriterContext ctx, XamlMember prop, Object value, Boolean onParent)
       at System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(ObjectWriterContext ctx)
       at System.Xaml.XamlObjectWriter.WriteEndObject()
       at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter)
       at System.Activities.XamlIntegration.FuncFactory`1.Evaluate()
      at System.Activities.DynamicActivity.OnInternalCacheMetadata(Boolean createEmptyBindings)
       at System.Activities.Activity.InternalCacheMetadata(Boolean createEmptyBindings, IList`1& validationErrors)
       at System.Activities.ActivityUtilities.ProcessActivity(ChildActivity childActivity, ChildActivity& nextActivity, Stack`1& activitiesRemaining, ActivityCallStack parentChain, IList`1& validationErrors, ProcessActivityTreeOptions options, ProcessActivityCallback callback)
       at System.Activities.ActivityUtilities.ProcessActivityTreeCore(ChildActivity currentActivity, ActivityCallStack parentChain, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
       at System.Activities.ActivityUtilities.CacheRootMetadata(Activity activity, LocationReferenceEnvironment hostEnvironment, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
       at System.Activities.WorkflowInspectionServices.CacheMetadata(Activity rootActivity, LocationReferenceEnvironment hostEnvironment)
       at XXX.ETL.WorkflowEngine.ETLWorkflowRunner.BuildActivityFromXaml(String xaml)
    
     private Activity BuildActivityFromXaml(string xaml)
        {
          Activity workflow = null;
    
          try
          {
            using(StringReader reader = new StringReader(xaml))
            {
              workflow = ActivityXamlServices.Load(reader);
            }
          }
          catch (Exception ex)
          {
            string message = String.Format
              (
                "Creating the workflow from a saved xml file failed with error: '{0}'",
                ex.Message
              );
    
            EventLog.WriteEntry
              (
                String.Format("{0} {1}Stack Trace{2}", message, Environment.NewLine, ex.StackTrace),
                EventLogEntryType.Error
              );
    
            throw new InvalidDataException(message);
          }
    
          try
          {
            WorkflowInspectionServices.CacheMetadata(workflow);
          }
          catch (Exception ex)
          {
            string message = String.Format
              (
                "Validating the workflow (CacheMetaData) failed with error: '{0}'",
                ex.Message
              );
    
            EventLog.WriteEntry
              (
                String.Format("{0} {1}Stack Trace{2}", message, Environment.NewLine, ex.StackTrace),
                EventLogEntryType.Error
              );
    
            throw new ValidationException(message);
          }
    
          return workflow;
        }


    Thursday, December 13, 2012 1:38 PM