Difference between revisions of "DBOBuilder"

From GreenVulcano Wiki
Jump to: navigation, search
({{GVESB}} configuration)
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
==Description==
 
==Description==
  
The DBOBuilder element represents a DataHandler service.
+
[[File:DBOBuilder.jpg|thumb|DBOBuilder with VulCon]]The DBOBuilder element represents a [[DataHandler]] service.
  
=={{GVESB}} configuration==
+
Might contain more [[#DBO|DBOs]] that represent all the elementary [[DataHandler]] operations that can be combined in a service.
 +
These [[#DBO|DBO]]s will be executed in order of definition. By default returns the output as a result of the last [[#DBO|DBO]].
 +
The output of a [[#DBO|DBO]] can be used as input of the next.
  
The DBOBuilder element is used by [[dh-call]] plugin.
+
The statements used in the [[DBOBuilder#DBO|DBOs]] may contain metadata resolved at runtime that allows you to customize the actual command to be sent to the database.
  
Might contain more [[#DBO|DBO]]s, which will be executed in order of definition. By default returns the output as a result of the last [[#DBO|DBO]].
+
The properties of the [[GVBuffer]] object can be referenced with the metadata <nowiki>@{{name}}</nowiki>.  
 +
The body of the [[GVBuffer]] object, if any, is passed to the processing engine or data transformation engine, or it will be populated with the service output.
  
The output of a [[#DBO|DBO]] can be used as input of the next.
+
The following table shows the parameters included into the [[DBOBuilder]] output [[GVBuffer]] containing statistics about the operations done:
 
+
{| class="gvtable"
DBOBuilder returns the following statistics about the operations done:
+
! Parameter !! Description
* REC_TOTAL           : founded records
+
|-
* REC_READ           : read records
+
| REC_TOTAL || number of founded records
* REC_INSERT         : inserted records  
+
|-
* REC_UPDATE         : updated records
+
| REC_READ || number of read records
* REC_DISCARD         : discarded records
+
|-
* REC_DISCARD_CAUSE   : Report about discarded records
+
| REC_INSERT || number of inserted records  
 +
|-
 +
| REC_UPDATE || number of updated records
 +
|-
 +
| REC_DISCARD || number of discarded records
 +
|-
 +
| REC_DISCARD_CAUSE || Report about discarded records
 +
|}
  
 +
=={{GVESB}} configuration==
  
It has the following attributes:
+
The [[DBOBuilder]] element is used by [[dh-call]] and [[GVDataHandlerConfiguration]].
 +
 +
The following table shows its attributes:
 
{|class="gvtable"
 
{|class="gvtable"
 
! Attribute !! Type !! Description
 
! Attribute !! Type !! Description
Line 41: Line 54:
 
|}
 
|}
  
The following example shows who to configure [[DBOBuilder]] combined with the retrievers (see [[RetrieverConfig]]) and the use of metadata inside the statement:  
+
The following example shows who to configure [[DBOBuilder]] combined with the retrievers (see [[Retriever_Config|RetrieverConfig]]) and the use of metadata inside the statement:  
 
<syntaxhighlight lang="XML"><?xml version="1.0" encoding="UTF-8"?>
 
<syntaxhighlight lang="XML"><?xml version="1.0" encoding="UTF-8"?>
 
<dh-call class="it.greenvulcano.gvesb.virtual.datahandler.DataHandlerCallOperation"
 
<dh-call class="it.greenvulcano.gvesb.virtual.datahandler.DataHandlerCallOperation"
Line 53: Line 66:
 
               select NAME from CITY where ID=@{{ID}}
 
               select NAME from CITY where ID=@{{ID}}
 
         </DataRetriever>
 
         </DataRetriever>
         <DataRetriever method="getPersonID" signature="NAME,CITY">
+
         <DataRetriever>...
              select ID from PERSON
+
         <DataRetriever>...
              where NAME='@{{NAME}}'
+
         <DataRetriever>...
              and ID_CITY=(select ID from CITY where NAME='@{{CITY}}')
 
         </DataRetriever>
 
         <DataRetriever cacheable="true" method="getCardID" signature="NUMBER,ID_OWNER">
 
              select ID from CREDIT_CARD           
 
              where CNUMBER='@{{NUMBER}}'
 
              and ID_OWNER=@{{ID_OWNER}}
 
        </DataRetriever>
 
        <DataRetriever method="getSeqVal">select SEQ_PERSON_ID.nextval from dual</DataRetriever>
 
 
       </GenericRetriever>
 
       </GenericRetriever>
 
     </RetrieverConfig>
 
     </RetrieverConfig>
Line 105: Line 110:
 
*** ''value'': variable value
 
*** ''value'': variable value
  
* [[#DBO|DBO]]
+
* [[#DBOs|DBOs]]
 +
<div class="version_ge3.4">
 +
* [[XMLMerge]]: replace the old Merge element
 +
</div>
  
====DBO====
+
====DBOs====
  
The DBO elements represent the elementary operations of DataHandler that can be combined in a service. Those are:
+
The DBO elements represent the elementary operations of [[DataHandler]] that can be combined in a service. Those are:
  
 
* [[DBOSelect]]
 
* [[DBOSelect]]

Latest revision as of 13:07, 13 May 2014

Description

DBOBuilder with VulCon

The DBOBuilder element represents a DataHandler service.

Might contain more DBOs that represent all the elementary DataHandler operations that can be combined in a service. These DBOs will be executed in order of definition. By default returns the output as a result of the last DBO. The output of a DBO can be used as input of the next.

The statements used in the DBOs may contain metadata resolved at runtime that allows you to customize the actual command to be sent to the database.

The properties of the GVBuffer object can be referenced with the metadata @{{name}}. The body of the GVBuffer object, if any, is passed to the processing engine or data transformation engine, or it will be populated with the service output.

The following table shows the parameters included into the DBOBuilder output GVBuffer containing statistics about the operations done:

Parameter Description
REC_TOTAL number of founded records
REC_READ number of read records
REC_INSERT number of inserted records
REC_UPDATE number of updated records
REC_DISCARD number of discarded records
REC_DISCARD_CAUSE Report about discarded records

GreenVulcano® ESB configuration

The DBOBuilder element is used by dh-call and GVDataHandlerConfiguration.

The following table shows its attributes:

Attribute Type Description
type fixed This attribute must assume the value dbobuilder.
class fixed This attribute must assume the value it.greenvulcano.gvesb.datahandling.dbobuilder.DBOBuilder
name required Service name
jdbc-connection-name required DataSource JNDI name
transacted optional Defines if the services must be executed in transaction. Default true.
isXA optional If the service is transacted, this attributes indicates if it participates in a distributed transaction or not.
If false the DataHandler handle a local transaction. Default false
output-data optional The default is the value of @output-data of the last DBOxxx;
make-dump optional If set to none not perform the input/output data dump.
If set to text or hex then the dump is performed as text or hexadecimal string.
Default to text.

The following example shows who to configure DBOBuilder combined with the retrievers (see RetrieverConfig) and the use of metadata inside the statement:

<?xml version="1.0" encoding="UTF-8"?>
<dh-call class="it.greenvulcano.gvesb.virtual.datahandler.DataHandlerCallOperation"
         name="DataHandler" type="call">
    <RetrieverConfig>
       <GenericRetriever class="it.greenvulcano.gvesb.datahandling.utils.GenericRetriever" type="retriever">
         <DataRetriever cacheable="true" method="getCityID" signature="NAME">
              select ID from CITY where NAME='@{{NAME}}'
         </DataRetriever>
         <DataRetriever cacheable="true" method="getCityName" signature="ID">
              select NAME from CITY where ID=@{{ID}}
         </DataRetriever>
         <DataRetriever>...
         <DataRetriever>...
         <DataRetriever>...
       </GenericRetriever>
    </RetrieverConfig>
    <DBOBuilder class="it.greenvulcano.gvesb.datahandling.dbobuilder.DBOBuilder"
                jdbc-connection-name="ds.gv_test" name="SearchPerson"
                type="dbobuilder">
       <DHVariables>
          <DHVariable name="decimal-separator" value="."/>
          <DHVariable name="grouping-separator" value=","/>
          <DHVariable name="format" value="#0.00"/>
          <DHVariable name="NAME" value="NULL"/>
          <DHVariable name="CITY" value="NULL"/>
       </DHVariables>
       <DBOSelect class="it.greenvulcano.gvesb.datahandling.dbo.DBOSelect"
                  name="SearchPerson" transformation="SearchPerson" type="dbo">
          <statement id="1" keys="1,2,3" type="select">
              select p.NAME, p.BIRTHDATE, c.NAME, cc.CNUMBER, cc.CREDIT, cc.ENABLED
              from PERSON p, CITY c, CREDIT_CARD cc
              where p.ID_CITY = c.ID
              and p.ID = cc.ID_OWNER
              decode{{@{{NAME}}::NULL::::and p.NAME like '%@{{NAME}}%'}}
              decode{{@{{CITY}}::NULL::::and c.NAME like '%@{{CITY}}%'}}
              order by c.NAME, p.NAME</statement>
        </DBOSelect>
   </DBOBuilder>
   <DBOBuilder .../>
   <DBOBuilder .../>
</dh-call>

DBOBuilder has the following sub-element:

  • DHAliasList: List of aliases for a given DataHandler service. It contains
    • DHAlias: Alias for a DataHandler service with its Description
  • DHVariables: List of default values for DataHandler service's variables. It contains
    • DHVariable: Default value for DataHandler service's variable including the parameters
      • Description
      • name: variable name
      • value: variable value

DBOs

The DBO elements represent the elementary operations of DataHandler that can be combined in a service. Those are:

Inside of it you can include SQL statements which may contain metadata that will be resolved prior to execution.

You can also add more DHVariable elements that define default values ​​for properties that may be missing in GVBuffer.