Runtime components : Core components : Typed data : Reference : Typed data definition example in the context definition file
  
Typed data definition example in the context definition file
In the following example, the context declaration contains a reference to a collection of typed data (TransferContextData). The toolkit instantiates the collection when it instantiates the context.
<context id="transferCtx" type="Op" parent="myParent" >
<refType refId="TransferContextData" /></context>
The type definition file includes a definition for the collection:
<type id=" TransferContextData "
      implClass="com.ibm.btt.base.KeyedCollection" >
  <KCollDescriptor id="typeDefault"
                   refType="TransferContextData "/>
  <KCollDescriptor id="FundsTransfer"
                   refType="myFundsTransfer"/>
  <! Other data elements to be included in the context>
  ...
</type>
Note In this case all of the data within the context is typed data.
You can also define the context in the following way:
<context id="transferCtx" type="Op" parent="myParent" >
  <refKColl refId="TransferContextData" />
  <refService refid="myJournal" alias="Journal" type="jour" />
</context>
In this case, the data definition file contains a definition for the collection:
<kColl id="TransferContextData">
  <data id="myFundsTransfer" refType="FundsTransfer"/>
  <field id="CustomerName"/>
  ....
</kColl>
The second approach enables you to have typed and untyped data in the same context at the same time.
Go up to
Reference