package com.zt.plat.module.qms.business.bus.liteflow.sample.entrust;

import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeBooleanComponent;

import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustRegistrationDO;
import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext;

@LiteflowComponent(id = "sampleEntrustIsCreateCmp", name = "委托登记是否为创建")
public class SampleEntrustIsCreateCmp extends NodeBooleanComponent {

	@Override
	public boolean processBoolean() throws Exception {
		//获取样品委托上下文
		SampleEntrustContext sampleEntrustContext = this.getContextBean(SampleEntrustContext.class);
		//样品委托
		BusinessSampleEntrustRegistrationDO sampleEntrustRegistration = sampleEntrustContext.getSampleEntrustRegistration();
		//如果委托登记id为空，则为创建
		return sampleEntrustRegistration.getId() == null;
	}

}
