AgileExtender Framework |
Deployment Time behavior is useful when you want to perform a custom action during process deployment to AgilePoint Server. Deployment Time behavior runs on AgilePoint Server when process templates are created, checked in, checked out, released, or deleted.
using System; using System.IO; using System.Xml; using System.ComponentModel; using System.Drawing.Design; using Ascentn.Workflow.Base; using System.Xml.Serialization; namespace Ascentn.AgileExtender.Sample { public partial class MyAgileExtenderDescriptor { #region [ Constructor ] public MyAgileExtenderDescriptor(bool designTime) : base(designTime) { if (!base.DesignTime) { this.CreateProcessDefinition += new EventHandler<WFCreateProcessDefinitionArgs> (OnCreateProcessDefnition); this.CheckoutProcessDefinition += new EventHandler<WFCheckoutProcessDefinitionArgs> (OnCheckoutProcessDefinition); this.DeleteProcessDefinition += new EventHandler<WFDeleteProcessDefinitionArgs> (OnDeleteProcessDefinition); //Add the necessary event handlers } } #endregion #region [ Event Handlers ] private void OnDeleteProcessDefinition(object sender, WFDeleteProcessDefinitionArgs e) { Logger.WriteLine ("MyAgileExtenderDescriptor.OnDeleteProcessDefinition, {0}", base.ComponentTypeID); } private void OnCreateProcessDefnition(object sender, WFCreateProcessDefinitionArgs e) { Logger.WriteLine ("MyAgileExtenderDescriptor.OnCreateProcessDefnition, {0}", base.ComponentTypeID); } private void OnCheckoutProcessDefinition(object sender, WFCheckoutProcessDefinitionArgs e) { Logger.WriteLine ("MyAgileExtenderDescriptor.OnCheckoutProcessDefinition, {0}", base.ComponentTypeID); } #endregion } }
The user can get IWFAPI & IWFAdm object from the event args. These objects can then be further used to interact with AgilePoint Server. For deployment time behavior, create a delegate for the deployment events in the constructor, and add code in event handlers to handle the events in a customized way. The following events can be customized according to user requirements: