Versions Compared

Key

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

...

1. Data Object Class

The entity's DO class must implement ICRMDOWorkflowRuleEntity interface and its two methods: getAuditTrailLogs() and setAuditTrailLogs(Set<CRMDO> auditTrailLogs). Keep in mind that auditTrailLogs set is defined in superclass CRMDO.28 methods: 

  1. setUserField1(String userField1)
  2. setUserField2(String userField2)
  3. setUserField3(String userField3)
  4. setUserField4(String userField4)
  5. setUserField5(String userField5)
  6. setUserField6(String userField6)
  7. setUserField7(String userField7)
  8. setUserField8(String userField8)
  9. setDateTime1(Date dateTime1)
  10. setDateTime2(Date dateTime2)
  11. setDateTime3(Date dateTime3)
  12. setDateTime4(Date dateTime4)
  13. setFloat1(BigDecimal float1)
  14. setFloat2(BigDecimal float2)
  15. setFloat3(BigDecimal float3)
  16. setFloat4(BigDecimal float4)
  17. setStatusTransitionExceptionEnabled(Integer statusTransitionExceptionEnabled)
  18. getStatusTransitionExceptionEnabled()
  19. isStatusTransitionExceptionEnabled()
  20. setACRExceptionEnabled(Integer acrExceptionEnabled)
  21. getACRExceptionEnabled()
  22. isACRExceptionEnabled()
  23. setPLARExceptionEnabled(Integer plarExceptionEnabled)
  24. getPLARExceptionEnabled()
  25. isPLARExceptionEnabled()
  26. setOwnedByGroupExceptionEnabled(Integer ownedByGroupExceptionEnabled)
  27. getOwnedByGroupExceptionEnabled()
  28. isOwnedByGroupExceptionEnabled()

Note that for any of 1-16 methods there is no corresponding database field, no functionality should be implemented.

In order to implement methods 17-28 the following java transient fields should be declared:

  1. Integer statusTransitionExceptionEnabled
  2. Integer acrExceptionEnabled
  3. Integer plarExceptionEnabled
  4. Integer ownedByGroupExceptionEnabled

Code Block
languagejava
titleCUSTOMCRMDORental
collapsetrue
publicppublic class CUSTOMCRMDORental extends CRMDO implements ICRMDOAuditTrailedEntity ICRMDOWorkflowRuleEntity{

	private CUSTOMCRMDORentalType type;
	private CUSTOMRentalState state;
	private CRMDOAccountReceivable accountReceivable;
	private Date effectiveDate;
	private Date expirationDate;
	
	private Set<CUSTOMCRMDORentalItem> items;
	public
CUSTOMCRMDORentalType getType() {
		return type	//transient fields
	private Integer statusTransitionExceptionEnabled;
	}private 	public void setType(CUSTOMCRMDORentalType type) {
		setChange("type", this.type, type);
		this.type = type;
	}
	Integer acrExceptionEnabled;
	private Integer plarExceptionEnabled;
	private Integer ownedByGroupExceptionEnabled;
	public CUSTOMRentalState getState() {
		return state;
	}
	public void setState(CUSTOMRentalState state) {
		setChange("state", this.state, state);
		this.state = state;
	}
	public CRMDOAccountReceivable getAccountReceivable() {
		return accountReceivable;
	}
	public void setAccountReceivable(CRMDOAccountReceivable accountReceivable) {
		setChange("accountReceivable", this.accountReceivable, accountReceivable);
		this.accountReceivable = accountReceivable;
	}
	public Date getEffectiveDate() {
		return effectiveDate;
	}
	public void setEffectiveDate(Date effectiveDate) {
		setChange("effectiveDate", this.effectiveDate, effectiveDate);
		this.effectiveDate = effectiveDate;
	}
	public Date getExpirationDate() {
		return expirationDate;
	}
	public void setExpirationDate(Date expirationDate) {
		setChange("expirationDate", this.expirationDate, expirationDate);
		this.expirationDate = expirationDate;
	}
	public Set<CUSTOMCRMDORentalItem> getItems() {
		return items;
	}
	public void setItems(Set<CUSTOMCRMDORentalItem> items) {
		setChange("items", this.items, items);
		this.items = items;
	}
	public CUSTOMCRMDORentalType getType() {
		return type;
	}
	public void setType(CUSTOMCRMDORentalType type) {
		setChange("type", this.type, type);
		this.type = type;
	}
	@Override
	public void setUserField1(String userField1) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public Set<CRMDO> getAuditTrailLogs() throws Exception {
		return auditTrailLogs void setUserField2(String userField2) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setUserField3(String userField3) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setUserField4(String userField4) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setUserField5(String userField5) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setUserField6(String userField6) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setUserField7(String userField7) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setUserField8(String userField8) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setDateTime1(Date dateTime1) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setDateTime2(Date dateTime2) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setDateTime3(Date dateTime3) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setDateTime4(Date dateTime4) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setFloat1(BigDecimal float1) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setFloat2(BigDecimal float2) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setFloat3(BigDecimal float3) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setFloat4(BigDecimal float4) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setStatusTransitionExceptionEnabled(Integer statusTransitionExceptionEnabled) {
		this.statusTransitionExceptionEnabled = statusTransitionExceptionEnabled;
	}
	
	@Override
	public Integer getStatusTransitionExceptionEnabled() {
		return this.statusTransitionExceptionEnabled;
	}
	@Override
	public Boolean isStatusTransitionExceptionEnabled() {
		return ((this.statusTransitionExceptionEnabled!=null && this.statusTransitionExceptionEnabled.equals(new Integer(1))) ? true : false);
	}
	@Override
	public void setACRExceptionEnabled(Integer acrExceptionEnabled) {
		this.acrExceptionEnabled = acrExceptionEnabled;		
	}
	@Override
	public Integer getACRExceptionEnabled() {
		return this.acrExceptionEnabled;
	}
	@Override
	public Boolean isACRExceptionEnabled() {
		return ((this.acrExceptionEnabled!=null && this.acrExceptionEnabled.equals(new Integer(1))) ? true : false);
	}
	@Override
	public void setAuditTrailLogs(Set<CRMDO> auditTrailLogs) throws Exception setPLARExceptionEnabled(Integer plarExceptionEnabled) {
		this.plarExceptionEnabled = plarExceptionEnabled;	
	}
	@Override
	public Integer getPLARExceptionEnabled() {
		return this.plarExceptionEnabled;
	}
	@Override
	public Boolean isPLARExceptionEnabled() {
		return ((this.plarExceptionEnabled!=null && this.plarExceptionEnabled.equals(new Integer(1))) ? true : false);
	}
	@Override
	public void setOwnedByGroupExceptionEnabled(Integer ownedByGroupExceptionEnabled) {
		this.auditTrailLogsownedByGroupExceptionEnabled =auditTrailLogs ownedByGroupExceptionEnabled;		
	}
	@Override
	public Integer getOwnedByGroupExceptionEnabled() {
		return this.ownedByGroupExceptionEnabled;
	}
	@Override
	public Boolean isOwnedByGroupExceptionEnabled() {
		return ((this.ownedByGroupExceptionEnabled!=null && this.ownedByGroupExceptionEnabled.equals(new Integer(1))) ? true : false);
	}	
}

2. Entities Metadata File

In entities metadata file, <audittrailexcluded>  <workflowruleincluded> tag's value must be set to falsetrue. Keep in mind that <audittrailexcluded> <workflowruleincluded> default value is false, so in such cases, it can be omitted.

Also if you want 'Applicable on Entity Types' setting to be available <typeentityid> must be defined as well as the corresponding entity.

Ui expand
titleAudit Trail Workflow Rule Entities
Code Block
languagexml
titleentities.xml
collapsetrue
<entities>
		<entity>
			<id>CUSTOMRENTALS</id>
			<name>key_rental</name>
		<description/>
		<tablename>TRN_RENTALS</tablename>
			<classname>com.crm.dataobject.rentals.CUSTOMCRMDORental</classname>
			<moduleid>CUSTOM_RENTALS</moduleid>
			<metadatafile>rentals</metadatafile>
			<workflowruleincluded>true</workflowruleincluded>
			<typeentityid>CUSTOMRENTALTYPES</typeentityid>
		<masterentityid/></entity>
		
		<entity>
		<moduleid>CUSTOM_RENTALS</moduleid>	<id>CUSTOMRENTALTYPES</id>
		<metadatafile>rentals</metadatafile>	<name>key_rental_type</name>
		<csrexcluded>false</csrexcluded>
		<plarexcluded>true</plarexcluded>	<tablename>TRN_RENTALTYPES</tablename>
			<classname>com.crm.dataobject.rentals.CUSTOMCRMDORentalType</classname>
		<acrexcluded>true<	<moduleid>CUSTOMRENTALS</acrexcluded>moduleid>
		<audittrailexcluded>false<	<metadatafile>rentaltypes</audittrailexcluded>metadatafile>
		</entity>
	...
</entities>

 

Image Removed

 Image Added

3. Fields Metadata file

In fields metadata file, <audittrailexcluded> :

    1. <workflowruleactionincluded> tag's value must be set to

...

    1. true for the fields that you want to be available

...

    1. in 'Update Information' sub-section of 'Actions' section. Keep in mind that <audittrailexcluded> default value is false

...

    1. . (see Image 1)
    2. <workflowruleconditionincluded> tag can include any of the following values (separated by comma (,) if more than one is to be defined):
      1. FIELD_CHANGE: When you want the specific field to be available in 'Conditions' section when the condition type is 'When Specific Field Changes' (see Image 2)
      2. FIELD_CONTAINS_VALUE: When you want the specific field to be available in 'Conditions' section when the condition type is 'When Specific Field Contains Specific Value' (see Image 3)
      3. FIELD_FROM_TO_VALUE_CHANGE: When you want the specific field to be available in 'Conditions' section when the condition type is 'When Specific Field Changes From A Specific Value To Another Specific Value' (see Image 4)
Ui expand
titleMonitored Condition and Action Fields
Code Block
languagexml
titleentitiesrentals.xml
collapsetrue
<entityfieldconfig>	
	<mainfield>
		<id>custom_number</id>
		<name>key_number</name>
		<xpath>number</xpath>
	<csrexcluded>true</csrexcluded>	<qlfieldname>rental.number</qlfieldname>
	<plarexcluded>true</plarexcluded>
	<acrexcluded>true<<segmentpreviewname>ENTITYNUMBER</acrexcluded>segmentpreviewname>
	<audittrailexcluded>true</audittrailexcluded>
</mainfield>
	<fields>
		<field>
			<id>custom_type</id>
			<name>key_type</name>
			<relatedentityxpath>type</relatedentityxpath>
			<xpath>name</xpath>
		</field>
		<field>
			<id>custom_type_account<alt_code</id>
			<name>key_type_alt_account<code</name>
			<relatedentityxpath>accountReceivable<<relatedentityxpath>type</relatedentityxpath>
			<xpath>name<<xpath>altCode</xpath>
		</field>
		<field>
			<id>custom_state<account</id>
			<name>key_state<account</name>
			<xpath>state<<relatedentityxpath>accountReceivable</xpath>relatedentityxpath>
		</field>
		<field>
			<id>custom_effective_date</id>	<workflowruleconditionincluded>FIELD_CHANGE</workflowruleconditionincluded>
			<name>key_effective_date</name>
			<xpath>effectiveDate</<xpath>name</xpath>
		</field>
	...
</fields>
<collections>
		<collection>	<field>
			<id>custom_items<state</id>
			<name>key_items<state</name>
			<relatedentityxpath/>
			<xpath>items<<xpath>state</xpath>
			<csrexcluded>false</csrexcluded>
			<plarexcluded>true</plarexcluded>
			<acrexcluded>true</acrexcluded>
			<method>
				<ejbname>CUSTOMCRMUIRental</ejbname>
				<methodname>loadItemsTab</methodname>
				<parameters>
					<parameter>
						<xpath>[DTO]</xpath>
					</parameter>
				</parameters>
			</method>
			<mainfield>
				<id>custom_serialNumber</id>
				<name>key_serialNumber</name>
				<relatedentityxpath>installedItem</relatedentityxpath>
				<xpath>serialNumber</xpath>
				<audittrailexcluded>true</audittrailexcluded>
			</mainfield>
			<fields>
				<field>
					<id>custom_code<<workflowruleconditionincluded>FIELD_CHANGE,FIELD_CONTAINS_VALUE,FIELD_FROM_TO_VALUE_CHANGE</workflowruleconditionincluded>
			<workflowruleactionincluded>true</workflowruleactionincluded>
		</field>
		<field>
			<id>custom_effective_date</id>
					<name>key_producteffective_code<date</name>
					<relatedentityxpath>installedItem</relatedentityxpath>
					<xpath>product/code</<xpath>effectiveDate</xpath>
					<audittrailexcluded>true</audittrailexcluded><workflowruleconditionincluded>FIELD_FROM_TO_VALUE_CHANGE</workflowruleconditionincluded>
				</field>
				<field>
					<id>custom_expiration_type<date</id>
					<name>key_productexpiration_type<date</name>
					<relatedentityxpath>installedItem</relatedentityxpath>
					<xpath>product/type/name<<xpath>expirationDate</xpath>
					<audittrailexcluded>true<<workflowruleactionincluded>true</audittrailexcluded>workflowruleactionincluded>
				</field>
		</fields>
	</collection>
</collections>
 
Image Removed
...
 </entityfieldconfig>

 

Image 1

Image Added

 

 

Image 2

Image Added

 

Image 3

Image Added

 

Image 4

Image Added

4. Data Entry Page

If you want any fields to be available in

  1. 'Update Information' sub-section of 'Actions' section and/or
  2.  'Conditions' section when the condition type is 'When Specific Field Contains Specific Value' and/or
  3. 'Conditions' section when the condition type is 'When Specific Field Changes From A Specific Value To Another Specific Value'

workflow rule data entry page must be customised in order for the elements responsible for specifying the field value in the above cases to be created.

For more information on customising data entry pages go to Customize Data Entry Pages.