Showing posts with label BPM. Show all posts
Showing posts with label BPM. Show all posts

Monday, October 26, 2015

If Else statement inside Assign activity for SOA and BPM

Many times we came across situation where we have a singleton variable and we need to assign value to this based on If-Else.
We can write this logic quite easily if we have an XSL or we can have if else activity in SOA/ Gateway in BPM.

We will show you a simple logic to have if-else in Assign activity

Explanation:


Syntax:
concat(substring(<value to be assigned>,1 div (<your if condition>)),substring(<value to be assigned>,1 div not (<same condition written for first substring>))


First part marked in Red:
The if condition is evaluated with  1 divided by the expression.If this is true then the value mentioned is assigned (It can be a string or can be a variable).

Second Part marked in Green:
In this case the expression is evaluated with  not condition.This is similar to else statement.If the expression is evaluated to true then value mentioned is assigned.
e.g.:

concat(substring("true",1 div (contains($successFlag,"SUCCESS"))),substring("false",1 div not(contains($successFlag,"SUCCESS"))))

If the variable successFlag contains value Success then the expression will be evaluated as true and then true will be assigned to the variable.If the successFlag contains any other value then 1 div not expression will be true and false will be assigned to variable.

please let us know if code is needed for the same.

Cheers,
LetsLearnOracleFusionTeam

Thursday, July 25, 2013

Composite Sensors and Composite Set Title

While working on EM console and handling huge number of instances, It get difficult to identify which instance belongs to which process  and then starts a tedious process of searching every instance to find the one which we are looking for JJ.

To reduce this burden we can implement below  solutions and save ourselves from long never ending search :
1)      Composite Sensors
2)      Composite Set Title


1) Composite Sensors:

Composite sensors provide a method for implementing track able fields on messages.

Note:  
1.You add sensors to the following components of a SOA composite application in the SOA Composite Editor:
·        Service or reference binding components
·        Service components such as a BPEL process or Oracle Mediator that have subscribed to business events

 2. It uses a run time table COMPOSITE_SENSOR_VALUE  to store the value of the sensor in DEV_SOAINFRA.

To Add Composite Sensors:

Let’s take an example where you have a BPEL process which insert Employee Information to DB. This is a web service which receive information from an external system and then do data manipulation to insert data into DB.

XSD:

Steps 1: Click on the External or Exposed service and select the option Composite sensor:


Step 2: Click on add and give it a name (this name will be visible in EM console).Once the name is given we have 3 options to choose from to create the sensor.

A)     If we select Variable then we can pass variable directly to this sensor:

B)     If we want to have some expressions then we can select expression :
C)     We can set properties too:
Step 3:  Create the sensors and deploy the BPEL Process to EM:
Step 4: Test Payload:

<ns1:EmployeeID>123</ns1:EmployeeID>
 <ns1:EmployeeName>Scott</ns1:EmployeeName>
 <ns1:EmployeeDOB>010190</ns1:EmployeeDOB>
 <ns1:EmployeePhone>12234</ns1:EmployeePhone>

Now go to EM console Instance tab and Click on AddField to search for the sensor:



Some restrictions on using composite sensors:
·        Functions can only be used with the payload. For example, XPath functions such as concat() and others cannot be used with properties.
·        Any composite sensor that uses expressions always captures values as strings. This action makes the search possible only with the like comparison operator. Also, even if the value is a number, you cannot use other logical operators such as <, >, =, and any combination of these.
·        Composite sensors only support two types of sensor actions: Enterprise Manager and JMS.
·        Header-based sensors are only supported for web service bindings.
·        Sensor actions for Oracle B2B, service data objects (SDOs), web services invocation framework (WSIF), and Oracle Business Activity Monitoring bindings are not supported.
·        Sensor values can only be one of the following types.
1.       The following scalar types:
§  STRING
§  NUMBER
§  DATE
§  DATE_TIME
2.       Complex XML elements
·        When creating an XPath expression for filtering, all functions that return a node set must be explicitly cast as a string:
         xpath20:upper-case(string($in.request/inp1:updateOrderStatus/inp1:orderStatus) ) = "PENDING"
·        Sensors can only be configured on service components that subscribe to business events. The option to configure sensors is not available if there are no subscribed business events associated with the service component.
·        Sensors cannot be configured on service components that publish business events.
·        Sensors based on business event headers are not allowed (only payloads are allowed).
·        PL/SQL subscriptions are not supported.


2) Composite Set Title function :


 Drag the function ora:setCompositeInstanceTitle() on the variable which needs to be set as Title.

Note: The variable which is used shall be type cased to string variable or else the setTitle won’t work.




The value of the variable which has been set title is displayed on Name tab.


When to use Composite sensor and when to use Composite set title:


The answer of this question is relative , completely based on the requirement. But a general thumb rule can be used.


A)      If your required can be full filled by searching 1 variable then Set title is an easy and effective solution. It can be achieved by a simple browser search.
B)      If your requirement needs to have search on multiple variables and on some complex logic then composite sensors are the only solutions.
 


Saturday, April 13, 2013

BPM Project deployment error from Jdeveloper


Hello Friends,
In this post we would like to share a very common deployment error  faced while deploying BPM Project from Jdeveloper and the resolutions. This will be helpful to people starting work on BPM 11g.
Error: ORABPEL-05250
[01:31:55 PM] Error deploying archive sca_ SalesOrder _rev1.0.jar to partition "default" on server soa_server1 [http://localhost:8001]
[01:31:55 PM] HTTP error code returned [500]
[01:31:55 PM] Error message from server:
There was an error deploying the composite on soa_server1: Deployment Failed: Error occurred during deployment of component: SalesOrderApprovalProcess to service engine: implementation.bpmn, for composite: SalesOrder: ORABPEL-05250

Error deploying BPMN suitcase.
error while attempting to deploy the BPMN component file "/opt/mas/Oracle/Middleware/user_projects/domains/bpp_domain/servers/soa_server1/dc/soa_98987a79-a200-49ca-9c92-de218d795dff"; the exception reported is: java.lang.Exception: BPMN compilation failed
This error contained an exception thrown by the underlying deployment module.
Verify the exception trace in the log (with logging level set to debug mode).

[01:31:55 PM] Check server log for more details.
[01:31:55 PM] Error deploying archive sca_ SalesOrder _rev1.0.jar to partition "default" on server soa_server1 [http://localhost:8001]
[01:31:55 PM] ####  Deployment incomplete.  ####
[01:31:55 PM] Error deploying archive
 (oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)


Cause:

When we create a Conversation and the conversation is not used in the Process then we get this error while deploying the project through Jdeveloper.
 



Resolution:

There are 2 ways to handle this error:

1)     Remove/Delete the conversation from the project and then try to redeploy the project again.
2)     Create a Service Task which will use the conversation and then deploy the Project again.


Cheers,
LetsLearnOracleSoa Team