Saturday, 26 April 2014

User creation in weblogic with multiple properties from ant using wlst

Creating users from the wlst is pretty straight forward and you can go through the oracle documentation for the same. Here is the link to the document page http://docs.oracle.com/cd/E23943_01/web.1111/e13715/config_wls.htm#i1021808.
This is written to automate the task of creating users from ant . The only change that is to be made is to set the fmw.home,user.url,adminusername,adminpassword to your environment.
All the properties can be edited from the build.properties file.
The source has four files
  1. Build.xml Contains the call to create users task for creating multiple users in a single shot. users.option is used to specify all or few of the users at a time
  2. Build.properties contains the name value pairs that can be customized
  3.  createUser.py creates the users using wlst
  4. userCreationlibrary.xml contatins invocation to the usercreation.py file with the necessary parameters set

If you need more information please feel free to comment.you can find the code at github. Link to the source is onto the right .

Friday, 25 April 2014

Configuring DB polling adapter with mark reserved value

There are many ways to make the polling of a DB adapter to make it singleton i.e. making the adapter poll a record only once even of there are many nodes on the cluster. This post typically explains how to use mark reserved value with both delete polling strategy and logical delete

This assumes that you have experience in deploying and creating connection factories  in the db adapter . If you need more help on this you can refer to the documentation or search other blogs there are plenty.

These are the steps to be followed for both of the polling strategies
  1. Create a table sample in the hr schema 
  2. Create a SOA project with composite in JDeveloper
  3. Drag and drop a db adapter on to the composite . Fill in all the details with any values you prefer .Create a connection to the hr schema and select it .
  4. Select the operation type as poll for new or changed records in the table.
  5. Import the table sample and select data as the primary key for the table.
  6. The polling strategy is to be selected in this step 
    1. Delete Polling strategy
      Select the option delete the rows when read
    2. Logical Delete
      Select the option update the field in the sample table(Logical delete)
  7. Leave the polling options and advance options to default values and click on finish
  8. In the case of Delete polling strategy there is no option for including the values of  MarkReadColumn,MarkReservedValue,MarkUnreadValue.Copy paste in the generated .jca file to make the necessary changes as shown below
  9. For Logical delete the ui configuration can be used to fill the property values
Let me take back and explain the use of each property above
  • MarkReadColumn
    The column to be used for updating the below given three properties
  • MarkReservedValue
    This is the value which is used to pick the records on a specified node. The value can be specified with special variables . Let us look at the above property value and study it.
    In the above sample weblogic.Name is the name of the server node and IP is the ip address fo the node. -2 specifies the last two characters
    R${weblogic.Name-2}-${IP-2}
  • MarkUnreadValue
    This property specifies the value of the record which are to be picked . For simplicty you can consider this as where condition
  • MarkReadValue
    This property is useful only in the case of logical delete. This property updates the value of MarkReadcolumn with the specified property after sucessful processing for the record

OSB error handler using fault variable can't acess fault var

There is a typical situation where you can't access the fault variable directly inside the error handler . When you got to compare and conditionally branch and when you use the fault variable in the condition then you would see error as below

The typical flow would look like this
This can be solved by assigning the fault variable to an intermediate value as below
Then the condition can be specified using the intermediate value as given below
Now the error goes way and every thing works fine as expected.