...
In order to implement a process run definition, you need to create:
- A Create a new data object class extending com.crm.dataobject.ViewObject class.
- Create five new summary pages.
- Create a new data entry page.
- A Create a new user interface class extending com.crm.process.processrun.CRMUIProcessRunDefinitionBean class.
- A Create a new class extending com.crm.businessobject.processrun.ProcessRunDefinitionXMLUtilBean class, to save and load any criteria, action inputs and/or scheduling settings.
- Five new summary pages.
- A new data entry page.
- Define the process in modules metadata file.
the first thing to do is to create a new module in metadata. This new module has a module id and a new feature with its own process id and a method that will be explained later. The next step is to create a Java class smsMessageRunDefintion which extends viewObject class. It is includes a processRunDefinition and a schedulerTask objects which are necessary for a process run definition. Then, some action inputs should be defined to specify certain fields that describe a process run (broadcastPeriod, broadcastInterval etc.) whilst some criteria if are available. The example below, illustrates the java class, ass was explained:
...
Create Data Object Class
The new data object class must extend com.crm.dataobject.ViewObject class and must implement 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.
A com.crm.process.utilities.SchedulerTask object must be defined as well, in order for the process run definition to be handled by the scheduler mechanism.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
public class smsMessageRunDefintion extends ViewObject{
private static final long serialVersionUID = 1L;
private CRMDOProcessRunDefinition processRunDefinition;
private SchedulerTask schedulerTask;
//Action inputs
private MessageType messageType;
private CRMDOCommunicationQueueExternalSystem communicationQueueExternalSystem;
private Integer broadcastPeriod;
private Integer broadcastInterval;
private Integer processImmediately;
//Criteria - Not any available
//Get and Set methods
public CRMDOProcessRunDefinition getProcessRunDefinition() {
return processRunDefinition;
}
public void setProcessRunDefinition(
CRMDOProcessRunDefinition processRunDefinition) {
this.processRunDefinition = processRunDefinition;
}
public MessageType getMessageType() {
return messageType;
}
public void setMessageType(MessageType messageType) {
this.messageType = messageType;
}
public CRMDOCommunicationQueueExternalSystem getCommunicationQueueExternalSystem() {
return communicationQueueExternalSystem;
}
public void setCommunicationQueueExternalSystem(
CRMDOCommunicationQueueExternalSystem communicationQueueExternalSystem) {
this.communicationQueueExternalSystem = communicationQueueExternalSystem;
}
public Integer getBroadcastPeriod() {
return broadcastPeriod;
}
public void setBroadcastPeriod(Integer broadcastPeriod) {
this.broadcastPeriod = broadcastPeriod;
}
public Integer getBroadcastInterval() {
return broadcastInterval;
}
public void setBroadcastInterval(Integer broadcastInterval) {
this.broadcastInterval = broadcastInterval;
}
public Integer getProcessImmediately() {
return processImmediately;
}
public void setProcessImmediately(Integer processImmediately) {
this.processImmediately = processImmediately;
}
public SchedulerTask getSchedulerTask() {
return schedulerTask;
}
public void setSchedulerTask(SchedulerTask schedulerTask) {
this.schedulerTask = schedulerTask;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
@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( "broadcastPeriod", "key_broadcast_period");
viewMandatoryFields.put( "broadcastInterval", "key_broadcast_interval");
return viewMandatoryFields;
}
} |
...
RewardSettlementRunDefinition extends ViewObject {
/**
*
*/
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;
} |
Create Summary Pages
In the following steps, five summary pages need to be implemented in order to have a complete image of a process run definition screen, thus the image below illustrates the run definition summary page. The main summary page includes other four, starting from the first summary page, which is shown in the process runs drill-own. This drill-down also includes another two summary pages for successful and failed entries accordingly and lastly one summary page for the previous versions, as we can see.
...