Hi
1. On the k2 for visual studio canvas add the following web reference - from project references- http://services.aonaware.com/DictService/DictService.asmx: notice that services.aonaware.com will be added as a reference.
2. Add two datafields: Word and Meaning
3. add a server event and below it a mail event and set a destination user for the activity.
4. rightclick the server to view code then paste the folloing in the main: - dont forget the using services.aonaware.com in the declaration section -
--------
try
{
WordDefinition wrddef = new WordDefinition();
DictService dictService = new DictService();
wrddef = dictService.Define(K2.ProcessInstance.DataFields[
"Word"].Value.ToString());K2.ProcessInstance.DataFields[
"Meaning"].Value = wrddef.Definitions[0].WordDefinition;}
catch (Exception ex)
{
K2.ProcessInstance.DataFields["Meaning"].Value = ex.Message;
String LogName = "Malibu";
if (!EventLog.SourceExists(LogName))
{
EventLog.CreateEventSource(LogName, LogName);
}
EventLog Log = new EventLog();
Log.Source = LogName;
Log.WriteEntry( ex.Message, EventLogEntryType.Error);
}
---------
5. In the email event put the WORD:MEANING pair datafields
6.Build and deploy the process.
7.From the k2workspce make sure the server rights and the process rights are enabled for the logged in user and the deployed process.
8. Click the instances tree child then click "start new" from the menu.
9. the following error appears
"Could not load file or assembly 'services.aonaware.com, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."