Example Workflow Activity

Here’s an example of a method within your application that hosts the embedded workflow engine:

public class Email

{

[WorkflowActivityExecuteAttribute(true, "General", "Send Email", 0)]

[WorkflowActivityExecuteInputParamAttribute("From", "", "string")]

[WorkflowActivityExecuteInputParamAttribute("To", "", "string")]

[WorkflowActivityExecuteInputParamAttribute("Subject", "", "string")]

[WorkflowActivityExecuteInputParamAttribute("Body", "", "string")]

[WorkflowActivityExecuteInputParamAttribute("SMTP Host", "", "string")]

[WorkflowActivityExecuteInputParamAttribute("SMTP Port", "25", "string")]

public WorkflowPropertyCollection SendEmail(object sender, WorkflowActivityExecuteEventArgs e)

{

try

{

SmtpClient SmtpClient = new SmtpClient();

 

MailMessage mail = new MailMessage(e.TaskNode["From"], e.TaskNode["To"]);

mail.Subject = e.TaskNode["Subject"];

mail.Body = e.TaskNode["Body"];

SmtpClient.Host = e.TaskNode["SMTP Host"];

SmtpClient.Port = Int16.Parse(e.TaskNode["SMTP Port"]);

SmtpClient.Send(mail);

}

catch (Exception ex)

{

Helpers.Logger.Error(“EXCEPTION: ” + ex.Message + “: ” + ex.StackTrace);

}

 

return e.Workitem;

}

}

 

You can have as many methods like this in a class as you want. Then all you have to do is call the AddActivities method on the workflow engine instantiation like thi:

oWorkflow.AddActivities(new Email());

You will see this in the web based workflow modeller:


Posted in 1. Leave a Comment »

Design Bits #2

This is a model showing how the workflow engine can call a remote application’s method using .NET remoting:

 

Posted in 1. Leave a Comment »

Design Bits #1

This is how the embedded engine executes your own application’s method:

 

Posted in 1. Leave a Comment »

Welcome to ComponentBlox

For years we have been building solutions for our clients in the customer servicing, banking, mobile phone and online retail domains. What we have found that a lot of these solutions share common set of software components that we have developed.

We’re very excited about ComponentBlox for the following reasons:

  • We want to share with other developers better ways of developing enterprise software systems in Service Orientated Architecture (SOA) approach. We will provide plenty of explanations and examples on how development is accelerated.
  • We have a lot of horizontal and veritical domain components that may reduce your time to market for your applications. Here are some example components we shall be releasing this year, we will provide more details on each of these very soon:
    • Workflow - An embeddable and autonomous workflow engines.
    • Resource – Distribute work (from documents, emails to phone calls) to any resource at any location.
    • Persistence - Create a multi partitioned dynamic relationship object store for your application services. Provides a role based web GUI and a static library scaffolding generator to allow your applications to manipulate objects like Hibernate (object to relational mapper).
    • Report – Extract and aggregate data from multiple sources (databases, webservices etc) and generate web reports.
    • Interaction – An AJAX based toolbar that allows users to be given work such as document, email and phone calls.
    • And a lot more …

Our initial goal, as you can see from the homepage, is to launch the Workflow component. There is a lot of mileage with this alone. We have a couple of domain examples which will show in detail:

  • How you can use this workflow engine to route calls using Asterisk PBX.
  • How to create an IVR flow and debug in live using Asterisk PBX.
  • How you can create a multiuser chat room from scratch.

If you have any questions please go to our forums to ask them. We will be happy to answer any questions/ideas.

Thanks

ComponentBlox Development Team


 

Follow

Get every new post delivered to your Inbox.