Your browser does not support JavaScript!
You are here: Common Elements > CopyBook Element

CopyBook Element

Description

Transactions and screens can point to CopyBook business rules.  This allows for plans and products to share common functionality.  Maintenance is less complicated since the logic is held in only one place.  The CopyBook named will be resolved by the system and the configuration contained in it will be added to the rule that invokes it.

CopyBooks can be used under all elements of transactions, and other business rules in some configurations.  If the entire configuration of a transaction were placed in a CopyBook, the transaction XML would be configured as shown in the XML example below.

CopyBook Element/Attribute Table
Element/Tag Attribute Definition Element/Attribute Value and Description

<CopyBook>

 

Required for CopyBook invocation:

This is the start and end tag for the element.

The value is the name of the CopyBook being invoked.  The exact name of the CopyBook must exist in the business rule configuration.

NAME Required for CopyBook Configuration:

Text: 

CopyBook name to be used to implement copybook in transaction or screen rule.

Any valid element   XML elements configured within the <CopyBook> tags are copied into the XML where the CopyBook is invoked.  

Example XML

XML to Configure CopyBook

<CopyBook NAME="CopyBook-BankDraftStop">
<EffectiveDate STATUS="Disabled" TITLE="Effective Date" TYPE="SYSTEM"></EffectiveDate>
<Math>
<MathVariables>
<!-- Calculate Days from Last Bank Draft -->
<MathVariable VARIABLENAME="LastActiveBankDraftEffectiveDate" TYPE="VALUE" DATATYPE="DATE"></MathVariable>
<MathVariable VARIABLENAME="BankDraftEndDate" TYPE="FIELD" DATATYPE="DATE">Activity:EffectiveDate</MathVariable>
<MathVariable VARIABLENAME="LastActiveBankDraftEffectiveDate" TYPE="SQL" DATATYPE="DATE">
<SqlServer>SELECT TOP 1 AsActivity.EffectiveDate FROM AsActivity
JOIN AsTransaction ON AsTransaction.TransactionGUID = AsActivity.TransactionGUID
AND AsTransaction.TransactionName = 'BankDraft'
WHERE AsActivity.PolicyGUID = '[Policy:PolicyGUID]'
AND AsActivity.StatusCode IN ('01','13','14')
AND AsActivity.TypeCode IN ('01','04')
ORDER BY AsActivity.EffectiveDate DESC</SqlServer>
<Oracle>SELECT EffectiveDate FROM (SELECT AsActivity.EffectiveDate
FROM AsActivity JOIN AsTransaction ON AsTransaction.TransactionGUID = AsActivity.TransactionGUID
AND AsTransaction.TransactionName = 'BankDraft'
WHERE AsActivity.PolicyGUID = '[Policy:PolicyGUID]'
AND AsActivity.StatusCode IN ('01','13','14')
AND AsActivity.TypeCode IN ('01','04') O
RDER BY AsActivity.EffectiveDate DESC)
WHERE ROWNUM = 1</Oracle>
<DB2>SELECT AsActivity.EffectiveDate FROM AsActivity
JOIN AsTransaction ON AsTransaction.TransactionGUID = AsActivity.TransactionGUID
AND AsTransaction.TransactionName = 'BankDraft'
WHERE AsActivity.PolicyGUID = '[Policy:PolicyGUID]'
AND AsActivity.StatusCode IN ( '01' , '13' , '14' )
AND AsActivity.TypeCode IN ( '01' , '04' )
ORDER BY AsActivity.EffectiveDate DESC
FETCH FIRST 1 ROWS ONLY</DB2>
</MathVariable>
<MathVariable VARIABLENAME="TestLastActiveBankDraft" TYPE="FUNCTION" 
DATATYPE="BOOLEAN">IsEmpty(LastActiveBankDraftEffectiveDate)</MathVariable>
<MathIF IF="TestLastActiveBankDraft = false">
<MathVariable VARIABLENAME="DaysFromLastBankDraft" TYPE="FUNCTION" 
DATATYPE="INTEGER">DaysDiffOf(LastActiveBankDraftEffectiveDate,BankDraftEndDate)</MathVariable>
</MathIF>
</MathVariables>
</Math>
</CopyBook>

XML To Invoke Copybook

<Transaction NAME="BankDraftStop">
<CopyBook>CopyBook-BankDraftStop</CopyBook>
</Transaction>

 

Copyright © 2009, 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices