Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Anchor
_Toc328551901
_Toc328551901
Anchor
_Toc404160356
_Toc404160356
Anchor
_Toc442889269
_Toc442889269
Export / Import objects into a different instance

Create some new objects in your configuration (this is the best approach – otherwise it may be confusing trying to distinguish your objects from objects of the same name on a different CenterView instance). Export some objects from your CenterView instance, and import them into another CenterView instance – in fact, you could even import them back into your instance, but try importing these into the CenterView instance of one of the other delegates.
Or – if you want, create a new instance of CenterView on your machine, and import the objects into that. Your CenterView trainer can help you do this, but you should start by trying to follow to the guidelines in the document CenterView Installation Guide under the section User Documentation in the CenterView help.
Make some changes to these objects.
Export them, and then import back into your instance.
Verify that the model has been properly imported. Note that collectors and exporters are set to Not Enabled, and that (for security reasons) the export does not include data source instance information (that is, database connection details).

Anchor
_Toc404160357
_Toc404160357
Anchor
_Toc442889270
_Toc442889270
Techniques for creating test data

It is often useful to create some simple test data in a Stream when creating a new model. A useful technique for this is:

...

You will see that 10 records are created.
Extend this technique and use the random() function to generate some test data.

Anchor
_Toc404160358
_Toc404160358
Anchor
_Toc442889271
_Toc442889271
Use output filter instead of mandatory pipe

Update the model you built in exercise 6 to use an output filter to achieve the same thing as you did with a mandatory pipe in the original exercise.

Anchor
_Toc404160359
_Toc404160359
Anchor
_Toc442889272
_Toc442889272
Use input multiplier to pass list to query on external database

Re-work the example in exercise Error! Reference source not found. to pass the list of accounts to the database collector as a list, rather than a series of individual account numbers. This is a more efficient configuration, since the query will then only be run once (in fact, the entire Stream calculation will only be run once since the output of the input multiplier will now be a list of only one item – that item itself being a list).
Hint: you construct a list in CenterView with the [ … ] notation. If you are hard-coding a list this will look like:
["red", "green", "black"]
but if you are passed a thing that is already a list – as in this case, when the notation acc.ACCOUNT_NUM is a list of account numbers provided by the pipe acc, then using the notation
[acc.ACCOUNT_NUM]
creates a list of one item – the item itself being a list.

Anchor
_Toc442889273
_Toc442889273
Read excel spreadsheet with sub-headings

Find the spreadsheet C:\CenterView\train\inputData\AccountTransactions\AccountTransactions.xlsx. Open the spreadsheet and review the data. You will see that some lines, at the start of each section, have the details for the account – and all following lines omit these details, until the section for the next account starts.
Create a Stream to read in this data and populate, along with the transactions details, the account details for each record.
To do this:

...

AccountNumber == ""
rather than
AccountNum == _NULL

Anchor
_Toc442889274
_Toc442889274
Re-work cache extraction filter as attribute expression

Re-work the VAT rate lookup you did in exercise 14, using a Cache Extraction Filter – using an attribute expression instead.

  • Keep the Order/Index Attribute – this will find all VAT rates for the TRANS_DESCRIPTION of the transaction being processed.
  • Remove the Cache Extraction Filter, and use an attribute expression instead to find the VAT rate, from those supplied by the pipe for that TRANS_DESCRIPTION, that applies at the date of the transaction.

Anchor
_Toc442889275
_Toc442889275
Apply VAT Rates with no end date

Drag AM Trans Amounts and AM VAT Rates 2 onto a model. You will see that the VAT rates in AM VAT Rates 2 have no end date. So to find the rate that applies for a transaction, you need to find the rate with the latest START_DATE on or before the transaction date.
Create a Stream to find the VAT rate for each transaction and apply it to the transaction amount.
Hint:

...