Thursday, December 11, 2008

User Defined Functions in XSLT

Hi,

In this post lets learn on the User Defined Functions Option in the Transform activity in Jdeveloper,which lets you use your own function in the transform activity.

There are mainly two steps:

1)Write a class with a static method to implement the logic you want.
2)Register the xml in Jdeveloper,and add the class in Jdev classpath

To illustrate more on it lets take an example of adding two numbers.

1)The first step is to create a class with static method implementing the logic .

Take a example of adding two numbers,with a class called as TestingExtensionFunctions

The static method is as below:

package oracle.testing;
public class TestingExtensionFunctions
{
public static int add(int a,int b)
{
return a+b;
}
}

2)Next,Create an XML file detailing the extension functions which we will give in the JDeveloper "User Defined Extension Functions Config File" field of the XSL Map preferences (Tools->Preferences->XSL Map). This will list the functions in the User Defined Extension Functions section of the XSL Map component palette so you can drag and drop it into the XSLT at design time.

The extension functions XML looks like this :



After adding this xml file make the java class that implements the functions,part of JDeveloper classpath. This can be done by creating a jar file in \jdev\extensions directory.

Create the jar file in the Jdev_home\jdev\extensions directory.
One important thing is to add the extension.xml file to the jar file.
This can be done by Opening the jar file using Winzip,and add the file.
The extension.xml file should be placed in the Meta-inf Folder.

The contents of the extensions.xml file is like the following



Start using the function
If the XSL generated by the XSL Mapper is to be used by the Oracle BPEL engine, please add the jar file to the application server classpath.For OC4J copy the jar file to \j2ee\home\applib.

Happy Learning

Regards
Ashwini





Wednesday, December 10, 2008

BAM - Error

Hi,

BAM Start up page reports a error "You are Unable to connect to services........",when you do any new inatallation on the machien where the BAM is running.
When you go and check for the services,all the services except the Active Data cache services will be running.


when you try to start the ADC services it throws a error like "The Oracle Active Data cache service on Local Computer started and stoppped.some services stop automatically if they have no work to do ....."


The main reason for this is,ADC expects the path of the BAM client to be the first path in the PATH enviromental variable.
for ex: " C:\ORACLE_BAM10g\ClientForBAM\bin;" this should be the first path in the PATH variable.

If any new installation happens on the system,those path gets added to the PATH variable,so the client path no longer remains the first path this is when ADC throws a error.
So after any new installtion,ensure that the client BAM path is the first path in PATH variable.

Happy learning
Regards
Ashwini

BAM - Creating Data Objects

Data Objects(DO) in BAM hold the data which is used in creating dashboards.
Two ways to crete DO are:
1)Manually Create in Architect

2)Create DO From Enterprise Link plan

1)Manually Creating DO in Architect :
1)Login to BAM->click on Architect
2)Select Dataobjects from the dropdown,create dataobject
3)Give the DO a name,location - specify under which folder should the DO be created.
DO should have atleast one field,otherwise the architect ill not let you save the DO
4)Click on Add Field,give it name,set the datatype,set the other values and click on create dataobject.
Once the DO is created,e can also input sample data from the contents option ->Edit content->Add,enter the content and save the value.

Architect follows folder structure to store DO's.The main folder is the DataObjects Folder,under which all the DO's get created by default.We can also create subfolders under DataObjects folder and create DO's inside the subfolder.

2)Create DO From Enterprise Link plan
Enterpreise Link allows us to create dataobjects from the plan.The OracleBAMinsertsink which is used in a plan to insert data,also lets you to create a new DO and then insert values into the created dataobject.

The datobjected created using this option has all the fields sselected in the plan.

Happy Learning
Regards

Ashwini