Showing posts with label DheerajSoa. Show all posts
Showing posts with label DheerajSoa. Show all posts

Friday 24 February 2017

Human Task Implementation In Oracle SOA Suite - Part 1



A human task is, quite simply, a unit of work that involves a human. Quite often, this task requires that the human interact with other services, and thus becomes a task within a larger business goal.
Human task provide the feature where human person can interact with the business process to take business decision.
For modeling the process containing the human task we need to do following:
1.   Creating and modeling a human task definition using Human task component (Also known as Human task service)
2.   Generating the task form for displaying the human task during runtime in Oracle BPM Worklist.
3.   Associating it with a BPEL process
Use case: Let’s take a use case from Order Management System, where the order process requires the approval from the manager.
Implementation

Create a SOA project with name “HumanTaskProject” having empty composite



Create a Asynchronous BPEL process by dragging the bpel component on the composite.
Since we are going to have a Human task within the bpel process and we can’t expect the response with in a timeline from human task.

So to avoid process timeout we will be creating the asynchronous process.



IDE will create the wsdl, xsd required for the process. So modify the files as for our requirements below
Generated XSD


Modified XSD



Generated WSDL



Modified WSDL


Now your composite looks like below 


 Before adding the Human Task to BPEL OrderProcess, we should creating Human Task definition which will act as partner link and also to generate the web application using which human can interact with the process.
In Human task definition, we can specify human task metadata such as task outcome, payload structure, assignment and routing policy, expiration and escalation policy, notification settings.
Create a Human Task definition by adding Human Task component to the composite. Here we are not adding Human task in to the bpel process.


 Enter Name as “OrderProcessHumanTaskDefinition” or of your choice and click OK


And Now your composite look like below 

Double click the “OrderProcessHumanTaskDefinition” and you will get below wizard

Specify the Task Title by clicking the Build Title editor highlighted in the above and Click OK

Select the outcomes from the Human Task by clicking the browse button. Here we are specifying the possible values that can be return from the human task when human has acted on the request.
Click OK after you select the required values. If you require any other values apart from this click “+” and add them.
For this example we require only Approve and Reject. So I am selecting the both

Now click on the “Data” tab

Now specify the input data format by clicking the “+” and selecting “Add other parameters” if we are sending the xml data. Otherwise we can select either string, int etc.

We will be sending the xml data so I will be selecting the Add other parameters.

Browse the XSD element

Select the order request element and click OK.

Again Click OK in Add Task Parameter wizard

Now click on the “Assignment” tab to add the participant/user who can access this request or act on the request

Click on the “Edit Participant” and you will be getting the below wizard.

Click “+” and select “Add User”.

You can select the user from weblogic server by clicking browse button or if you Now the user name you can direct enter the user name.

Click OK

Now generate the UI application from where human can act by clicking the “Create Form” and select “Auto generate Task form”.

You will get a wizard to create a project. Enter the name as “OrderProcessUI” and click OK.
Now wait from some time. A ADF web project will be created and you can see lot of files will be created automatically, opened in the editor.
Click Save All and close the other files which are opened automatically.

Now go back to your SOA project and open your composite.xml

Now connect the “OrderProcess” with “OrderProcessHumanTaskDefinition” as below

Double click “OrderProcess” or open the bpel OrderProcess to do the process orchestration

Now add the human task component by dragging and drop the human task component on to the bpel process

Open the new add human task component by double clicking it

Select the task definition which we have created earlier. When we select task definition we will be asked specify the details configured in task definition

Now select the bpel variable which has the data to be passed to human task by clicking the browse button

Select the “orderRequest” and click OK.

Then in Human Task wizard click Apply and OK. When we click “OK”, IDE will automatically create a switch activity with possible conditions based on the outcome of Human task definition

Delete the otherwise case in switch activity. Since I don’t want to deal with default cases.
Now expand the human task activity. When we selected the human task definition, IDE will automatically creates “Assign”, Invoke and Receive activities.

Assign activity will copy data from variable of Receive activity to variable which is part of the invoke activity.

If the invoke and receive activity are not connected to Task service which is created from the human task definition then we need to connect them explicitly.

When we connect them we will get the edit wizard. Just click “Apply” and then OK

Click on the condition of Switch activity. We can notice the condition is created based on the outcome from the human task. Nothing to modify here

You can also notice that there are assign activities in sequences of each case in the switch activity.

By default assign activity will copy the payload received from the human task to input variable

Delete this by clicking delete button highlighted above.

We are doing this because I need to send the action performed by human as the response to the client in the callback.

Scroll down the “SystemAttributes” which is part of “task”. Here we will be having “outcome”. Copy the outcome to output variable as below

Click Apply and OK.

Repeat the same for assign activity in another case as well.
This was the developement part, we have completed it. Now we need to Deploy the Application and do the Unit Testing.
Follow my Part 2 of the Deployment and Unit testing.

Wednesday 22 June 2016

File based MDS configuration SOA Jdevloper

Hi Guys, Today we are going with Steps for File Based MDS configurations.

STEP 1 :
Login to EM console.Expand SOA and right click on soa-infra and selcet Adminstration -->MDS configuration.



STEP 2:

Click on Export button on MDS configuration screen and save it your local disk

unzip the folder soa_infra_metadata, 
you will see the 
apps folder. 
All your project related WSDlS,XSD,fault-policy.xml,fault-binding.xml etc will be inside the apps folder.

STEP 3:


Now go to your C:\Oracle\Middleware\jdeveloper\integration\seed folder in your system, or it could be any other location as well, based on your Installation directory.
The above path created automatically while you installed JDeveloper studio.


STEP 4:

Copy and Paste apps folder, which you have got in from STEP 2.
Now its look like C:\Oracle\Middleware\jdeveloper\integration\seed\

STEP 5:
To use these schemas/wsdl etc in Jdeveloper we need to add some parameters in adf-config.xml under Application Resources.




Click on the adf-config.xml
Note:For each and every application it has his own adf-config.xml file persist.

Once opened the file need to add metadata-storage-usage_2 

 <metadata-namespaces>
          <namespace metadata-store-usage="mstore-usage_1" path="/soa/shared"/>
          <namespace metadata-store-usage="mstore-usage_2" path="/apps"/>
 </metadata-namespaces>
    <metadata-store-usages>
        <metadata-store-usage id="mstore-usage_1">
              <metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
              <property  name="metadata-path" value="${oracle.home}/integration"/>
              <property name="partition-name" value="seed"/>
              </metadata-store>
        </metadata-store-usage>
        <metadata-store-usage id="mstore-usage_2">
             <metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
             <property name="metadata-path" value="C:\Oracle\Middleware\jdeveloper\integration"/>
             <property name="partition-name" value="seed"/>
             </metadata-store>
        </metadata-store-usage>
    </metadata-store-usages>
    



    Note:
1. I have specify mstore_usage_2 path="/apps"-------because my all schemas   under that folder only.Incase ur schemas under apps folder only u can specify path like path="/apps"
     :Oher case if your schemas folder name is SOASchemas then u can specify path like
       path="/apps/SOASchema" 

2.Metadata-Path value  must be C:\Oracle\Middleware\jdeveloper\integration in real time scenarios
3.Patition-name valuse must be seed in real time scenarios.


    


STEP 6: 
To use a wsdl or any resource in your project use below reference. 

<wsdl:types>
      <schema xmlns="http://www.w3.org/2001/XMLSchema">
         <import namespace="http://xmlns.example.com/unique/default/namespace/1103228635369" schemaLocation="oramds:/apps/ApplicationComponents/BAM/LoggingBAM.xsd"/>
      </schema>

   </wsdl:types>





    Thats it guys. 

Wednesday 15 June 2016

Download directly to Unix/Linux from Internet/Oracle using WGET command


Hi Guys,

In this post, I will describe the process to directly download installers from Oracle.com to Unix Machines.
You may wonder, why a post on this topic. Its fairly easy, but sometimes we dont have Browsers in Linux machines. We only have the Terminal or Putty screens to work.
Here's the process, to download using putty.

1. Log in to Unix Machine using Putty.
2. Navigate to location, where you want download installers.
3. Now using any windows PC Chrome browser, Login to Oracle.com, Select your installer & Download it to PC. In Chrome Download tab, Right Click on Downloading file. Select 'Copy Link Address'.

The address will look something like below

http://download.oracle.com/otn/nt/middleware/12c/1221/fmw_12.2.1.0.0_soaqs_Disk1_1of2.zip?AuthParam=1454049262_286c6d7c2bf0ba6eb3c31dcfb3d309a0

This address is valid for few minutes only. Hence do all steps faster.

4. Prepare a command as below using this adrress, your username  password,


wget --http-user=dhexxxxxxha@xxxxx.com --http-password=xxxxx234a --no-check-certificate "http://download.oracle.com/otn/nt/middleware/12c/1221/fmw_12.2.1.0.0_soaqs_Disk1_1of2.zip?AuthParam=1454049262_286c6d7c2bf0ba6eb3c31dcfb3d309a0" -O NameOfDownloadedFile.zip

5. Copy the above Command and Paste it to Putty screen. Hit enter, your download will start.
6. Repeat the same steps if there are multiple installers.


Thats it folks!

SOA - Using ora:getPreference() in BPEL process to get Environment specific Values

Hi Folks,

There are scenarios, when we have SOA Services (Composites), which uses Environment specific data in the transaction.
For Example - You have created Logging or BAM Service, which can be deployed across various Environments like Staging(Testing), Production. Now to identify the Transaction between various environment, you may need some sort of Identifiers. Like :

Environment Identifier
Development DEV
Test         TST
Production PRD

To achieve this, there could be multiple solutions. Here I am going to discuss one solution which uses function
ora:getPreference()

The syntax of function is  :
ora:getPreference('environmentName')

Here 'environmentName' is variable name.



Steps of implementation:

STEP 1 : Use Assign Action in BPEL flow & add function ora:getPreference('environmentName') in required field.





STEP 2 :  Once your code is compiled & Deployed to Server, you need to set the value of this variable in EM console.

STEP 3 : Login to EM console. On the left go to : Farm_soa_domain > Weblogic Domain > soa_domain > right mouseclick and select ‘System MBean Browser’.



STEP 4 : Then Navigate to : Defined MBeans > oracle.soa.config > Server : soa_server1 > SCAComposite > your_project > SCAComposite.SCAComponent > your bpel_process.





STEP 5 : Change the Value, and Apply.


Thats all !







Saturday 5 March 2016

OSB 12c - For Each action

Hey guys !

In this Post I am going through the For Each functionality in OSB 12c.


Use Case 

Simple Integration  Scenarios, Where Source system payload has Repeated Nodes, Target System expects one node at a time.



Design


Step 1 : 

Create a OSB Project, Add a Pipeline. Inside Pipeline Add a For Each Action.





Step 2:

Provide the required data in For Each Properties. Shown below



This is all we need to Implement For Each. 
However we will have to further process the Data, This could depend on your Requirement.
For the Demo Purpose, I am Sending this data to a Business Service using Publish Action.


Step 3:

Add a Publish Action inside For Each. Add a Assign action to see the Payload of the For Each iteration in Testing. Screens Below





Step 4:

Export and Deploy your code to Server.



Testing







Request Payload

<?xml version="1.0" encoding="UTF-8"?>
<Envelope>
  <Message>
        <MessageID>1</MessageID>
        <OrderReport>
            <OrderID>102-4552-913811</OrderID>           
            <Item>
                <OrderItemCode>09588730573218</OrderItemCode>
                <SKU>05988-2066</SKU>                
             </Item>
        </OrderReport>
  </Message>
  <Message>
        <MessageID>2</MessageID>
        <OrderReport>
            <OrderID>102-4556812-97811</OrderID>           
            <Item>
                <OrderItemCode>09588730573218</OrderItemCode>
                <SKU>05988-20166</SKU>                
             </Item>
        </OrderReport>
  </Message>
  <Message>
        <MessageID>3</MessageID>
        <OrderReport>
            <OrderID>102-4556812-91371</OrderID>           
            <Item>
                <OrderItemCode>09588730573218</OrderItemCode>
                <SKU>05988-266</SKU>                
             </Item>
        </OrderReport>
  </Message>
</Envelope>


For Each output for Last Iteration

<Message>
<MessageID>3</MessageID>
<OrderReport>
<OrderID>102-4556812-91371</OrderID>
<Item>
<OrderItemCode>09588730573218</OrderItemCode>
<SKU>05988-266</SKU>
</Item>
</OrderReport>
</Message>



Thats All Folks !






Here are some other posts, which may interests you

1. Fusion Middleware 12c – SAP Adapter Configuration

http://osb-dheeraj.blogspot.in/2016/02/fusion-middleware-12c-sap-adapter.html

2. Oracle Integration Cloud Service (ICS)

http://osb-dheeraj.blogspot.in/2016/02/oracle-integration-cloud-service-ics.html


3. SOA Interview Questions : Service Oriented Architecture Interview Questions Part 1

http://osb-dheeraj.blogspot.in/2016/02/soa-interview-questions-service.html



http://osb-dheeraj.blogspot.in/2016/02/osb-12c-domain-value-map-dvm.html