Showing posts with label SOA. Show all posts
Showing posts with label SOA. Show all posts

Wednesday, January 27, 2016

Oracle BAM 12.2.x is Out

If you are used to 11G version of Oracle BAM, release 12.2 is full of pleasant surprises. Oracle says the 12 version was rebuilt from the ground up. BAM composer looks clean and much more simplified. Capabilities are clearly pinned to roles and made available under a pretty ADF Alta UI.
Login Screen: Home Page:

Here are the most impressive features that caught my attention:

1. Refreshed ADF based data Visualization Tools – graphs & charts with drill through, actions.

2. Extended browser compatibility support – IE, Firefox, Chrome. This one should really come above everything else listed here :).

3. KPI based email alerts

4. Pre-defined SQL Queries - Not the same thing as External Data Objects.

5. Automatic data purges - Configure the retention period as a configuration for Data Objects

6. Export data to a CSV file. All list, table views has this feature out of the box

7. Ready-to-use dashboards for BPM and SOA. A lot of the most important assignment, task, workload statistics are built into BAM

8. CQL for real-time pattern matching & trend analysis. Continuous Query Language(CQL) can be used to define queries on business objects that monitor patterns

8. BAMCommand, LoadGen - Tools provided for export, import operations. LoadGen can be used to load test data into BAM in specified intervals and order.

9. Multiple ways for data IO - BAMAdapter, Web Services or EMS

10. Role based security - 'Administrator' defines data objects and manage viewlets. 'Designer' builds queries, views and dashboards. BAM content user has access to the Home tab of BAM composer where they can view all dashboards they have access to.

BAM development cycle is as defined below:

1. BAM Administrator user defines the Data Object. DO can be Simple, Derived, Logical or External

2. BAM Designer creates a project and adds the created DO to the project.

3. Create a business query from DO attributes. Query can be Flat, Group, Tree Model or Continuous

4. Create a business view from business query.

5. Create dashboard(s) from business views.

6. Optionally, build KPIs and Params if needed.

Rendering a drop down list dynamically on Oracle PCS Web form

Been wanting to blog a little experiment I did with Oracle Process Cloud's Web form. Current version of PCS is limited to Web forms; no ADF. I'll post the other shortcomings of current PCS release in another blog. The only way to build dynamic field/value behavior (for now at least)is by using Javascript, JSON and REST.
Here is how you to build a 'drop down' that loads country names at run time.
Login to PCS account > composer> application.
Create a new form. I am calling it CountryList.
Drag and add a 'drop down' component on to the form. I am also adding a message component to show the selected country.
Click on the 'Create Rule' icon on top right of the form and add a new rule.
Type the rule below to load country list from a public JSON service on form load.
The code above reads country names from the JSON service and constructs a temporary array - v_Countries - from the 'name' elements of the JSON array. This temp array is then assigned to drop down Options.
Add an additional line to display the selected drop down value on message component. Web forms are smart enough to rerun the rules every time an event occurs in the component - which is value change in our case.
Test the form using the 'preview' button on top right.

Tuesday, June 24, 2014

Create Weblogic JMS SAF (Store and Forward) using WLST

As a follow up to my last blog, here is a simple WLST script to automate the whole process of creating EDN specific SAF on a non-SOA Weblogic server

----------------------------------------------------------------------------------------

######################################################
# This WLST will connect to the 'local' weblogic server
# and create a remote SAF connection as mentioned below.
# It is written to create a SystemModule-0 JMS Module,
# Create two connection factories (XA and non-XA),
# RemoteContext, SAFImportedDestination
# and a remorte queue for EDN setup on a non-SOA weblogic.
# However, the script can be modified to create any JMS object.

# Make sure to edit/verify the lines at <---xxx---> comments
# to suit the environment
#######################################################

#connect('weblogic', 'welcome1', 'soabpm-vm.site:7001')
connect()

edit()

startEdit()

#Create SAF Agent
cd('/')

cmo.createSAFAgent('SAFAgent-0')

cd('/SAFAgents/SAFAgent-0')

cmo.setServiceType('Sending-only')

#JMS Module
cd('/')

cmo.createJMSSystemResource('SystemModule-0')

cd('/SystemResources/SystemModule-0')

#<-------------specify -------="" cluster="" etc.="" jms="" module="" server="" target-="" the="">
set('Targets',jarray.array([ObjectName('com.bea:Name=AdminServer,Type=Server')], ObjectName))

#Remote SAF Context
cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0')

cmo.createSAFRemoteContext('RemoteSAFContext-0')

cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/SAFRemoteContexts/RemoteSAFContext-0/SAFLoginContext/RemoteSAFContext-0')

#<----specify ------="" host="" pwd="" remote="" server="" user="">
cmo.setLoginURL('t3://soabpm-vm.site:7001')
cmo.setUsername('weblogic')
cmo.setPassword('welcome1')

cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0')

#Create EDN connection factories
#<--------specify --------="" connection="" factory="" jndi="" names="">
cmo.createConnectionFactory('EDNConnectionFactory');
cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/ConnectionFactories/EDNConnectionFactory')
cmo.setJNDIName('jms/fabric/EDNConnectionFactory')
cmo.setDefaultTargetingEnabled(true)
cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/ConnectionFactories/EDNConnectionFactory/TransactionParams/EDNConnectionFactory')
cmo.setXAConnectionFactoryEnabled(true)

cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0')
cmo.createConnectionFactory('XAEDNConnectionFactory')
cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/ConnectionFactories/XAEDNConnectionFactory')
cmo.setJNDIName('jms/fabric/xaEDNConnectionFactory1')
cmo.setDefaultTargetingEnabled(true)




cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0')

cmo.createSAFImportedDestinations('SAFImportedDestinations-0')
cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/SAFImportedDestinations/SAFImportedDestinations-0')
cmo.setSAFRemoteContext(getMBean('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/SAFRemoteContexts/RemoteSAFContext-0'))
cmo.setSAFErrorHandling(None)
cmo.setTimeToLiveDefault(0)
cmo.setUseSAFTimeToLiveDefault(false)
cmo.setDefaultTargetingEnabled(true)

#SAF Queue
cmo.createSAFQueue('SAFQueue-1')


cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/SAFImportedDestinations/SAFImportedDestinations-0/SAFQueues/SAFQueue-1')

#<---------specify configured="" currently="" edn="" for="" name.="" queue------------="" queue="" remote="" the="">
cmo.setRemoteJNDIName('jms/fabric/EDNQueue')

cmo.setNonPersistentQos('At-Least-Once')
cmo.setTimeToLiveDefault(0)
cmo.setUseSAFTimeToLiveDefault(false)
cmo.setUnitOfOrderRouting('Hash')

cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/SAFImportedDestinations/SAFImportedDestinations-0/MessageLoggingParams/SAFImportedDestinations-0')
cmo.setMessageLoggingEnabled(false)
cmo.setMessageLoggingEnabled(true)
cmo.setMessageLoggingFormat('%header%,JMSCorrelationID,JMSDeliveryMode,JMSDestination,JMSExpiration,JMSMessageID,JMSPriority,JMSRedelivered,JMSReplyTo,JMSTimestamp,JMSType,%properties%')


cd('/')


activate()
#####################################################

----------------------------------------------------------------------------------------

Wednesday, April 2, 2014

Creating Weblogic Store and Forward (SAF) for EDN

SAF is a very reliable mechanism when you have to move JMS messages between servers. In one of my recent projects, I had to send ADF business events from a weblogic server to my SOA domain on a different box. Because my EDN  subscriptions are on the SOA server, I had to create a pseudo EDNQueue on ADF weblogic server and move it over to the actual EDNQueue on the SOA server.

Moreover, because it is a pseudo queue on sending server, you could even have the JNDI of the queue different than the actual JNDI of the queue on remote server. This means, in my scenario, I could create a pseudo local JNDI for EDNQueue (JNDI: jms/fabric/EDNQueue); but have it forward to a regular JMS queue with a different JNDI (other than jms/fabric/EDNQueue) on the SOA server. This is a consideration if you want to get away from some of the inherent limitations of EDN subscriptions.

Here is how you do it.

Preparing ADF server for EDN:
This step is specific to ADF applications on non-SOA domains that want to use EDN. For steps to create an ordinary SAF, go to next section.

1. Copy the two directories oracle.soa.fabric_11.1.1 and oracle.soa.workflow_11.1.1 to the non-SOA server. We will be deploying these as shared libraries on the non-SOA servers. Make sure these folders are copied to the same location. These servers bring the EDN capabilities to a regular weblogic. These folders can be found under /oracle_soa_home/soa/modules of a SOA domain.

2. From non-SOA server console, go to deployments and deploy these shared libs by browsing and selecting oracle.soa.workflow_11.1.1/oracle.soa.workflow.wc.jar
3. Complete the steps and make sure the jars are showing up on the console.

Receiving SOA server:
Create the queue on the server to which JMS messages need to be forwarded. In my case, queue is TestEDNQ.

Sending ADF server:
This is where we will be creating the SAF mechanism to forward messages to TestEDQ on the receiving server.

1. Create a SAF agent from weblogic console of the server. Services>Messaging>Store-and-Forward Agents. Create new, give a name, and select an appropriate 'Agent Type'. I am leaving this as 'both'. Pick a value based on the purpose of this agent to either send, receive or both SAF messages.

2. Create a jms server and jms module they doen't exist. Services>Messaging>JMS Servers and Services>Messaging>JMS Modules.
3.  Create a sub deployment for the jms module and specify the target to a JMS server.
4. Create a SAF remote context. This is the connection to the remote receiving server. From within jms module, click new> select 'Remote SAF Context'> Specify a name, t3 URL to the remote server, user name and password. In the screenshot below, I am setting up my remote context to weblogic at localhost:7101

5. Create SAF imported destinations. This is a collection of queues and topics that can share the same SAF remote context. From within jms module, new>select 'SAF Imported Destinations', specify a name, select the remote SAF context that got created in previous step. Leave the default targeting and finish.

6. Created SAF remote context and imported destinations should look like this:


7. Create SAF queue. This is where we specify the remote queue and JNDI. In my case, I am trying to forward an EDNQueue to a regular JMS queue on the remote server. Hence, I have different values for local and remote JNDIs. However, if remote queue's JNDI is what you need on local server also, ignore the local JNDI value in this configuration. Click on the created SAF Imported Destinations > go to queues tab> 'New' and enter remote queue name and remote queue JNDI. Click OK.
8. Once created click on the created queue and add additional configuration. There is where I am overdiding remote JNDI with a different JNDI name locally on this server. My local JNDI is that of the EDNQueue and remote JNDI is that of the queue to which I want to forward my events (JMS messages).

9. Send a test JMS message to jms/fabric/EDNQueue and it will get forwarded to JMS/TESTEDNQ on the remote server. Important note here is that there is no local physical queue on the sender. All you do is, with the SAF configuration, you create a reference to a remote queue and SAF will store the message and forward it to the queue based on its availability.
10. Optionally, error handler can also be configured for SAF destinations.

Monday, October 21, 2013

Populating database values in human task payload

I had a recent requirement to populate database table values to BPM payload based on certain selections user makes in a human task UI. To add to the complication, there could be multiple rows that are associated with the user selection on UI and hence my BPM object had to be an array. Creating array objects and automatically populating them turned out quite tricky.

One way to solve this is by generating the payload as DOM and updating the BPM with java API.

A lesser complicated approach is to make use of ADF bindings. This article explains the steps.

1. Create the BPM project
2. Create the ADF Model for database
3. Generate the ADF UI for human task. This can be done using the auto-generate wizard.
4. Find the bindings for 'CreateInsert' button for the array object and the array UI table.
5. Comment out the source code for the button and table mentioned above.
6. From BPM data control, drag and drop the children of array object on to the jspx page.

7. This will create bindings the attributes of array object. We now have bindings for 'CreateInsert' button, the array itself and the array object attributes.
8. Comment out the array object attributes UI elements. We are only interested in the bindings. Not the source. You could always create bindings from the page definition file.
9. Construct the UI for database objects with action components. In my case, it was a select one choice drop down with a selectionListener.
10. From within the action listener in my backing bean (this could be a submit button as well), use an EL helper class to invoke 'CreateInsert' and then set array attributes with the database selected values. In between you could do any kind of operation, like calling another AM method to retrieve additional details.

11. In the back end we are creating the array object and populating it every time user makes a selection. In some scenarios you might want to delay this until user 'submit's the form. But either ways, the process of calling 'CreateInsert' setters will work.

For more complicated scenarios, working with human task API is the only option.


Thursday, September 12, 2013

AIA Configuration Reload Error MDS-00557

Ran into MDS-00557 today while trying to update an AIA configuration to MDS. In my case the error was happening when running an ant with UpdateMetadata.xml for AIA.

The error
[deployComposite] ---->response code=500, error:Error during deployment: Data transfer error in MDS.:
[deployComposite] MDS-00001: exception in Metadata Services layer
[deployComposite] MDS-00522: failure to save document /apps/META-INF/MANIFEST.MF to the metadata repository
[deployComposite] MDS-00557: Resource /apps/META-INF/MANIFEST.MF is already locked or is being modified.
[deployComposite]
[deployComposite] MDS-00001: exception in Metadata Services layer
[deployComposite] MDS-00522: failure to save document /apps/AIAMetaData/config/AIAConfigurationProperties.xml to the metadata repository
[deployComposite] MDS-00557: Resource /apps/AIAMetaData/config/AIAConfigurationProperties.xml is already locked or is being modified.

Solution
This error happens when there is a lock file in the Reload process. Look for any .lck files inside Reload process and delete them.

 rm ./Infrastructure/CAVS/ReloadProcess/classes/.data/00000000/je.lck ./Infrastructure/CAVS/ReloadProcess/SCA-INF/classes/.data/00000000/je.lck

If the above solution doesn't help, check the database and make sure there are no orphaned sessions locking the MDS tables.

select * from v$session s, v$process p where s.paddr = p.addr and s.sid in (select SESSION_ID from v$locked_object);

alter system kill session 'sid,serial' immediate;