Step 5: Code Generation Options

The ClosedCode Generation Options step of the Activity Proxy Generator allows you to specify the Namespace and Class Name for your custom activity proxy. You can also select from several options to generate additional code for the activity proxy to handle special cases.

  • Namespace: You can specify a different namespace for your activity proxy if you do not want to use the same namespace as your runtime activity.
  • Class Name: You can specify a different class name for your activity proxy if you do not want to use the default class name.
  • Notify the activity proxy when any property on _____ changes: Creates an event handler in your activity proxy that handles one of two events, depending on the selection made with the drop-down menu:
    • any activity: The event handler will be called if any property on any activity in the Workflow changes. Use this if you need to update your custom activity based on the behavior of other activities.
    • the parent activity: The event handler will be called only when any property of the parent activity changes. The parent activity is the composite activity the custom activity is in or the Workflow itself if your custom activity is not inside a composite activity.
  • Notify the activity proxy when an activity is added, removed, or moved: Generates the event handlers OnActivityAdded, OnActivityMoved, OnActivityRemoved, OnActivityCopied, and OnActivityUpdated in your activity proxy’s code. These handlers are called when any activity is added to, moved in, deleted from, or copied into the workflow containing your custom activity. OnActivityUpdated is called whenever any property for any activity is changed and when a composite activity is expanded or collapsed.
  • Have the activity proxy provide tokens that are determined at design-time: This option allows you to indicate that one of your activity's properties provides a list of tokens. The list of tokens provided is specific to how the property is configured, unlike most token-providing properties which only provide a single token.
  • Example: The Retrieve Field Values activity's Fields property provides a token for each field that is retrieved. The fields are selected when the activity is configured so the tokens are not determined until design-time.

    Note: You can customize the list of tokens by modifying the activity proxy’s GetActivityTokens method.

    • The user will be allowed to rename these tokens: If your design-time tokens can be renamed, selecting this option generates code in your activity proxy to support that behavior. More specifically, if you rename a design-time token that is being used in another activity, the token (in the other activity) will be updated appropriately.
    • Note: The selected property's type must be derived from the type System.Collections.Generic.IEnumerable<Laserfiche.Custom.Activities.Design.TokenDefinitionBase>.

    • The property that provides these tokens is: This option specifies which property will provide the list of design-time tokens.
    • Note: Only properties whose type implements the System.Collections.Generic.IEnumerable<T> or System.Collections.ICollection interfaces will be available for this option.

    • These tokens can use other activities’ tokens in their values: Selecting this option generates code in your activity proxy to support using other activities' tokens to specify the value of your design-time tokens. If a referenced token is renamed (or its activity is renamed), the design-time token's value will be updated appropriately.
    • Note: Selecting this option may cause compile errors in your activity proxy code (depending on the selected property’s type).

After configuring your code generation options, click Next to continue to Step 6: Generated Code.