Bonita Windows Server Installation on Tomcat


Installation Steps

  • Install JRE by clicking on the downloaded file.
  • Install JDK by clicking on the downloaded file.
  • Unzip Apache Tomcat file to a folder, use this path as <TOMCAT_HOME>.
  • Unzip Bonita Open Solution Deployment file to a folder. This folder is referenced as <BOS-5.9-DEPLOY> in the installation guides.
  • Follow this instruction:

    1. Skip “Download Tomcat” section.
    2. Skip “Download server files” section.
    3. Configure JAAS authentication and communication” section is not necessary if you are not using custom authentication. Follow this step if changes to JAAS authentication is required, for example, use LDAP for authentication.
    4. Configure BOS Tomcat for other databases” section is not necessary if you are not planning to use different database.
  • Add environment variable:
    1. Follow this instruction to add environment variables:
    2. Value for “JRE_HOME” and “JAVA_HOME” depend on version of JRE and JDK you downloaded. Make sure the value reflect to folder where the installation is.
    3. Add JRE_HOME
      1. key: JRE_HOME
        value: C:\Program Files (x86)\Java\jre7
    4. Add JAVA_HOME
      1. key: JAVA_HOME
        value: C:\Program Files (x86)\Java\jdk1.7.0_13

Startup / Shutdown Tomcat

It’s necessary to startup / shutdown Tomcat in proper way before replacing / modify any file in <TOMCAT_HOME> folder.

To startup Tomcat

  • On command prompt, browse to <TOMCAT_HOME>\bin folder.
  • Run “startup.bat” file.

To shutdown Tomcat

  • On command prompt, browse to <TOMCAT_HOME>\bin folder.
  • Run “shutdown.bat” file.

Running Bonita User Experience


You can install Bonita REST API with the following step:

  • Copy <BOS-5.9-deploy>\bonita_execution_engine\interfaces\REST\with_execution_engine_without_client\bonita-server-rest.war
  • Paste the file into <TOMCAT_HOME>\webapps

Running Bonita REST API

If you need to use an REST client, you must have acknowledgement of the Bonita HTTP API. All HTTP requests will be done using the POST method.

All requests, except checkUserCredentials, checkUserCredentialsWithPasswordHash and getIdentityKeyFromTemporaryToken, will require authentication using HTTP Basic.

To generate your first REST API call, follow this step under “REST client“:

Facebook Login Integration in ASP.NET MVC

  1. Obtain App Id from Facebook site.
  2. Create new ASP.NET MVC 4 Web Application project (with Internet Application template).

  3. Open the _LoginPartial.cshtml file under Views\Shared folder.
  4. Comment out all code and insert the following:
    <div id="fb-root"></div>
        // Load the SDK Asynchronously
            var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
            if (d.getElementById(id)) {return;}
            js = d.createElement('script'); = id; js.async = true;
            js.src = "//";
            ref.parentNode.insertBefore(js, ref);
        // Init the SDK upon load
        window.fbAsyncInit = function() {
                appId      : '<app_id>', // App ID
                channelUrl : '//' + window.location.hostname + '<port>/Home/Channel', // Path to your Channel File
                status     : true, // check login status
                cookie     : true, // enable cookies to allow the server to access the session
                xfbml      : true  // parse XFBML
            // listen for and handle auth.statusChange events
            FB.Event.subscribe('auth.statusChange', function(response) {
                if (response.authResponse) {
                    // user has auth'd your app and is logged into Facebook
                    FB.api('/me', function(me){
                        if ( {
                            document.getElementById('auth-displayname').innerHTML =;
                    document.getElementById('auth-loggedout').style.display = 'none';
                    document.getElementById('auth-loggedin').style.display = 'block';
                } else {
                    // user has not auth'd your app, or is not logged into Facebook
                    document.getElementById('auth-loggedout').style.display = 'block';
                    document.getElementById('auth-loggedin').style.display = 'none';
            // respond to clicks on the login and logout links
            document.getElementById('auth-loginlink').addEventListener('click', function(){
            document.getElementById('auth-logoutlink').addEventListener('click', function(){
    <div id="auth-status">
        <div id="auth-loggedout">
            <a href="#" id="auth-loginlink">Login</a>
        <div id="auth-loggedin" style="display:none">
            Hi, <span id="auth-displayname"></span>
            (<a href="#" id="auth-logoutlink">logout</a>)
  5. Replace <app_id> in above code with your own app id.
  6. Replace <port> in above code with your application’s port.
    You can get application’s port under Project’s properties window. In the screenshot, it’s 6270.

  7. Create new Action in Home controller, name it Channel.
  8. Add the view for Channel action with no layout or master page (uncheck “Use a layout or master page”).
  9. Edit Channel.cshtml to look as following.
    <script type="text/javascript" src="//"></script>

  10. On Facebook Developer App Settings, set the app to interact with Website. Then set the site’s URL to your application full URL.
  11. Compile and run your ASP.NET MVC application.
  12. Login button on the top right corner should take your users to Facebook login page.
Resource and more readings:

Using Wireless Extender (Netgear WiFi Range Extender – WN2000RPT) on AT&T U-verse Router (Windows and Macintosh)

There are tricks in order to use wireless extender on AT&T U-verse router. I am using Netgear Universal WiFi Range Extender (WN2000RPT) for my wireless extender.

Just connecting the extender and complete the extender’s configuration will only give you access to the network, but not the Internet access. This means, you can access the computer within the network, but you can’t access the Internet. This is what I got:

  1. Go to Netgear configuration manager.
  2. Turn off DHCP feature on the extender by going to “IP Address Setup” and use static ip address.
    On “IP Address” field, specify the ip address you want for the extender. Remember this ip address.
    Do note that the “Gateway IP Address” and “Primary DNS” are the ip of your AT&T U-verse router. By default, the AT&T U-verse router’s ip is
  3. Click Apply button to save the setting.
  4. Now, configure your computer’s network setting to point its default gateway and primary dns to the extender’s ip address.
  5. On Windows, open up the network adapter setting.
  6. Display the properties.
  7. Properties on “Internet Protocol Version 4 (TCP/IPv4)” or something similar to that.
  8. Define ip address and dns server address.
    On “IP address”, specify ip address you want for this computer.
    On “Default Gateway” and “Preferred DNS server”, type in the AT&T U-verse router’s ip address. By default, the AT&T U-verse router’s ip is
  9. Go back to network adapter setting to restart the connection (disable and then enable again).

Mac users: you can do the same thing: point your Mac’s network default gateway and dns server address (router) to AT&T U-verse router’s ip address.

To access your network setting, go to System Preferences > Internet & Wireless > Network > Advanced > TCP/IP.

The side effect (not sure if it’s good / bad…) of using this technique is your AT&T U-verse router will assign a ‘dynamic’ ip address for the extender. What I meant by ‘dynamic’ here is, the ip address will constantly change depend on what device is making connection to AT&T U-verse router. So for example, you have specify the extender ip address as in the extender’s configuration manager and you have 2 devices connecting to the extender with ip addresses as and respectively, the extender ip address in AT&T U-verse router will change from, or

Update 4.19.2011: For those who use VMWare Workstation, please read additional post if you have problem connecting the extender to your router: VMWare Workstation and Wireless Network Adapter Problem.

Getting Data Across (Pass Values) Between View, Controller and External Source in ASP.NET MVC 2 and MVC 3

Here’s the list of my post related to getting data across / pass values between View, Controller and external source:

  1. with Query String (No Modification to Route Table)
  2. with Parameters
  3. with System.Web.Mvc.FormCollection
  4. with Domain Model and / or View Model
  5. (MVC 2) with JSON + ViewModel
  6. (MVC 3) with JSON + VIewModel
  7. (MVC 3) with JSON + ViewModel (Multiple Objects)

Convert ASP.NET MVC 2 Project to ASP.NET MVC 3 (Visual Studio)

  1. Remove the following references:
    System.Web.Mvc (v 2.0)
  2. Add the following references:
    System.Web.Mvc (v 3.0)
  3. Here’s my final references:

    If you don’t have any of the above references, you might want to add them.
  4. Add / modify the root Web.config file for the following sections:
            <add key="ClientValidationEnabled" value="true"/>
            <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
            <compilation debug="true" targetFramework="4.0">
                    <add assembly="System.Web.Abstractions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                    <add assembly="System.Web.Helpers, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                    <add assembly="System.Web.Routing, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                    <add assembly="System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                    <add assembly="System.Web.WebPages, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                <add namespace="System.Web.Helpers" />
                <add namespace="System.Web.Mvc" />
                <add namespace="System.Web.Mvc.Ajax" />
                <add namespace="System.Web.Mvc.Html" />
                <add namespace="System.Web.Routing" />
                <add namespace="System.Web.WebPages"/>
  5. Add / modify the view Web.config file for the following sections:
            <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
                <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
            <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <pages pageBaseType="System.Web.Mvc.WebViewPage">
                    <add namespace="System.Web.Mvc" />
                    <add namespace="System.Web.Mvc.Ajax" />
                    <add namespace="System.Web.Mvc.Html" />
                    <add namespace="System.Web.Routing" />

MVC Music Store for ASP.NET MVC 2 (ASPX View Engine)

The ASP.NET MVC website is currently on MVC 3, so the sample applications, specifically MVC Music Store, have also been updated to MVC 3 with Razor view engine.

If you want to download the “ASPX” view engine version of the sample applications, you can do so in CodePlex website. All previous versions are also available.

Here’s the link to MVC Music Store, ASPX view engine version: MVC Music Store v0.8. The cool thing is, you can also download the step by step tutorial for this version in the PDF format.

Easy Start with WCF and Workflow Foundation (WF)

WCF + WF, why not?

  1. Fire up Visual Studio 2010
  2. Create new “WCF Workflow Service Application” project, called it “Development.WcfAndWf”
  3. At the very basic, you already get a WCF service that’s ready to go. This WCF Workflow Service Application is pretty much the same as regular WCF Service Application. If you open ‘web.config’ file, you will the similar tags.
  4. Notice when you run this project (Service1.xamlx), Visual Studio will run its test client as shown below. This test client is the same one you see in WCF Service Application.
  5. Another similarity to regular WCF Service Application is when you run this under your browser (open web.config and press F5). You will also be able to see the WSDL.
  6. Let’s consume this service. Create new “Console Application” project under the same solution. Call this project “Development.Client”.
  7. Now, we need to add Service Reference to our WCF Workflow Service Application. Right click on Reference folder > Add Service Reference.
  8. Click on Discover button. Leave the Namespace as is or give it a nice name.
  9. Open up Program.cs file from “Development.Client” project.
  10. Write the following code:
    namespace Development.Client
        class Program
            static void Main(string[] args)
                var service = new ServiceReference1.ServiceClient();
                var result = service.GetData(12);
  11. Set the project as a startup project.
  12. Run (F5). You should see the following: