Saturday, 7 September 2013

HOW TO EMBED A SPRING COMPONENT IN SOA BPEL SERVICES.


The Spring component makes it possible to embed Java code as a Service Component Architecture (SCA) first-class citizen through the Spring component implementation type. Thereby the coarse-grained components of Oracle SOA Suite (such as BPEL, Mediator) can be extended by much-finer-grained Spring beans wrapped inside the Spring component.

This tutorial explains in short how to embed a spring component with SOA BPEL.

Follow the steps below sequentially

STEP 1 : Go to Jdeveloper Home Page -> Select File -> New-> Generic Project --> Click OK

STEP 2 : Provide Project Name -> Select Soa Services as shown below :





STEP 3 :  Click Next -> Select Composite With Bpel Process --> Click Finish

STEP 4 :  Select Type of Bpel you want to choose finally Click OK.Your Bpel will come as shown below.



Step 5 : On right hand side Go To Services Component Palette-> Select Spring Component --> Place it on components palette.Then Below screen will apppear .Put name and click OK.


STEP 6 : Now we need to create a java class.Go To File -> New -> All Technolgies Tab-->Select Option Java --> On right side Select Java class and click OK.The below screen appears provide details as you wish and Click OK.



STEP 7 :  On this an option will come select first one and click OK.

STEP 8 : Now a java class is created under a package.We need to write some code to make it work.

STEP 9 : Write the below snipet of code in java class section :

package com.test1;

public class mytest {
    public mytest() {
        super();
    }
    public String read(String input) {
        return "hello" + input;
    }
}

STEP 10 : Next we need to create a java interface.Click File-> New->All Technologies->Java->Select Java Interface-> Click OK.

STEP 11 : The below snippet will come.Put details as shown below and click OK.




 STEP 12 : Just Write the below lines of code and click OK.

package com.test1;

public interface Interfacetest {
    public String read(String input);
}

STEP 13 :  Go back to composite.xml. Double click on spring component.Write below lines of code .This will actuaally map bpel with java class via spring.

<!--Spring Bean definitions go here-->
    <bean class="com.test1.Interfacetest" id="impl" />
  <sca:service name="test" target="impl" type="com.test1.Interfacetest"/>
</beans>

STEP 14 : After that you will be asked to generate wsdl if you a question mark tab will come : Click OK.

STEP 15.Again you will be prompted to ask another question click OK.

STEP 16 : Your spring is ready.It will look like this :




 STEP 17 : Now double click on Bpel component.Drag an invoke activity and and an assign activity ,map invoke with spring component and you complete bpel looks like this :










STEP 18 : Double click on assign activity,map source input with spring input as shown below :



STEP 18. Our code is ready.Compile test ,deploy your services on weblogic server.

Please feel free to add your comments/queries.suggestions on any posts.


Happy Coding............

Friday, 6 September 2013

SCAC-50012 ERROR WHILE COMPILING BPEL CODE

We  would very ocassionally encounter this error while compiling our BPEL code.

This happens majorily because of the below artificats.Check these steps one by one :

STEP 1: Go to Bpel code.Delete all items from SCA-INF folder

STEP 2 : Check composite.xml file and see if all wire are connected  or not.

STEP 3 : Close JDeveloper and reopen.This happens rarely.

Major Imp Step:

If you are using java embedding code in your bpel code then this error occurs very frequently.Bpel does not have compiler to check java code so for a simple one charecter error it will throw this exception

So compile line by line and check.Wherever you find this error its in that statement only.



Happy programming.Love to hear comments from you people.

HOW TO CONFIGURE JAVA JDK AND WEB LOGIC SCRIPTING TOOL ON WINDOWS MACHINE


First Of All one has to set the enviorment varibles.

So for that follow the steps below(sequentially) :

1> Go to My Computer -> Right Click  ---> Properties (for windows 7 machine)

2>Go To Advanced System Settings

3>There select Advanced tab at top -> then Enviorment variables button

4>There you will find two white boxes.Navigate to the bottom box

5> Select Path option among variables and double click on it.

6> Dont change the variable name .In bottom box  ie Variable value field :go at the end  of text section and give ; and then give java/jdk path in your machine like i gave : C:\soa\Oracle\Middleware\jdk160_29\bin.

7> Click OK then again OK and come out of it.

8> Your java is set now.

Now follow sequence of steps to start WLST in windows machine :

1> Go to your bin folder of your weblogic server domain like I have through command prompt :

C:\soa\Oracle\Middleware\user_projects\domains\base_domain\bin

2> Then type the below commands :

setDomainEnv.cmd

3> After that :  java weblogic.WLST

4> Now your script tool is ready to run .

5> Type help() if you want to learn any commands in offline mode

6> Type help('help') in command prompt for more details.

7> To connect to weblogic server/ online mode  type :  connect() and get out provide :

    disconnect()


Hope this basic tutorial useful yo you.Love to hear comments from you people.Will keep posting .