Function or Method

amador

Member
Hi Guys,

What exactly the structure of BP Code Stage using c#? Can we create a full blown c# class or something similar to Script component in MS SSIS?

A code stage where you can have multiple methods to call like the sample below.

code stage:

Sample1();


static void Sample1()
{
// Input array.
int[] array = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };

// Group elements by IsEven.
var result = array.GroupBy(a => IsEven(a));

// Loop over groups.
foreach (var group in result)
{
// Display key for group.
Console.WriteLine("IsEven = {0}:", group.Key);

// Display values in group.
foreach (var value in group)
{
Console.Write("{0} ", value);
}

// End line.
Console.WriteLine();
}
}

static bool IsEven(int value)
{
return value % 2 == 0;
}


Thanks,

Amador
 

VJR

Well-Known Member
Hi amador,

The code sample you have mentioned seems to be achievable and to get a glimpse of it take a look at the 'Email - POP3/SMTP' Business Object, since it is written in C#. Not in the Code stage , but go to the Initialise tab -> Open the Information stage -> and then 'Global Code' tab where interfaces, classes, functions and even in some Business Objects (MS Excel VBO) APIs are called. The functions can be called from any of the action tabs of the VBO using the Code stage. The full structure of the code implementation either in the Global Code tab or in the Code stage is not known (unless someone goes through the documentation, don't know where it is available) and can only be told after implementing an actual C# feature and when strange kinds of errors start throwing up or BP crashes even after adding the necessary namespace, references, etc as reported by some of our members in this forum.
 
Top