【问题标题】:IBM ODM Dependant XOM classesIBM ODM 相关 XOM 类
【发布时间】:2020-06-18 15:52:06
【问题描述】:

您好,我有两个问题要问:-

我有一个这样的 XOM 类 -

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;
    }
}

当我部署它并使用“OPENAPI-JSON”REST 选项运行测试时,默认情况下我会得到这个输入 JSON(附加在此消息中):-

我不明白为什么会出现额外的“数量”、“价格”和“总金额”?在我的 XOM 中,我定义了“getPOQuanitity”、“getPOTotalAMount”、“getPOPrice”,对吗?所以只有“poquantity”、“poprice”、“pototalAmount”应该来吧?这个 OPENAPI-JSON 是如何形成的?如果有人可以帮助我澄清这一点,它对我们的测试也很有用。

  1. ) 我的规则中有一些打印语句。当我运行此 RestAPI 测试时,我在哪里可以找到 COnsole Print 语句?我没有在我的服务器日志中看到它们。

【问题讨论】:

    标签: websphere ibm-odm


    【解决方案1】:

    也许您可以尝试删除这部分课程:

    public PO(@BusinessName("price") double price, @BusinessName("quantity") int quantity,  @BusinessName("totalAmount") int totalAmount) {
    
            this();
            this.price = price;
            this.quantity = quantity;
            this.totalAmount = totalAmount;
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多