Luhur S Nugroho

Windows Workflow Specialist
See also: Other Geeks@INDC

October 2007 - Posts

Synchronous Workflow Thread with ASP.Net
Pada acara 2nd MSDN Day beberapa waktu lalu, dengan topik Windows Workflow Architecture Pak Irving H, menjelaskan betapa susahnya mencari referensi tentang Windows Workflow. Pak Irving menjelaskan bagaimana hosting workflow di ASP.Net (IIS). Disini saya akan menjelaskan juga bagaimana hosting workflow untuk project yang saat ini saya kerjakan.

Seperti yang telah kita ketahui, ASP.Net memberikan response ketika ada request. Padahal secara default workflow dieksekusi dengan cara asychronous, sehingga ada kemungkinan response yang diberikan mendahului eksekusi workflow. Windows Workflow release terbaru (bukan beta) sudah menyediakan service agar eksekusi workflow dijalankan dengan cara synchronous.Service tersebut adalah ManualWorkflowSchedulerService.

ManualWorkflowSchedulerService adalah service workflow yang menyediakan "threading service" sehingga host menyumbangkan thread untuk instance workflow yang dipanggil. Dengan kondisi ini host dapat menjalankan instance suatu workflow dalam satu thread (synchronous), karena service ini akan memblok eksekusi host sampai instance suatu workflow menjadi idle.

Berikut cuplikan code dari global.asax

void Application_Start(object sender, EventArgs e)

{

// Code that runs on application startup

WorkflowRuntime workflowRuntime = new WorkflowRuntime("WorkflowRuntime");

ManualWorkflowSchedulerService scheduleService = new ManualWorkflowSchedulerService(true);

workflowRuntime.AddService(scheduleService);

...

workflowRuntime.StartRuntime();

Application["WorkflowRuntime"] = workflowRuntime;

}

pertama kali membuat container workflow dengan cara instance WorkflowRuntime. Tambahkan service ManualWorkflowSchedulerService kedalam WorkflowRuntime. Setelah itu jalankan runtime dari container workflowruntime. Dan workflowruntime disimpan di state application sehingga bisa dipanggil dari page-page aspx.



void Application_End(object sender, EventArgs e)

{

// Code that runs on application shutdown

WorkflowRuntime workflowRuntime = Application["WorkflowRuntime"] as WorkflowRuntime;

...

// stop workflow runtime

workflowRuntime.StopRuntime();

}

Karena menjalankan workflowruntime pada saat application start, maka pada application stop atau IIS Stop workflow runtime perlu distop sehingga bisa menghemat memori.

Beberapa service-service workflow yang lain tidak saya cantumkan dan jelaskan saat ini, dan akan saya bahas berikutnya.

Share this post: | | | |
Posted: Oct 04 2007, 04:09 AM by luhur | with no comments
Filed under:
Windows FX Developer

postingan sebelum tarawih Smile

Windows FX salah satu teknologi Microsoft yang dirilis bersamaan dengan Windows Vista. Microsoft akan tetap mensupport teknologi ini pada product-product terbaru (Windows Longhorn, sebuah platform untuk "connected systems"). Meski masih baru, Microsoft berkomitment mengembangkan teknologi ini sehingga mencapai maturity dimasa depan (.Net 3.0 > .Net 3.5).

Windows Communication Foundation, Windows Workflow Foundation, Windows Presentation Foundation, Windows CardSpace merupakan paket bundling yang didapat dari Windows FX.

Jika anda tertarik mengembangkan aplikasi bisnis anda dengan Windows FX sebagai backend atau frontend. Kenapa tidak berinvestasi dari awal?

I'm C# developer, "highly passion" to learn and adopt Windows FX technology. I’ve involve some project using Windows Workflow Foundation (role as dev. lead), and  now searching a company which has plan or future roadmap using Windows FX Technology.  Wink

If you have interest to hire me or assist you, you can ask for my detail resume and availability date to : luhur[at]lsnugroho[dot]com

 

 

Share this post: | | | |
Posted: Oct 02 2007, 11:48 AM by luhur | with no comments
Filed under: