1

HI I have two questions to ask :-

I have a XOM class like this -

package com.ibm.p2p;
import javax.xml.bind.annotation.XmlElement;
import ilog.rules.bom.annotations.BusinessName;
import ilog.rules.bom.annotations.CustomProperty;
public class PO {

    @XmlElement
    private int quantity;
    @XmlElement
    private double price;
    @XmlElement
    private double totalAmount;

    public PO() {

    }

    @CustomProperty(name = "dataio.default", value = "true")
    public PO(@BusinessName("price") double price, @BusinessName("quantity") int quantity,  @BusinessName("totalAmount") int totalAmount) {

        this();
        this.price = price;
        this.quantity = quantity;
        this.totalAmount = totalAmount;
    }
    public int getPOQuantity() {
        return quantity;
    }
    public void setPOQuantity(int quantity) {
        this.quantity = quantity;
    }
    public double getPOPrice() {
        return price;
    }
    public void setPOPrice(double price) {
        this.price = price;
    }
    public double getPOTotalAmount() {
        return totalAmount;
    }
    public void setPOTotalAmount(double totalAmount) {
        this.totalAmount = totalAmount;
    }
}

When I deploy this and run the TEST using the "OPENAPI-JSON" REST option , by default I get this input JSON (attached in this message) :-

JSON Input in testing

I dont understant why does the extra "quantity", "price" and "totalAMount" comes ?? In my XOM I have defined "getPOQuanitity", "getPOTotalAMount","getPOPrice" right? So only "poquantity", "poprice", "pototalAmount" should come right? How is this OPENAPI-JSON getting formed? If anyone can help me clarifying this , it will be useful for our testing also.

  1. ) I have some Print statements in my Rule. When I run this RestAPI Test where can I find the COnsole Print statements? I dont see them in my Server logs.

1 Answers1

1

maybe you can try removing this part of the class:

public PO(@BusinessName("price") double price, @BusinessName("quantity") int quantity,  @BusinessName("totalAmount") int totalAmount) {

        this();
        this.price = price;
        this.quantity = quantity;
        this.totalAmount = totalAmount;
    }
MatiasG
  • 1,140
  • 9
  • 20