Tuesday, November 4, 2008

Create BPEL Domains Programatically

To give you some background here, we have more BPEL instances than Carter has pills. Last time I counted, we're up to about 24 Production, and 28 Non-Production instances. I created a BIG batch file to perform all of our post-installation steps on these instances, including patching to a standard patch level, creating the standard set of domains, configuring logging parameters, configuring startup parameters, creating resource adapters and database connections, and some other fancy stuff.

Below I've posted my batch file for creating BPEL domains from the command-line. You'll need:

cURL (Command-line URL) - You can get that here
Your oc4jadmin password
The domain name you want to create
The hostname where BPEL is installed
The web port where the BPELConsole application is listening

Tweak the batch file to point to the location where curl.exe resides.

ECHO Off
SET DomainName=%1
SET HostName=%2
SET HostPort=%3
SET OC4JPassword=%4
SET CurlLoginLine=
SET CurlLoginLine="j_username=oc4jadmin&j_password=%OC4JPassword%" http://%HostName%:%HostPort%/BPELAdmin/j_security_check
SET CurlConfigLine=
SET CurlConfigLine="domainId=%DomainName%&datasourceJNDI=jdbc/BPELServerDataSourceWorkflow&txDatasourceJNDI=jdbc/BPELServerDataSource" http://%HostName%:%HostPort%/BPELAdmin/doCreateDomain.jsp
call curl.exe --trace-ascii c:\curltrace.txt -d %CurlLoginLine% -b cookie.txt -c cookie.txt
call curl.exe --trace-ascii c:\curltrace.txt -d %CurlLoginLine% -b cookie.txt -c cookie.txt
call curl.exe --trace-ascii c:\curltrace.txt -d %CurlConfigLine% -b cookie.txt -c cookie.txt

And, yes, the 2nd and 3rd from the last lines are identical. This isn't a typo. If you've dealt with 10.1.3.3 for more than 8 minutes, you'll have noted by now that you're forced to log in twice to the BPEL Console and EM Applications.

Make sure BPEL is up, and call the batch file.

Provide the requested information in this order:

  1. The domain name you want to create
  2. The hostname where BPEL is installed
  3. The web port where the BPELConsole application is listening
  4. Your oc4jadmin password
That should do it. Good luck. See the disclaimer.

No comments: