| name | guidewire-core-workflow-b |
| description | Execute Guidewire secondary workflow: Claims processing in ClaimCenter.
Use when implementing FNOL, claim investigation, reserves, payments, and settlement.
Trigger with phrases like "claimcenter workflow", "create claim", "file fnol",
"process claim", "claim settlement", "claim payment".
|
| allowed-tools | Read, Write, Edit, Bash(curl:*), Bash(npm:*), Grep |
| version | 1.0.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
Guidewire Core Workflow B: Claims Processing
Overview
Master the complete claims lifecycle in ClaimCenter: First Notice of Loss (FNOL), claim investigation, reserve setting, payments, and settlement.
Prerequisites
- Completed
guidewire-install-auth and guidewire-core-workflow-a
- Understanding of claims handling processes
- Valid API credentials with claims admin permissions
Claims Lifecycle States
FNOL → Open → Investigation → Evaluation → Negotiation → Settlement → Closed
| | | | | | |
v v v v v v v
[Draft] [Open] [Reserve] [Exposure] [Payment] [Settle] [Closed]
Instructions
Step 1: Create FNOL (First Notice of Loss)
interface FNOLRequest {
data: {
attributes: {
lossDate: string;
lossTime?: string;
reportedDate: string;
lossType: { code: string };
lossCause: { code: string };
description: string;
policyNumber: string;
lossLocation?: {
addressLine1: string;
city: string;
state: { code: string };
postalCode: string;
};
reporter?: {
firstName: string;
lastName: string;
primaryPhone: string;
relationship: { code: string };
};
};
};
}
async function createFNOL(fnolData: FNOLData): Promise<Claim> {
const request: FNOLRequest = {
: {
: {
: fnolData.,
: fnolData.,
: ().().()[],
: { : fnolData. },
: { : fnolData. },
: fnolData.,
: fnolData.,
: {
: fnolData..,
: fnolData..,
: { : fnolData.. },
: fnolData..
},
: {
: fnolData..,
: fnolData..,
: fnolData..,
: { : }
}
}
}
};
response = claimCenterClient.<{ : }>(
,
,
request
);
.();
response.;
}
Step 2: Add Exposures
interface ExposureRequest {
data: {
attributes: {
exposureType: { code: string };
lossParty: { code: string };
primaryCoverage: { code: string };
claimant?: { id: string };
incident?: { id: string };
};
};
}
async function addExposure(
claimId: string,
exposureData: ExposureData
): Promise<Exposure> {
const request: ExposureRequest = {
data: {
attributes: {
exposureType: { code: exposureData.type },
lossParty: { code: exposureData.lossParty },
primaryCoverage: { code: exposureData.coverageCode },
claimant: exposureData.claimantId ? { id: exposureData.claimantId } : undefined
}
}
};
response = claimCenterClient.<{ : }>(
,
,
request
);
response.;
}
Step 3: Add Incidents
interface VehicleIncidentRequest {
data: {
attributes: {
severity: { code: string };
description: string;
vehicle: {
vin?: string;
year: number;
make: string;
model: string;
color?: string;
licensePlate?: string;
};
damageDescription: string;
airbagDeployed?: boolean;
vehicleOperable?: boolean;
};
};
}
async function addVehicleIncident(
claimId: string,
vehicleData: VehicleIncidentData
): Promise<VehicleIncident> {
const request: VehicleIncidentRequest = {
data: {
attributes: {
severity: { code: vehicleData.severity },
description: vehicleData.description,
: {
: vehicleData.,
: vehicleData.,
: vehicleData.,
: vehicleData.,
: vehicleData.
},
: vehicleData.,
: vehicleData.,
: vehicleData.
}
}
};
response = claimCenterClient.<{ : }>(
,
,
request
);
response.;
}
Step 4: Set Reserves
interface ReserveRequest {
data: {
attributes: {
reserveLine: { code: string };
costType: { code: string };
costCategory: { code: string };
newAmount: { amount: number; currency: string };
comments: string;
};
};
}
async function setReserve(
claimId: string,
exposureId: string,
reserveData: ReserveData
): Promise<Reserve> {
const request: ReserveRequest = {
data: {
attributes: {
reserveLine: { code: reserveData.reserveLine },
costType: { code: reserveData.costType },
costCategory: { code: reserveData.costCategory },
newAmount: {
amount: reserveData.amount,
currency:
},
: reserveData.
}
}
};
response = claimCenterClient.<{ : }>(
,
,
request
);
.();
response.;
}
Step 5: Create Payment
interface PaymentRequest {
data: {
attributes: {
paymentType: { code: string };
exposure: { id: string };
payee: {
payeeType: { code: string };
claimContact?: { id: string };
payeeName?: string;
};
reserveLine: { code: string };
costType: { code: string };
costCategory: { code: string };
amount: { amount: number; currency: string };
comments?: string;
paymentMethod?: { code: string };
};
};
}
async function createPayment(
claimId: string,
paymentData: PaymentData
): Promise<Payment> {
const request: PaymentRequest = {
data: {
: {
: { : paymentData. },
: { : paymentData. },
: {
: { : paymentData. },
: paymentData.
? { : paymentData. }
:
},
: { : },
: { : paymentData. },
: { : paymentData. },
: { : paymentData., : },
: paymentData.,
: { : paymentData. || }
}
}
};
response = claimCenterClient.<{ : }>(
,
,
request
);
.();
response.;
}
Step 6: Close Exposure
async function closeExposure(
claimId: string,
exposureId: string,
outcome: string
): Promise<Exposure> {
const response = await claimCenterClient.request<{ data: Exposure }>(
'POST',
`/claim/v1/claims/${claimId}/exposures/${exposureId}/close`,
{
data: {
attributes: {
closedOutcome: { code: outcome }
}
}
}
);
return response.data;
}
Step 7: Close Claim
async function closeClaim(claimId: string): Promise<Claim> {
const response = await claimCenterClient.request<{ data: Claim }>(
'POST',
`/claim/v1/claims/${claimId}/close`,
{
data: {
attributes: {
closedOutcome: { code: 'completed' }
}
}
}
);
console.log(`Closed claim: ${response.data.claimNumber}`);
return response.data;
}
Gosu Implementation
// Complete claims workflow in Gosu
package gw.custom.claim
uses gw.api.util.Logger
uses gw.cc.claim.Claim
uses gw.cc.exposure.Exposure
uses gw.transaction.Transaction
class ClaimWorkflow {
private static final var LOG = Logger.forCategory("ClaimWorkflow")
static function createClaim(
policyNumber : String,
lossDate : Date,
lossType : LossType,
description : String
) : Claim {
return Transaction.runWithNewBundle(\bundle -> {
// Find policy
var policy = findPolicy(policyNumber)
if (policy == null) {
throw new IllegalArgumentException("Policy not found: ${policyNumber}")
}
// Create claim
var claim = new Claim(bundle)
claim.Policy = policy
claim.LossDate = lossDate
claim.LossType = lossType
claim.Description = description
claim.ReportedDate = Date.Today
claim.LossCause = LossCause.TC_VEHCOLLISION
// Set claim to open
claim.open()
LOG.info("Created claim: ${claim.ClaimNumber}")
return claim
})
}
static function addVehicleExposure(
claim : Claim,
vehicle : Vehicle,
coverageCode : String
) : Exposure {
return Transaction.runWithNewBundle(\bundle -> {
var claim = bundle.add(claim)
// Create vehicle incident
var incident = new VehicleIncident(bundle)
incident.Claim = claim
incident.Vehicle = vehicle
incident.Description = "Vehicle damage from ${claim.LossCause.DisplayName}"
// Create exposure
var exposure = new Exposure(bundle)
exposure.Claim = claim
exposure.ExposureType = ExposureType.TC_VEHICLEDAMAGE
exposure.LossParty = LossPartyType.TC_INSURED
exposure.PrimaryCoverage = CoverageType.get(coverageCode)
exposure.VehicleIncident = incident
LOG.info("Created exposure: ${exposure.ExposureType.DisplayName}")
return exposure
})
}
static function setExposureReserve(
exposure : Exposure,
amount : java.math.BigDecimal,
reserveLine : ReserveLine
) {
Transaction.runWithNewBundle(\bundle -> {
var exp = bundle.add(exposure)
var reserve = new Reserve(bundle)
reserve.Exposure = exp
reserve.ReserveLine = reserveLine
reserve.CostType = CostType.TC_CLAIMCOST
reserve.CostCategory = CostCategory.TC_BODY
reserve.NewAmount = new gw.api.financials.CurrencyAmount(amount, Currency.TC_USD)
reserve.Comments = "Initial reserve set"
LOG.info("Set reserve: ${amount} on ${exp.ExposureType.DisplayName}")
})
}
static function createPayment(
exposure : Exposure,
amount : java.math.BigDecimal,
payee : Contact,
paymentType : PaymentType
) : Payment {
return Transaction.runWithNewBundle(\bundle -> {
var exp = bundle.add(exposure)
var payment = new Payment(bundle)
payment.Exposure = exp
payment.Claim = exp.Claim
payment.PaymentType = paymentType
payment.ReserveLine = ReserveLine.TC_INDEMNITY
payment.CostType = CostType.TC_CLAIMCOST
payment.CostCategory = CostCategory.TC_BODY
payment.Payee = payee
payment.GrossAmount = new gw.api.financials.CurrencyAmount(amount, Currency.TC_USD)
// Submit for approval
payment.submit()
LOG.info("Created payment: ${amount} to ${payee.DisplayName}")
return payment
})
}
static function closeClaim(claim : Claim, outcome : CloseOutcome) {
Transaction.runWithNewBundle(\bundle -> {
var c = bundle.add(claim)
// Close all open exposures first
c.Exposures
.where(\e -> e.State == ExposureState.TC_OPEN)
.each(\e -> {
e.close(outcome)
})
// Close claim
c.close(outcome)
LOG.info("Closed claim: ${c.ClaimNumber}")
})
}
}
Output
- FNOL claim with claim number
- Exposures linked to coverages
- Reserves set on exposures
- Payments processed
- Claim closed with outcome
Error Handling
| Error | Cause | Solution |
|---|
Policy not found | Invalid policy number | Verify policy number and status |
Coverage not applicable | Wrong coverage type | Check policy coverages |
Reserve exceeds limit | Over policy limit | Adjust to policy limits |
Payment validation | Missing required fields | Check payee and amount |
Cannot close | Open activities/exposures | Complete pending items |
Claim Types and Loss Causes
const lossTypes = {
AUTO: ['vehcollision', 'vehglass', 'vehtheft', 'vehvandalism'],
PROPERTY: ['fire', 'water', 'theft', 'weather'],
LIABILITY: ['bodily_injury', 'property_damage', 'personal_injury'],
WORKERS_COMP: ['injury', 'illness', 'death']
};
function getDefaultExposures(lossType: string, lossCause: string): string[] {
if (lossType === 'AUTO' && lossCause === 'vehcollision') {
return ['VehicleDamage', 'BodilyInjury', 'PropertyDamage'];
}
return [];
}
Resources
Next Steps
For error handling patterns, see guidewire-common-errors.