Call from Code Activity

Overview

If an assembly is registered with Workflow in the ActivityExtensions.dllfile, all of its contained namespaces and types will be available to the Code activity. This means that a .NET library can be directly called by the Code activity just by registering it in the ActivityExtensions.dllfile, even if it does not contain any custom activities.

Advantages
  • This approach does not require any additional coding.
  • Code activities are executed asynchronously and will not block the workflow instance from running activities in parallel branches.
Disadvantages
  • If the library is exposed this way, it can only be used by workflow; it cannot be used by the Display Editor or other applications that leverage the application server.
  • Custom types that are returned by code activities can only use parameters of type Object. This means that other activities cannot bind to the properties of those returned objects. As such, all processing of these custom types is limited to code activities.
  • The workflow debugger does not debug the contents of code activities.