Simple log example

string activityId = Guid.NewGuid().ToString();

var srv = new ApprovedInvoicesServiceClient();
srv.LogCompleteActivity(activityId, new ApprovedInvoicesServiceType() { Amount = 1, ApprovedBy = "xx", ApprovedDate = DateTime.Now, InvoiceId = "1001" });

Update example

string activityId = Guid.NewGuid().ToString();

var srv = new ApprovedInvoicesServiceClient();
srv.BeginActivity(activityId);
srv.UpdateActivity(activityId, new ApprovedInvoicesServiceType() { Amount = 2, ApprovedDate = SqlDateTime.MinValue.Value, InvoiceId = "1001" });
srv.UpdateActivity(activityId, new ApprovedInvoicesServiceType() { Amount = 2, ApprovedBy = "xx", ApprovedDate = DateTime.Now });
srv.EndActivity(activityId);

Continuation example

string activityId = Guid.NewGuid().ToString();
var invoiceId = string.Concat("InvoiceId#", new Random().Next(0, 10000));

var firstSrv = new ApprovedInvoicesServiceClient();
firstSrv.BeginActivity(activityId);
firstSrv.UpdateActivity(activityId, new ApprovedInvoicesServiceType() { Amount = 2, ApprovedDate = SqlDateTime.MinValue.Value, InvoiceId = invoiceId });
firstSrv.EnableContinuation(activityId, invoiceId);
firstSrv.EndActivity(activityId);

var secondSrv = new ApprovedInvoicesServiceClient();
secondSrv.BeginActivity(invoiceId);
secondSrv.UpdateActivity(invoiceId, new ApprovedInvoicesServiceType() { Amount = 2, ApprovedBy = "xx", ApprovedDate = DateTime.Now });
secondSrv.EndActivity(invoiceId);

Data reference example

var activityId = Guid.NewGuid().ToString();

var srv = new ApprovedInvoicesServiceClient();
srv.BeginActivity(activityId);
srv.UpdateActivity(activityId, new ApprovedInvoicesServiceType() { InvoiceId = "1001", Amount = 1, ApprovedBy = "xx", ApprovedDate = DateTime.Now });
srv.AddReference(activityId, "DocumentUrl", "Approved invoice url", "http://ShowInvoices/Invoice/1001");
srv.EndActivity(activityId);

Last edited Jun 1, 2011 at 1:07 PM by RichardHallgren, version 1

Comments

No comments yet.