Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The new data object class must extend com.crm.dataobjectprocess.ViewObjectProcessRunDefinition class and must implement override both getViewMandatoryFields() and getAssociatedObjects() methods. The associated objects will be used by setMandatoryFields() method of com.crm.dataobject.ViewObject for mandatory field calculation. This method calculates the associated objects' mandatory fields and along with the ones defined in getViewMandatoryFields() method it constructs the new data object's defaultMandatoryFields linked hash map.

...

Code Block
themeEclipse
languagejava
titleRewardSettlementRunDefinition.java
linenumberstrue
collapsetrue
public class RewardSettlementRunDefinition extends ViewObject ProcessRunDefinition{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private CRMDOProcessRunDefinition processRunDefinition;
	private SchedulerTask schedulerTask;
	//input settings
	private RewardSettlementType rewardSettlementType;
	//criteria
	private Set<RewardSchemeCriterion> schemeCriteria;
	private Integer daysAgo;

	public CRMDOProcessRunDefinition getProcessRunDefinition() {
		return processRunDefinition;
	}
	public void setProcessRunDefinition(CRMDOProcessRunDefinition processRunDefinition) {
		this.processRunDefinition = processRunDefinition;
	}
	public SchedulerTask getSchedulerTask() {
		return schedulerTask;
	}
	public void setSchedulerTask(SchedulerTask schedulerTask) {
		this.schedulerTask = schedulerTask;
	}
	public RewardSettlementType getRewardSettlementType() {
		return rewardSettlementType;
	}
	public void setRewardSettlementType(RewardSettlementType rewardSettlementType) {
		this.rewardSettlementType = rewardSettlementType;
	}
	public Set<RewardSchemeCriterion> getSchemeCriteria() {
		return schemeCriteria;
	}
	public void setSchemeCriteria(Set<RewardSchemeCriterion> schemeCriteria) {
		this.schemeCriteria = schemeCriteria;
	}
	public Integer getDaysAgo() {
		return daysAgo;
	}
	public void setDaysAgo(Integer daysAgo) {
		this.daysAgo = daysAgo;
	}
	
	@Override
	protected LinkedHashMap<String, CRMDO> getAssociatedDataObjects() {
		LinkedHashMap<String, CRMDO> dataObjects=new LinkedHashMap<String, CRMDO>();
		
		dataObjects.put("processRunDefinition", getProcessRunDefinition());
		
		return dataObjects;
	}
	@Override
	public LinkedHashMap<String, String> getViewMandatoryFields() {
		LinkedHashMap<String, String> viewMandatoryFields = new LinkedHashMap<String, String>();
		
		viewMandatoryFields.put( "rewardSettlementType", "key_reward_settlement_type");
		return viewMandatoryFields;
	}

...