replied on October 24, 2017
Hey,
Figured id throw in my 2 cents as well.
You should be able to achieve the results you are looking for using the SDK script. See below:
namespace WorkflowActivity.Scripting.SDKScript
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using Laserfiche.RepositoryAccess;
using System.Linq;
/// <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()
{
List<object> values = this.WorkflowApi.GetTokenAsMultiValue("Values");
string CountVal = this.WorkflowApi.GetTokenValueFromNameAsString("CountVal",0);
Dictionary<string, int> dictionary = new Dictionary<string, int>();
dictionary.Add(CountVal,0);
foreach (string val in values)
{
if (dictionary.ContainsKey(val))
{
dictionary[val] += 1;
}
else
{
dictionary.Add(val,1);
}
}
this.WorkflowApi.SetTokenValue("Count",dictionary[CountVal]);
// Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session
}
}
}
Using this code is easy. Change ("Values"); to whatever the name of the multivalued token with the values is. Then create 2 new tokens one named "Count" and one named "CountVal". Basically assign "CountVal" the value you want counted and then call the SDK script, the script will count the values and assign the result to the "Count" token.
Just another option for you :)