-
Notifications
You must be signed in to change notification settings - Fork 0
Define Batch
ivano scifoni edited this page Jan 25, 2018
·
4 revisions
SharpBatch identify a clas as a batch on 3 mode:
- Using POCO : Class name who end with Batch is managed as a Batch class
public class Class1Batch
{
public string Class1Method1()
{
return "Class1Method1";
}
private string Class1Method2()
{
return "Class1Method2";
}
public int Class1Method3(string parameter1)
{
return 13;
}
}- Using Batch attribute : Class decorated with [Batch] attribute is managed as a Batch class
[Batch()]
public class AttributeTest
{
[BatchAction()]
public string go()
{
return "Started";
}
}- Deriving from a Batch class : Class who derives from a Batch is managed as a Batch class
public class Class2Batch : Class1Batch
{
public string Class2Method1()
{
return "Class2Method1";
}
private string Class2Method2()
{
return "Class2Method2";
}
public int Class2Method3(string parameter1)
{
return 213;
}
}If a Batch method is a long running operation, you can configure the method as Async. SharpBatch in this case when execute method reply to the caller with "ok" and specifies the sessionId of Batch execution. All the informations about Batch execution are tracked on Tracking system configured.