I'd like to pitch in what I ended up doing. Keep in mind that I'm a total newbie in C# and SDK completely, but knew what I wanted to accomplish so I flirted a little with the SDK Script Activity.
The result was a simple code that transforms the 0s in NOs and the 1s in YESses. I wanted to keep the logic in one place, but using the Assign Token Activity had made me add 8 conditional branches, each one with an Assign Token Activity and I thought it was a little too much to maintain.
I digged a little into the SKD Script Activity just to get me what I needed and send out the email. Below is an example. Where I struggled the most was in finding how to assign the Business Process Variable inside the script because I couldn't find a straight answer in any of the LF posts. Once I found how to get them, the rest was just like any other language. I'm posting this for the totally SDK newbie like myself. Hope it helps someone.
namespace WorkflowActivity.Scripting.SDKScriptEmail
{
using System;
using System.Web;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using Laserfiche.RepositoryAccess;
using System.Net.Mail;
using Laserfiche;
/// <summary>
/// Provides one or more methods that can be run when the workflow scripting activity is performed.
/// </summary>
public class Script1 : RAScriptClass100
{
/// <summary>
/// This method is run when the activity is performed.
/// </summary>
protected override void Execute()
{
// Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session
//'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
string QExport = GetTokenValue("QueryDatatblDataClassification_hasExportControlledItems").ToString();
int QExportInt = Convert.ToInt32(QExport);
if (QExportInt == 0) {
QExport = "No";
}
else
{
QExport = "Yes";
}
// Command line argument must the the SMTP host.
SmtpClient client = new SmtpClient();
client.Port = 25;
client.Host = "smtp.yourdomain.com";
//client.EnableSsl = true;
client.Timeout = 10000;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential("from_email@yourdomain.com","");
MailMessage mm = new MailMessage("from_email@yourdomain.com", "to_email@yourdomain.com", "Submect", "message");
mm.BodyEncoding = UTF8Encoding.UTF8;
mm.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
mm.IsBodyHtml = true;
client.Send(mm);
}
}
}