01: package org.osbl.riskmanagement.process;
02:
03: import org.concern.library.generic.FormClassNameActivity;
04: import org.concern.controller.ActivityExecutionException;
05: import org.osbl.riskmanagement.model.Risk;
06: import org.osbl.riskmanagement.model.Record;
07: import org.osbl.identity.model.Identity;
08:
09: import java.sql.Timestamp;
10: import java.math.BigDecimal;
11: import java.util.List;
12: import java.util.ArrayList;
13:
14: public class Qualify extends FormClassNameActivity<Risk> {
15: @Override
16: public void delist(Risk risk) throws ActivityExecutionException {
17: /*PROTECTED REGION ID(org.osbl.riskmanagement.process.Qualify.delist) ENABLED START*/
18: Identity assignee = risk.getAssignee();
19: BigDecimal coverage = risk.getCoverage();
20: BigDecimal amount = risk.getAmount();
21: BigDecimal probability = risk.getProbability();
22:
23: if (assignee != null && coverage != null && amount != null
24: && probability != null) {
25: Record record = new Record();
26: record.setTimestamp(new Timestamp(System
27: .currentTimeMillis()));
28: record.setCoverage(coverage);
29: record.setAmount(amount);
30: record.setProbability(probability);
31: record.setComment(risk.getComment());
32: List<Record> progression = new ArrayList<Record>();
33: progression.add(record);
34: risk.setProgression(progression);
35: System.out.println("first record: " + record);
36: }
37: /*PROTECTED REGION END*/
38: }
39: }
|