Pages

Sunday, March 29, 2009

In JDeveloper 11g a Task Flow region can exists isolated in your ADF page, but there are ways to interact with this region. For example you can use input parameters like I did in this example or you can pass ADF pagedef events to the region like I did in this example. In this blog I will use queueActionEventInRegion method to start a navigation action in the Task Flow from the mainpage so it goes to the next page fragment and I will use a regionNavigationListener on the region to get the current displayed page fragment of the region so I can use this in the mainpage to disable some buttons. ( Thanks David Giammona for the great region interaction paper ).Here some pics of the example I made. In the mainpage I have two buttons with these buttons I pass a event to the region so it goes to the next pagefragment. When this happens the regionNavigationListener is fired and the new displayed view is passed on the mainpage so I can disable the right button.

The bounded Task Flow I use for this example with two pages and some control flow cases between these two fragmentsHere is the mainpage jsf page code with the regionNavigationListener on the af:region component.

Sunday, March 22, 2009

In my previous blog I already talked about calling BPEL services from OSB. In this blog entry I will show you how to call an synchronous OSB proxy service from BPEL. If you have problems to get this working, please see my previous blog entry how to solve this. I got this working with OSB 10.3 and Soa Suite 10.1.3.4 MLR5.First we need to have an OSB proxy service with an WSDL. As transport protocol we will use the SB protocol Export the WSDL of the OSB Proxy service and put the wsdl and xsd's in your BPEL project.When we take a look at the WSDL we can see that the OSB proxy service address is sb://xxx:70001/w..

In the BPEL project we can add a partnerlink, where we will use the OSB proxy wsdl.

Next step is to add an invoke process activity where we can select the OSB Partnerlink and we have to create an input and output variable here.

You only have to add some assign process activities to fill or retrieve the input and output variable.

Tuesday, March 17, 2009

With OSB 10.3 ( BEA Aqualogic Service Bus ) you can call BPEL services with the ormi or opmn protocol ( just like OESB ). With version 10.3, OSB support the bpel 10.1.3.4 transport. In this blog I will show you how to call the BPEL services from OSB. Calling OSB services from BPEL is also possible but I'll explain this in an other blog entry. I got this working with the MLR5 patch for Soa suite 10.1.3.4.First we have to do some hacking else we can get this error com.evermind.server.rmi.RMIConnectionException: Disconnected: javax.xml.namespace.QName; local class incompatible: stream classdesc serialVersionUIDFirst we have to add a java parameter to the OSB server. Go to domains\osb_domain\bin folder and edit the setDomainEnv file and add this line to this file. set JAVA_PROPERTIES=-Dplatform.home=%WL_HOME% -Dwls.home=%WLS_HOME% -Dweblogic.home=%WLS_HOME% -Dcom.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0Step 2 is to replace the bpel jars in the bpel transport ear. Go folder osb_10.3\lib\transports and open bpel10gtransport.ear and replace the following jar files orabpel.jar, orabpel-common.jar , xmlparserv2.jar and oc4jclient.jar with the ones you can find in the soa suite 10.1.3 home.Now we are ready to call a Synchronous BPEL service from OSB. Here is a overview picture how it works for a Synchronous ServiceFirst we create a proxy service in the OSB where we use the WDSL of the BPEL service.

Create message flow where we call the Business service which uses the BPEL transport.

Create the OSB Business service where we use the input operation of the BPEL wsdl. OSB detects that this is a BPEL wsdl

Select the bpel-10g transport. As endpoint we can choose between opmn or ormi. For ormi we can use this url ormi://localhost:12401/default/BPELProcess_Sync Where 12401 is the rmi port of the OC4J container and BPELProcess_Sync is the name of the BPEL service. Don't use orabpel in the url. You can also use opmn://localhost:6003/home/default/BPELProcess_Sync where 6003 is the opmn port and home is the name of the OC4J container.Because this is the wsdl of a Synchronous BPEL proces we have to choose Synchronous client and select a service account ( this contains the oc4jadmin username / password )

That's all for a Synchronous BPEL service.

For an Asynchronous BPEL we have to do a little more. See this overview picture.Import the wsdl of the Asynchronous BPEL process and use this in a new Proxy Service.

Do the same for a new Business service, this business service is called from the message flow of the just created proxy service.

Select as protocol bpel-10g and use as endpoint opmn://localhost:6003/home/default/BPELProcess_Async.

Now we have to select Asynchronous Client and as callback proxy we have to select a return proxy service and select a service account ( this contains the oc4jadmin username / password )

Now we create a call back proxy service where we select the callback operation of the BPEL service.

Now we have to select SB as protocol

this proxy service calls a business service with the same BPEL wsdl callback operation.

I store the result of the BPEL service in JMS queue

that's all for the Asynchronous BPEL service. For more information see the OSB bpel transport page.

Saturday, March 14, 2009

Here some code which you can use in your backing beans, I use this code all the time. With this you can retrieve the data or actions from the ADF page definition or create new uicomponents with ADF definitions and some JSF methods.

// Get a attribute value of the current row of iteratorDCIteratorBinding iterBind= (DCIteratorBinding)dcBindings.get("testIterator");String attribute = (String)iterBind.getCurrentRow().getAttribute("field1");

Thursday, March 12, 2009

JDeveloper ADF supports the use of resource bundles for the label and tooltip values of an attribute. This attribute can exists in an ADF datacontrol class or an ADF BC object. In this blog I will show you how you can set these values manually or generate these values with ANT.First we will do this manually. In every project you can set the resource bundle option. Default is one resource bundle per project.Now you can open the ADF BC entity or the ADF Datacontrol class xml file and select the attribute and press the edit button. Now you can put in your value for a label or a tooltipIf you already have a resource bundle than you can select a text resource in this resource bundleThis is an example of an ADF datacontrol class file with a label property and a resource bundle definition.We can also generate resource bundles with Ant. Steve Muench already made in 2004 a example how to do this. I changed the example a little bit so it works in 11g.First we have to make a xml with the resource values which matches our attributes of an ADF datacontrol class or an ADF BC object .

Put your xml file with the xslt file and the ant scripts in the root folder of your model project. The xslt file will generate the java resource bundles. Change the build.properties file and set your jdeveloper 11g home. Now we can run the ant scripts. Here you can download the required files.

You can see that label resource has the following name convention attributename_LABEL.Now we only have to add this resource to the ADF datacontrol class xml file. Open the xml and go the structure window and a ResourceBundle element with a JavaResourceBundle child element.That's all.

Sunday, March 8, 2009

Steven and his team released this week a technical preview of JHeadstart 11G. This great add-on for JDeveloper 11G can help you to generate a good looking web application which is based on best practices. This tool is a must have for developers who wants to generate professional ADF 11g web applications. A very good thing about this generator you still can re-use generated Task Flows. If you don't like to generate an application ( really, they exists , I just want to generate everything ,so I can show the customer results and after that I can do cool things ) you can always use this tool for prototyping or for the best practices, this tool is the advanced ADF course, if you understand this you are 11G professional.Here some pics. this is an one page application with lot of regions.An edit form

The overview page with an advanced search page

A generated department Task Flow, you can use this Task Flow for your other applications too

JHeadstart still uses velocity templates and now it has page and task flow templates. A lot of templates.

Here is the code of the generated main page, not much JSF code

The application definition editor, Now you have one defintion where you can add services ( in 10.1.3 you had for every ADF BC am an definition file) and we can define global LOV.

I know that I can learn from this tool and I think you too if you are an ADF developer. So money well spend.

ex Oracle ACE , Java Developer of the year 2009. Co-writer of the OSB Development Cookbook.I am working as a Software Architect and specialized in CI,CD, integration, middleware, security and web development.