Touchstone 11.0 API Reference
SubmitDetailedLossAnalysis Method
Example 


Air.Services.Proxy Assembly > (Global) Namespace > LossAnalysisServiceClient Class : SubmitDetailedLossAnalysis Method
Contains a SubmitDetailedLossAnalysisRequest that identifies the Analysis Options associated with the Detailed Loss Analysis job that you want to run, along with the associated Business Unit SID and SQL Instance SID.
Submits a new Touchstone® Detailed Loss Analysis job.

The fundamental task of the Touchstone application is to analyze Project data. The Loss Analysis API enables you to improve the effectiveness and productivity of your catastrophic loss analyses by running multiple sensitivity analyses simultaneously. Input options include Event Sets, perils, and financial settings. Sensitivity analyses can vary Exposures or loss options.

You execute all analysis jobs against an Exposure View or Contract, and Touchstone stores the results in a Touchstone result Data Source (Database).

Syntax
Public Function SubmitDetailedLossAnalysis( _
   ByVal request As SubmitDetailedLossAnalysisRequest _
) As SubmitDetailedLossAnalysisResponse
Dim instance As LossAnalysisServiceClient
Dim request As SubmitDetailedLossAnalysisRequest
Dim value As SubmitDetailedLossAnalysisResponse
 
value = instance.SubmitDetailedLossAnalysis(request)

Parameters

request
Contains a SubmitDetailedLossAnalysisRequest that identifies the Analysis Options associated with the Detailed Loss Analysis job that you want to run, along with the associated Business Unit SID and SQL Instance SID.

Return Value

A SubmitDetailedLossAnalysisResponse containing the Activity SID that uniquely identifies the asynchronous web service call that you made to submit the specified Detailed Loss Analysis job.
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.

For information about retrieving the results of a Touchstone Detailed Loss Analysis, see the following methods:

For information about exporting the results of a Touchstone Detailed Loss Analysis, see the SubmitLossAnalysisExport() method.

Example
The following examples shows how to submit catastrophe detailed loss analysis jobs using the SubmitDetailedLossAnalysis() method:
// Detailed Loss with Custom Frequency and Custom Vulnerability Sets
 /// using System;
 using System.Collections.Generic;
 using AIR.InformationModel.ModelBuilder;
 using AIR.Services.Common.Data;
 using AIR.Services.LossAnalysis.Api;
 using AIR.Services.LossAnalysis.Data;
            
 class SnippetSubmitDetailedLossAnalysisWithCustomVulnerabilityRequest
 {
 private static void SubmitLossAnalysis(int businessUnitSid, int sqlInstanceSid, int projectSid, int exposureViewSid, int resultDsSid,
 string eventSetStandardName, string analysisName, string currency, int currencyExchangeRateSid, Listlt;CustomVulnerabilitySetgt; customVulnerabilitySets)
 {
 LossAnalysisServiceClient lossClient = new LossAnalysisServiceClient();
 SubmitDetailedLossAnalysisRequest request = new SubmitDetailedLossAnalysisRequest();
 request.BusinessUnitSid = businessUnitSid;
 request.SqlInstanceSid = sqlInstanceSid;
            
 Listlt;DemandSurgeRegionOptiongt; demandSurgeRegions = new Listlt;DemandSurgeRegionOptiongt;();
 demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 3 });
 demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 4 });
 demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 8 });
 demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 10 });
 demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 11, UseCustom = true }); //if custom curve is to be used for a specific region set the UseCustom to true
 demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 12 });
            
 request.AnalysisOptions = new DetailedLossAnalysisOptions()
     {
 Name = analysisName,
 ProjectSid = projectSid,
 Currency = currency,
 CurrencyExchangeRateSid = currencyExchangeRateSid,
 ExposureTarget = new AIR.Services.AnalysisCommon.Data.ExposureTarget()
       {
 Type = AIR.Services.AnalysisCommon.Data.ExposureTargetType.ExposureView,
 Sid = exposureViewSid
 },
 EarthquakeOptions = new EarthquakeLossOptions()
         {
 IsInducedEventsEnabled = false
 },
 Perils = PerilSetCode.Earthquake | PerilSetCode.FireFollowingEarthquake,
 PerilImpactFactors = new Listlt;PerilImpactFactorgt;() { new PerilImpactFactor() { Percentage = 10, PerilSetCode = AIR.Services.Common.Data.PerilSetCode.StormSurge, UserLineOfBusiness = "Commerical" } },
 EnableDemandSurge = true,
 DemandSurgeRegionOptions = demandSurgeRegions,
 FacultativeReinsuranceOptions = AIR.Services.LossAnalysis.Data.FacultativeReinsuranceOptions.ApplyInSerialToTreaties,
 ApplyDisaggregation = false,
 AveragePropertyOptions = AIR.Services.LossAnalysis.Data.AveragePropertyOptions.Off,
 IgnoreInvalidConstructionOccupancyCode = true,
 EventSetStandardName = eventSetStandardName,
 ResultDataSourceSid = resultDsSid,
 Note: If you set the EventDetail to Layer and the FinancialPerspective to GrossPreLayer, you must set the GeographyDetail to None.
 OutputOptions = new LossAnalysisOutputOptions()
        {
 EventDetail = AIR.Services.LossAnalysis.Data.EventDetail.Portfolio,
 AverageAnnualLossSummary = AverageAnnualLossSummaryOption.Contract,
 FinancialPerspectives = FinancialPerspectives.GroundUp | FinancialPerspectives.Retained |
 FinancialPerspectives.NetPreCatastrophe | FinancialPerspectives.Gross,
 GeographyDetail = GeographyDetail.SubArea,
 ByModel = true,
 ByPeril = true,
 },
 // ScheduledTime = DateTime.UtcNow.AddHours(2),
 // Priority = JobPriority.High
 IsApplyAIRAnalysis = true // AIR Analysis optional flag(on/off) 
 };
 
    //Custom Vulnerability
    if (customVulnerabilitySets?.Count > 0)
    {
 request.AnalysisOptions.IsSelectedVulnerabilitySet = true;
 request.AnalysisOptions.LossVulnerabilitySetSIDs = new Listlt;intgt;();
 request.AnalysisOptions.SelectedLossVulnerabilitySets = new Listlt;VulnerabilityModificationSetgt;();
         foreach (var customVulnerabilitySet in customVulnerabilitySets)
         {
 request.AnalysisOptions.SelectedLossVulnerabilitySets.Add(
 new VulnerabilityModificationSet()
               {
 ModelCode = customVulnerabilitySet.ModelCode,
 VulnerabilitySetName = customVulnerabilitySet.VulnerabilitySetName,
 VulnerabilitySetSid = customVulnerabilitySet.Sid
 });
 request.AnalysisOptions.LossVulnerabilitySetSIDs.Add(customVulnerabilitySet.Sid);
 }
 }
 SubmitDetailedLossAnalysisResponse response = lossClient.SubmitDetailedLossAnalysis(request);
    if (response.Status.Code == StatusCode.Success)
 Console.WriteLine("Request successfully Submitted with Activity Sid: " + response.ActivitySid);
 }
 }  
 //Catastrophe only
using System;
using System.Collections.Generic;
using AIR.Services.Common.Data;
using AIR.Services.LossAnalysis.Api;
using AIR.Services.LossAnalysis.Data;
            
class SnippetSubmitDetailedLossAnalysisRequest
{
    private static void SubmitLossAnalysis(int businessUnitSid, int sqlInstanceSid, int projectSid, int exposureViewSid, int resultDsSid,
                        string eventSetStandardName, string analysisName, string currency, int currencyExchangeRateSid)
    {
        LossAnalysisServiceClient lossClient = new LossAnalysisServiceClient();
        SubmitDetailedLossAnalysisRequest request = new SubmitDetailedLossAnalysisRequest();
        request.BusinessUnitSid = businessUnitSid;
        request.SqlInstanceSid = sqlInstanceSid;
            
        List<DemandSurgeRegionOption> demandSurgeRegions = new List<DemandSurgeRegionOption>();
        demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 3 });
        demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 4 });
        demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 8 });
        demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 10 });
        demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 11, UseCustom = true }); //if custom curve is to be used for a specific region set the UseCustom to true
        demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 12 });
            
        request.AnalysisOptions = new DetailedLossAnalysisOptions()
        {
            Name = analysisName,
            ProjectSid = projectSid,
            Currency = currency,
            CurrencyExchangeRateSid = currencyExchangeRateSid,
            ExposureTarget = new AIR.Services.AnalysisCommon.Data.ExposureTarget()
            {
                Type = AIR.Services.AnalysisCommon.Data.ExposureTargetType.ExposureView,
                Sid = exposureViewSid
            },
            EarthquakeOptions = new EarthquakeLossOptions()
            {
                IsInducedEventsEnabled = false
            },
            Perils = PerilSetCode.Earthquake | PerilSetCode.FireFollowingEarthquake,
            PerilImpactFactors = new List<PerilImpactFactor>() { new PerilImpactFactor() { Percentage = 10, PerilSetCode = AIR.Services.Common.Data.PerilSetCode.StormSurge, UserLineOfBusiness = "Commerical" } },
            EnableDemandSurge = true,
            DemandSurgeRegionOptions = demandSurgeRegions,
            FacultativeReinsuranceOptions = AIR.Services.LossAnalysis.Data.FacultativeReinsuranceOptions.ApplyInSerialToTreaties,
            ApplyDisaggregation = false,
            AveragePropertyOptions = AIR.Services.LossAnalysis.Data.AveragePropertyOptions.Off,
            IgnoreInvalidConstructionOccupancyCode = true,
            EventSetStandardName = eventSetStandardName,
            ResultDataSourceSid = resultDsSid,
            //Note: If you set the EventDetail to Layer and the FinancialPerspective to GrossPreLayer, you must set the GeographyDetail to None.
            OutputOptions = new LossAnalysisOutputOptions()
            {
                EventDetail = AIR.Services.LossAnalysis.Data.EventDetail.Portfolio,
                AverageAnnualLossSummary = AverageAnnualLossSummaryOption.Contract,
                FinancialPerspectives = FinancialPerspectives.GroundUp | FinancialPerspectives.Retained |
                                        FinancialPerspectives.NetPreCatastrophe | FinancialPerspectives.Gross,
                GeographyDetail = GeographyDetail.SubArea,
                ByModel = true,
                ByPeril = true,
            },
            //ScheduledTime = DateTime.UtcNow.AddHours(2),
            //Priority = JobPriority.High
        };
        SubmitDetailedLossAnalysisResponse response = lossClient.SubmitDetailedLossAnalysis(request);
        if (response.Status.Code == StatusCode.Success)
            Console.WriteLine("Request successfully Submitted with Activity Sid: " + response.ActivitySid);
    }
}
//Catastrophe and non-catastrophe
using System;
using System.Collections.Generic;
using AIR.Services.Common.Data;
using AIR.Services.LossAnalysis.Api;
using AIR.Services.LossAnalysis.Data;
             
class SnippetSubmitDetailedLossAnalysisRequest
{
    private static void SubmitLossAnalysis(int businessUnitSid, int sqlInstanceSid, int projectSid, int exposureViewSid, int resultDsSid,
                                            string eventSetStandardName, string analysisName, string currency, int currencyExchangeRateSid)
    {
                LossAnalysisServiceClient lossClient = new LossAnalysisServiceClient();
                SubmitDetailedLossAnalysisRequest request = new SubmitDetailedLossAnalysisRequest();
                request.BusinessUnitSid = businessUnitSid;
                request.SqlInstanceSid = sqlInstanceSid;
            
                List<DemandSurgeRegionOption> demandSurgeRegions = new List<DemandSurgeRegionOption>();
                demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 3 });
                demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 4 });
                demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 8 });
                demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 10 });
                demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 11, UseCustom = true }); //if custom curve is to be used for a specific region set the UseCustom to true
                demandSurgeRegions.Add(new DemandSurgeRegionOption() { RegionCode = 12 });
            
                request.AnalysisOptions = new DetailedLossAnalysisOptions()
                {
                    Name = analysisName,
                    ProjectSid = projectSid,
                    Currency = currency,
                    CurrencyExchangeRateSid = currencyExchangeRateSid,
                    ExposureTarget = new AIR.Services.AnalysisCommon.Data.ExposureTarget()
                    {
                        Type = AIR.Services.AnalysisCommon.Data.ExposureTargetType.ExposureView,
                        Sid = exposureViewSid
                    },
                    Perils = PerilSetCode.Earthquake | PerilSetCode.FireFollowingEarthquake,
                    PerilImpactFactors = new List>PerilImpactFactor>() { new PerilImpactFactor() { Percentage = 10, PerilSetCode = AIR.Services.Common.Data.PerilSetCode.StormSurge, UserLineOfBusiness = "Commerical" } },
                    EnableDemandSurge = true,
                    DemandSurgeRegionOptions = demandSurgeRegions,
                    FacultativeReinsuranceOptions = AIR.Services.LossAnalysis.Data.FacultativeReinsuranceOptions.ApplyInSerialToTreaties,
                    ApplyDisaggregation = false,
                    AveragePropertyOptions = AIR.Services.LossAnalysis.Data.AveragePropertyOptions.Off,
                    IgnoreInvalidConstructionOccupancyCode = true,
                    EventSetStandardName = eventSetStandardName,
                    ResultDataSourceSid = resultDsSid,
                    OutputOptions = new LossAnalysisOutputOptions()
                    {
                        EventDetail = AIR.Services.LossAnalysis.Data.EventDetail.Portfolio,
                        AverageAnnualLossSummary = AverageAnnualLossSummaryOption.Contract,
                        FinancialPerspectives = FinancialPerspectives.GroundUp | FinancialPerspectives.Retained |
                               FinancialPerspectives.NetPreCatastrophe | FinancialPerspectives.Gross,
                        GeographyDetail = GeographyDetail.SubArea,
                        ByModel = true,
                        ByPeril = true,
                    },
                    LossAnalysisType = "CatAndNonCat",
                    NonCatOptions = new NonCatOptions()
                    {
                        GroundUpOptions = new NonCatGroundUpOptions()
                        {
                            CalculatorOptions = new NonCatISOLossCostCalculator()
                            {
                                PerilGroups = "Both",
                                UnknownFireSprinkler = false,
                                UnknownPublicProtectionClass = "5",
                            },
                            OverwriteGroundUpLoss = false
                        },
                        DistributeLossesToLayersOptions = new NonCatPSOLDDistributeLossesToLayersOptions()
                        {
                            CoverageFormCommercial = "BuildingsContents",
                            LossTrendCommercial = new NonCatLossTrend()
                            {
                                AnnualTrendFactor = 1.00m,
                                To = DateTime.Now
                            },
                            LossTrendResidential = new NonCatLossTrend()
                            {
                                AnnualTrendFactor = 1.00m,
                                To = DateTime.Now
                            },
                            AOITrend = new NonCatAOITrend()
                            {
                                InForceDate = DateTime.Parse("01/01/2014"),
                                AveragePolicyDate = DateTime.Parse("12/31/2014"),
                                TrendFactor = 1.00m,
                                AdjustmentFactor = 1.00m,
                                PercentCapHomeowner = 2.5m,
                                PercentCapCommercial = 3.0m,
                                SelectedPSOLDScalingFactor = 1.00m
                            },
                            CountrywideOverride = true,
                            HomeOwnersForm = "Both",
                            DeductibleSettings = "ExposureData"
                        }
                    }
                };
                SubmitDetailedLossAnalysisResponse response = lossClient.SubmitDetailedLossAnalysis(request);
                if (response.Status.Code == StatusCode.Success)
                    Console.WriteLine("Request successfully Submitted with Activity Sid: " + response.ActivitySid);
            }
        }
}
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

LossAnalysisServiceClient Class
LossAnalysisServiceClient Members