How add GetExtension() to c# expression in workflow designer RRS feed

  • Question

  • For example if I want to use GetExtension() in 'Assign' activity in workflow designer, I need something like this:

    To:   _myVariable

    Value: new myVariableType(){ServiceProvider = GetExtension<IServiceProvider>()}

    Tuesday, May 28, 2013 7:20 AM


  • As far as I know extensions are added at runtime, and you are talking about design time (are you implementing ActivityDesigner?) you cannot access extensions at design time simply because they don't even exist yet, to add/create an extension you actually need to add it prior to running a workflow (via WorkflowApplication or such).

    However you can write your own "Assign" activity (by means of inheriting from either CodeActivity or NativeActivity) and inside your Execute method retrieve your extension. and your Activity will contains 2 Arguments InArgument<myVariableType> and OutArgument<_myVariable type>

    I hope that helps.


    • Marked as answer by Molly Chen_ Tuesday, June 4, 2013 8:48 AM
    Tuesday, May 28, 2013 4:03 PM