Perhaps you did not know, but the Moscow Exchange is a group of companies, and one of our largest and most important components is the National Settlement Depository (NSD). Without NSD, the professional participants of the Russian and international market would not have clear and transparent settlement and depository services, which are so necessary in making transactions. As befits an IT company, NSD, together with the Exchange, is constantly improving its internal IT architecture.
Starting in 2014, the integration and transfer of the integration between internal systems to industrial middleware is carried out - the stack of Oracle Fusion Middleware products, in which Oracle SOA Suite occupies a central place. This product is highly specialized and there are very few materials in Russian on it. In the Exchange's blog, we plan to regularly talk about our findings and discoveries related to the implementation of SOA Suite. You should not expect the appearance of a full-fledged course here, rather, it will be notes on various problematic topics for which we have not found clearly formulated recipes and now we want to share our results with other specialists. We hope that in each article the reader will be able to find for himself something new and useful.
In the latest version 12c of its SOA Suite product, Oracle has implemented a useful thing - in the Enterprise Manager dashboard, instead of a separate instance of composite applications, executable chains began to appear (business flow, as it is called in the official documentation). But with a large number of simultaneously running applications, the problem of finding the right instance of a composite application or chain still remains.
A typical solution in this situation is to use the name of the chain (Flow Name) in order to reflect in it information that allows you to uniquely link the chain to the data that it processes. Usually these are identifiers, names, references of transmitted messages. The control panel allows you to filter selections by name, including the standard LIKE SQL construct templates.
To specify the name of the chain there is a function oraext: setFlowInstanceTitle (). It can be used, for example, in Assign Activity, (Figure 1):
<assign name = "AssignFlowName">
<copy>
<from> oraext: setFlowInstanceTitle (string ($ inputVariable.payload / client: name)) </ from>
<to> $ outputVariable.payload / client: name </ to>
</ copy>
</ assign>
')
Figure 1. Function to specify the name of the chain.
The possibility of specifying a name for a single composite application (and not the entire chain) with the
ora: setCompositeInstanceTitle ( ) function also remains, but if you have the opportunity to name the chains, it is already completely uninteresting (and is not discussed in the article).
Both of these functions, however, will work with the installed fix # 18310693 (included in the latest at the time of writing Patch # 20900599: SOA Bundle Patch 12.1.3.0.3). If you have not yet updated your server, then only a call from Java Embedding will work:
<extensionActivity>
<bpelx: exec name = "JavaFlowName" language = "java">
<! [CDATA [setFlowInstanceTitle ((String) getVariableData ("titleVar"));]]>
</ bpelx: exec>
</ extensionActivity>
The attached archive contains an example of a composite application with both versions of the name indication. The string passed to the web service input is assigned as a chain name by both of the specified methods (for the Java Embedding variant, the
<bpelx: skipCondition> true () </ bpelx: skipCondition> check box is set ). You can download the application to your server and experiment with the names using the test tools built into the Enterprise Manager (Figures 2, 3).
Figure 2. Calling a composite application in Enterprise Manager.
Figure 3. The chain with the specified name.
If you pass a string longer than 100 characters, the composite application will fail with an error:
ORA-12899: value too large for column "DEV12C_SOAINFRA". "SCA_FLOW_INSTANCE". "TITLE" (actual: 101, maximum: 100)(in this case, DEV12C is the prefix for the system diagrams specified during the installation of the SOA Suite).
Yes, yes, all right, using the legal API can be an elementary way to disrupt the execution of the application - SOA Suite allocates a field of 100 characters for storing chain names. And this case, unfortunately, is not the only one. There are several scenarios for overflowing text fields, including when their values are generated in a systemic way (independent of user input).
A typical Oracle Support response to errors of this kind: Expand the field in the database. Since some errors were known in the previous version 11g and successfully moved to version 12c, it is useless to try to solve them in a systematic way. Therefore, to guarantee the stable operation of the server, it is necessary to install patches. In our circuits, we:
- Expanded the value of the problem field to 256 characters, because 100 characters are still very small.
- In all assignments, we additionally trim the text string with substring ():
<assign name = "AssignFlowName">
<copy>
<from> oraext: setFlowInstanceTitle (substring (string ($ inputVariable.payload / client: name), 1, 256)) </ from>
<to> $ outputVariable.payload / client: name </ to>
</ copy>
</ assign>
The most reliable solution is to implement a special extension function for the SOA Suite, which will internally perform the necessary length control, and use only it. Alexander Khoroshilov, head of integration, the integration systems development department at NSD, through which this publication appeared, will tell about this in one of his future articles.