10g
In 10g (10.1.3.3.0) the following code with the setTitle function will work to produce a Name for the instances in the BPEL Console, resulting in the text "EMPLID" followed by the client:input value, which in this example would be the employee ID:
<bpelx:exec name="Assign_Title" language="java" version="1.3"> <![CDATA[java.lang.String titleValue=null; oracle.xml.parser.v2.XMLElement titleValueElement= (oracle.xml.parser.v2.XMLElement)getVariableData("inputVariable", "payload" , "/client:TesterProcessRequest/client:input"); titleValue=titleValueElement.getText(); setTitle("EMPLID " + titleValue); addAuditTrailEntry("EMPLID " + titleValue);]]> </bpelx:exec>
11g
In 11g there is a comparable functionality with the function ora:setCompositeInstanceTitle("Hello World"); which can be used in for example an assign activity in the From statement and for the To variable a dummy could be used.
Other info
You can also do a direct update on the database level in the OraBPEL schema on the column "Title" in the CUBE_INSTANCE table (ORABPEL.CUBE_INSTANCE.TITLE). This works on 10g, I have not tried it on 11g. It's of course not recommended by Oracle.
Also note the following bug on Oracle support:
Bug 9953763 - SETTITLE FUNCTIONALITY IS MISSING IN INSTANCEHANDLE OF JAVA API
And I found this article to be rather interesting: http://technology.amis.nl/blog/2387/embedding-java-in-bpel-process
Geen opmerkingen:
Een reactie posten