Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

SP 2013: Workflow in Visual Studio 2012 - Context is null

$
0
0

Hi.

I have created a custom state machine workflow in VS2013 for SP2013 on-premises environment. Alongwith the workflow, we also have a custom activity for Copying certain data. However, I am unable to get the context in my custom activity.
I have created the dependent properties in the custom activity. That looks like:

  public static DependencyProperty __ContextProperty = DependencyProperty.Register("__Context",                                                                                       typeof(WorkflowContext),                                                                                       typeof(CopyActivity));

[Description("Context")]
        [ValidationOption(ValidationOption.Required)]
        [Browsable(true)]        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        public WorkflowContext __Context
        {
            get { return ((WorkflowContext)(base.GetValue(__ContextProperty))); }
            set { base.SetValue(__ContextProperty, value); }
        }

I have tried this link as well : http://blogs.technet.com/b/sharepointdevelopersupport/archive/2012/09/25/how-to-programmatically-set-pass-workflowcontext-from-a-visual-studio-workflow-to-a-custom-workflow-action-in-sharepoint-2010.aspx but no luck.

I am missing a way to pass the context from Workflow to custom Activity. Appreciate any help.






Priyanka http://priyankaps.blogspot.com/


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>