using System;
using System.Collections.Generic;
using System.Text;
using Skelta.Core;
using Skelta.HWS.WorkListChannel;
using Skelta.HWS;
using Workflow.NET;
using System.Net.Mail;
using System.Xml;
namespace My.Net.Workflow
{
public class SimpleWorkItemForm : WorkItemFormBase, ISkeltaAddInProvider
{
//Must Override: ReadDefinitionXml, FormConfigurationUserInterfaceURL, Name, FormType, SupportedTechnologyTypes, Clone.
//Methods which does not have any default implementation are: OnWorkItemCreation, OnWorkItemTransaction, OnFormIgnoredForWorkItem, InitialFormUri, InitialFormState
//840a3aea-cb71-4d61-b603-e5f6c3fd6b76 Form SimpleWorkForm My.Net.Workflow.SimpleWorkItemForm bin\My.Net.Workflow.dll
private Guid _id;
private string _settings;
private string _name;
private Log log = new Log();
///
/// The key that is used in the database to look up this instance
///
public override string FormType
{
get
{
return "SimpleWorkForm";
}
}
///
/// The link between the channel and the form. The forms that support
/// this technology will be loaded for the channel of this type.
///
public override string[] SupportedTechnologyTypes
{
get
{
return new string[] { "SimpleWork" };
}
}
///
/// Provides a configuration screen for this form
///
public override string FormConfigurationUserInterfaceURL
{
get
{
return "";
}
}
///
/// Store the name of this instance of the form
///
public override string Name
{
get { return _name; }
set { _name = value; }
}
///
/// Create a copy of this Form to use for the instance of the workflow
///
///
public override IWorkItemForm Clone()
{
log.LogInformation("^^^^^^^^^ Cloning the New Simple Form ^^^^^^^^^^");
SimpleWorkItemForm form = (SimpleWorkItemForm)this.MemberwiseClone();
if (this.Roles != null && this.Roles.Length > 0)
form.Roles = new List(this.Roles).ToArray();
if (this.Actors != null && this.Actors.Length > 0)
form.Actors = new List(this.Actors).ToArray();
form._RunTimeProperties = new Dictionary();
foreach (string key in this._RunTimeProperties.Keys)
{
form._RunTimeProperties.Add(key, this._RunTimeProperties[key]);
}
return form;
}
///
/// Called to handle any settings that are passed in from the Actions.xml file
///
///
public override void ReadDefinitionXml(XmlTextReader reader)
{
//Do nothing yet
}
///
/// Called when a workItem gets assigned to this channel. Responsible for doing
/// all the work to handle this workItem.
///
///
public override void OnWorkItemCreation(WorkItem mailWorkItem)
{
log.LogInformation("^^^^^^^^^ Calling Create in the New Simple Form ^^^^^^^^^^");
}
#region ISkeltaAddInProvider Members
Guid ISkeltaAddInProvider.Id
{
get { return _id; }
}
void ISkeltaAddInProvider.InitializeProvider(string settings, Guid id)
{
_settings = settings;
_id = id;
}
string ISkeltaAddInProvider.Settings
{
get { return _settings; }
}
#endregion
}
}