package psdi.app.workorder;
import java.rmi.RemoteException;

import psdi.common.role.MaxRole;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.workflow.*;

public class IsCollectMat extends CustomCondition
        implements CustomConditionInterface {
    /**
     * @deprecated
     */
    public boolean evaluateCustomCondition(MaxRole roleMbo, MboRemote currentMbo) throws MXException, RemoteException {
        String mboname = currentMbo.getName();
        boolean fors = true;
        if (mboname.equalsIgnoreCase("WORKORDER")) {
            //先判断是否策划了物料 Begin
            MboSetRemote lineSet = currentMbo.getMboSet("SHOWPLANMATERIAL");
            if(lineSet != null){
                if(lineSet.isEmpty()){
                    fors = false;
                }else{
                    int iCount = lineSet.count();
                    fors =(iCount > 0)?true:false;
                }
            }else {
                fors = false;
            }
            //先判断是否策划了物料 End
        }
        return fors;
    }
}