Touchstone 11.0 API Reference
CreatePortfolioDynamic Method
Example 


Air.Services.Proxy Assembly > (Global) Namespace > ReinsurancePortfolioManagementServiceClient Class : CreatePortfolioDynamic Method
Contains a CreatePortfolioDynamicRequest that identifies the name, description, and Filter for the dynamic portfolio to create, as well as the Business Unit Sequential Identifier (SID) and and SQL Instance SID associated with the portfolio.
Creates a new Touchstone Re Dynamic Portfolio.

A portfolio in Touchstone Re is a collection of reinsurance treaties (or Layers) sourced from various Reinsurance Programs. There are three types of portfolios: master, static, and dynamic.

The master portfolio contains all the treaties in the business unit. A static portfolio is a collection of reinsurance treaties that you explicitly select from the master portfolio. A dynamic portfolio is a collection of reinsurance treaties that you select from the master portfolio by defining a filter. As treaties are added, modified, and removed from the master portfolio, the content of the dynamic portfolio changes automatically.

Syntax
Public Function CreatePortfolioDynamic( _
   ByVal request As CreatePortfolioDynamicRequest _
) As CreatePortfolioDynamicResponse
Dim instance As ReinsurancePortfolioManagementServiceClient
Dim request As CreatePortfolioDynamicRequest
Dim value As CreatePortfolioDynamicResponse
 
value = instance.CreatePortfolioDynamic(request)
public CreatePortfolioDynamicResponse CreatePortfolioDynamic( 
   CreatePortfolioDynamicRequest request
)

Parameters

request
Contains a CreatePortfolioDynamicRequest that identifies the name, description, and Filter for the dynamic portfolio to create, as well as the Business Unit Sequential Identifier (SID) and and SQL Instance SID associated with the portfolio.

Return Value

A CreatePortfolioDynamicResponse containing the Portfolio SID for the dynamic portfolio that you created.
Remarks
To find the Business Unit SID to pass into this method, call the GetBusinessUnits() method.

To find the SQL Instance SID to pass into this method, call the GetSqlInstances() method.

Example
The following example shows how to create a dynamic portfolio using the CreatePortfolioDynamic() method:
using AIR.Services.Common.Data;
using AIR.Services.Common.Filter.Data;
using AIR.Services.Reinsurance.PortfolioManagement.Api;
using System;
using System.Collections.Generic;
            
class SnippetPortfolioAPIs
{
    private static void CreatePortfolioDynamic(int businessUnitSid, int sqlInstanceSid, string name)
    {
        ReinsurancePortfolioManagementServiceClient client = new ReinsurancePortfolioManagementServiceClient();
            
        CreatePortfolioDynamicRequest request = new CreatePortfolioDynamicRequest();
        //Set the BusinessUnitSid property (required property)
        request.BusinessUnitSid = businessUnitSid;
        //Set the SqlInstanceSid property (required property)
        request.SqlInstanceSid = sqlInstanceSid;
        //Set the Name property. (required property)
        request.Name = name;
        //Set the Description property. (optional property)
        request.Description = "Created by API";
        request.Filter = GetFilter();
        //Submit the request and get response back
        CreatePortfolioDynamicResponse response = client.CreatePortfolioDynamic(request);
        //Validate the response. Response is valid if Response.Status.Code is equal to StatusCode.Success
        if (response.Status.Code == StatusCode.Success)
        {
            Console.WriteLine("Portfolio created with SID: " + response.PortfolioSid);
        }
    }
            
    private static Filter GetFilter()
    {
        //Create the first composite expression 
        CompositeExpression expression = new CompositeExpression()
        {
            //Set the FilterExpressions property. FilterExpressions consist of a list of simple or composite expressions
            FilterExpressions = new List<FilterExpression>()
                {
                    new SimpleExpression()
                    {
                        //Set the AppliedEntity property. Refer to the developers guide for valid options (required property)
                        AppliedEntity = "ViewReinsuranceTreatyDetails",
                        //Set the PropertyName property. The property values are based on the AppliedEntity property. 
                        //Refer to the developers guide for valid options (required property)
                        //https://www.air-worldwide.com/Documentation/APIs/TouchstoneRe/7.1/webframe.html#topic360.html
                        PropertyName = "CompanyName",
                        //Set the Operator property. The property values are based on the PropertyName property. 
                        //Refer to the developers guide for valid options (required property)
                        Operator = FilterOperator.IsNotEqualTo,
                        //Set the Value property. The data type of the property is based on the PropertyName property.
                        //Refer to the developers guide for valid options (required property)
                        Value = "Test"
                    }
                },
            LogicalOperator = LogicalOperator.And
        };
        //Add the filter to a list and return. R1 supports one filter expression in the filters collection
        return new Filter() { Expression = expression };
    }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ReinsurancePortfolioManagementServiceClient Class
ReinsurancePortfolioManagementServiceClient Members