private void populateAttributeTypeValue(AttributeType attributeType, OpaAttribute input) {
   switch (input.getValueType()) {
     case _NUMBER:
     case _CURRENCY:
       attributeType.setNumberVal(new BigDecimal(input.getValue()));
       break;
     case _BOOLEAN:
       attributeType.setBooleanVal(new Boolean(input.getValue()));
       break;
     case _DATE:
       attributeType.setDateVal(populateDate(input));
       break;
     case _TEXT:
       break;
     default:
       throw new RuntimeException("Unsupported AttributeType :" + input.getValueType());
   }
 }
  /**
   * constructs an assess-request like the following example:
   *
   * <p><typ:assess-request> <typ:global-instance> <typ:attribute id="base_premium"
   * outcome-style="value-only" /> <typ:attribute id="deductible">
   * <typ:number-val>100</typ:number-val> </typ:attribute> <typ:attribute id="insured_value">
   * <typ:number-val>1100</typ:number-val> </typ:attribute> <typ:attribute id="premium_rate">
   * <typ:number-val>0.05</typ:number-val> </typ:attribute> </typ:global-instance>
   * </typ:assess-request>
   *
   * @return
   * @param unknown
   * @param inputValues
   */
  public AssessRequest constructOpaAssessRequest(
      OpaAttribute unknown, List<OpaAttribute> inputValues) {

    AssessRequest request = new AssessRequest();
    GlobalInstanceType globalInstance = new GlobalInstanceType();
    request.setGlobalInstance(globalInstance);

    AttributeType unknown_Attribute = new AttributeType();
    unknown_Attribute.setOutcomeStyle(OutcomeStyleEnum.VALUE_ONLY);
    unknown_Attribute.setId(unknown.getName());
    globalInstance.getAttribute().add(unknown_Attribute);

    for (OpaAttribute input : inputValues) {
      AttributeType attributeType = new AttributeType();
      attributeType.setId(input.getName());
      populateAttributeTypeValue(attributeType, input);
      globalInstance.getAttribute().add(attributeType);
    }

    return request;
  }