Wednesday, January 21, 2009

Wiring it all together: Webtop, SSL, Tomcat, IIS and ISAPI

Webtop or any of its derivatives can be locked down using SSL. SSL can be enforced at the application level where Webtop is running(eg- tomcat) or have a forward proxy enforce the SSL(Eg - IIS).

This post will walk through

1. Setting up Webtop on SSL using tomcat
2. Bridging IIS and Tomcat(non SSL) using ISAPI connector
3. Setting up SSL on IIS and accessing Webtop on tomcat through ISAPI connector


Setting up Webtop on SSL using tomcat
1. If you have JDK 1.5 or higher go to the JDK bin dir and execute
keytool -genkey -alias webtopcert -keypass webtopcert -keystore webtopcert.bin -storepass webtopcert

2. The keyTool will ask you a bunch of questions, the only thing that is important here is to make sure you give the host name of the tomcat machine when it asks for your first and last name.

3. Copy the certificate generated(in our case webtopcert.bin) to any directory of your choice, better if you put in in a directory inside tomcal installation.

4. open up server.xml from %Tomcat%/conf and uncomment the tag that starts with Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true".

5. Add the follwong attributes to the tag.
keystoreFile="C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\webtopcert.bin"
keystorePass="wdkapps"

6. A little tweak is needed to get UCF to play well with SSL. In the ucf.installer.config.xml file in the appserver add the following XML snippet.(C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\webtop\wdk\contentXfer)
<option name="https.host.validation" persistent="false">
<value>false</value>
</option>

This will make sure that for new clients this ucf option is set in the downloaded ucf.client.config.xml file. You could also manually add this option to the downloaded cleint config file in ucf under C:\Documents and Settings\username\Documentum\ucf\hostname\shared\config

try https://hostname:8443/webtop

Bridging IIS and Tomcat(non SSL) using ISAPI connector

The tomcat instruction on how to bridge IIS and tomcat is pretty comprhensive.

http://tomcat.apache.org/connectors-doc/webserver_howto/iis.html

Start with a simple workers.properties and uriworkermap.properties blow is a sample that I used.

workers.properties

worker.list=worker1

worker.worker1.host=10.241.209.30 <-- this is the host where tomcat is running worker.worker1.port=8009 <-- make sure the port 8009 is open on the tomcat m/c worker.worker1.lbfactor=3.5 worker.worker1.cachesize=10 worker.worker1.cache_timeout=600 worker.worker1.socket_keepalive=1 worker.worker1.socket_timeout=300

uriworkermap.properties

/examples/*=worker1
/examples/*.jsp=worker1
/examples/servlet/*=worker1
#This will forward every request to tomcat, so /webtop should also get forwarded to tomcat
/*=worker1

try http://hostname/webtop

Setting up SSL on IIS and accessing Webtop on tomcat through ISAPI connector


In this scenario tomcat where webtop is installed is not in SSL mode. IIS can be set up in SSL mode(link below) and bridged to tomcat through ISAPI as per the instructions above. Here is a very detailed tutorial how you can set up IIS in SSL mode using a self signed certificate.

http://www.xenocafe.com/tutorials/self_signed_cert_IIS/self_signed_cert_IIS-part1.php

try https://hostname/webtop

Tuesday, January 13, 2009

HTTP Inbound Initate Activty and Debugging a Process

In this post I will explore the new debug feature in process builder 6.5 and also the HTTP inbound Initiate activity template. I will add to the workflow that was developed in the previous posts

HTTP Inbound Activity
HTTP Inbound activity is part of BPS or Process integrator product from Documentum. They basically let the outside world(outside of Documentum enterprise space) to send and receive messages to Documentum enterprise application through Documentum Process. Thre are 2 mail components for BPS outbound and inbound. outbound will send messages out and inbound will listen for messages. The messages can come/go in different formats/protocols like HTTP, JMS and Web Services. Here we will look a how we can send a http message to a Documentum process. To keep it simple w will not extract any content from the http message we are going to send, although a normal application will do that.

Adding HTTP Inbound Initiate activity
1. Open the workflow built in the last couple of post and uninstall it
2. In the 'Activity Templates' side bar open up the 'Integration' folder. The 'Integration' folder contains all the activities that belong to BPS/Process Integrator that deals wil Inbound and Outbound messaging for various protocols.
3. select the activity called 'HTTP Inbound Initate' and drag it to the work area. Since this is an initiate step it can be the start step of the workflow.
4. Connect the connector so that it flows from HTTP inbound Initiate activity to the first user activity 'Activity-1'
5. Open up the Activity Inspector for the HTTP inbound Initiate activity and go to the 'HTTP' tab and fill in the 'URLSuffix' box with 'BPMPost', without the quotes. Also set the 'Request Type' combo box to 'Post'.

6. Save, validate and install
Debugging Process flow

7. Goto File->Preferences and take a not of the 'HTTP/WebService Inbound port number', the default is 13,000.
8. Create a html file like the one shown in the image. Note that the port number from the preference and the URLSuffix from the Activity Inspector is used in creating the URL to which the form is submitted.

9. Go ahead and hit the debug button on the tool bar.
10. In the dialog that opens select the radio button that says 'Start workflow using the Inbound Initiate Listener' and hit the button 'Start listeners'
11. Open the HTML file that was created in the step 8 and hit the submit button.
12. You will get a response saying 'HTTP request processed success'
13. The debugger will step through your activities and wait on the 'Activity-2', if the workflow was exactly created as this and previous posts directed.
14. The debugger is stopped at this point because there is an exception path defined for this flow. In the debugging console that opens up below the process work area you can see 2 boxes which list 'Forward Activities and 'Reject activities'. Select the forward activity and buttons will show up below that. Hit the 'Finish' button.
15. The debugger will continue executing the rest of the process and completes successfully.
16. Clicking on the console tab will show the debug log.
17. For the automatic activity to be executed successfully during debug, make sure the class file is copies to C:\Program Files\Documentum\bpm\classes\custom. This is where the debugger loads workflow method classes from.

Documentum Workflow for dummies -II ( Automatic activities)

Lets look at how we can add an automatic activity to the workflow we created in the previous blog post.

Creating a workflow method for automatic activity
1. Here is a template workflow method. Create one like this using your IDE and compile it


2. drop the compiled class in C:\Documentum\dba\java_methods, including the package structure if any.
3. open up Documentum Administrator and go to Job management->Methods
4. Select menu File->new and create a new method object. The properties page of the newly created method should look like this

5. log out of DA and open up a IAPI command window and login to the docbase through iapi
6. type

retrieve,c,dm_method where object_name='SampleAutomaticActivity'

7. this will retrieve the object id of the method object we just created.
8. type

dump,c,l

9. This will dump the method object. if you look at the object dump the attribute a_special_app will not have a value assigned.
10. Assign the a_special_app attribhute the value 'Workflow' without the quotes. Type the follwoing line to do that.

set,c,l,a_special_app
SET>Workflow

11. save the property change. Now the workflow method is ready to be attached to an automatic activity

save,c,l

Creating automatic activity in the process
1. open up the workflow/process created in the previous blog in process builder.
2. uninstall the process/workflow.
3. click on 'create automatic activity' icon on the top toolbar(its the one with the image of a gear wheel)
4. Click anywhere in the workspace. An automatic activity instance will be palce where you clicked.
5. go back to the 'selct objects' mode by clicking the mouse pointer icon on the toolbar.
6. Drag and place the automatic activity between manual activities activity-2 and activity-3(or anywhere you choose between initiate and end)
7. re-connect the connectors so that the process now flows through the automatic activity.
8. Open up the automatic activity's activity inspector and go to performer tag
9. Drop down the combo box named 'Executed this method automatically'.
10. Select the method created above. it should show up in this list otherwise dump the method object(dm_method) you created and check the value of a_special_app property. It should be 'Workflow' without the quotes. Only methods with a_special_app value set to Workflow will show up in this list.
11. save, validate and install the workflow. The workflow will look similar to this

12. Executing the workflow now will execute the automatic activity, try running it from webtop. To see this working in the process builder we can use the debug feature of the 6.5 process builder. Will explain how to use the debug feature in antoher blog.