Thursday 5 April 2012

How to create field validation class which extends MAXTableDomain

1. Write a custom field validation class and extend MAXTableDomain. (import psdi.mbo.MAXTableDomain)
2. Create a constructor and set a relationship with Object (table name).
3. Set a list criteria in the constructor itself (where clause for the above object).
4. If you would like to filter with more where clauses then write a getList() method.
5. Associate this field validation class to attribute in DB Configuration. And make sure that domain is not associated to this attribute.
Sample Class:
public class CustomFeildClass extend MAXTableDomain
{

public CustomFeildClass (MboValue mbv) throws RemoteException
 {
super(mbv);

String thisAttrName = getMboValue().getAttributeName();
setRelationship("FAILURELIST","failurecode=:"+ thisAttrName)
// Note: Here FAILURELIST is a Object. Most of the developers will confuse that it is a relationship name.
 
setListCriteria("parent is null");
//Note: this sets a where condition for the above object.
setErrorMessage("asset","failurecode");
 
 }
public MboSetRemote getList() throws MXException, RemoteException
 {
String additionalWhere ="orgid=:orgid";
setListCriteria(additionalWhere);
//Note: this sets additional where conditional to display when user clicks on lookup.
}
}
 

Wednesday 4 April 2012

How to create custom condition class

There are two types of Conditions in Condition Expression Manager:
1. Expression
2. Class


To use Type Class in Condition, need to create a custom condition class.
1. Create a custom condition class which implements CustomCondition interface.
eg:
public class ConditionClass implements CustomCondition {
public boolean evaluateCondition(MboRemote mbo, Object param)throws MXException, RemoteException
if(<business logic>)

{
<business logic>
return true;
}
else{
<business logic>
return false
}
}
public String toWhereClause(Object parm, MboSetRemote msr)throws MXException, RemoteException

{
<business logic>
 return <sql>
}
}

2. CustomCondition interface have two methods:
a. evaluateCondition(MboRemote mbo, Object param): this method is used to evaluate condition and returns either true or false based on the business logic written in it. This return boolean value.
 b.toWhereClause(Object parm, MboSetRemote msr) : This method is used to return sql to the object which this condition is applied.This returns String.

Maximo SOAPUI error javax.xml.ws.WebServiceException

SOAPUI error while sending payload to below url (in cluster environment) http://localhost:9080/meaweb/services/MXASSET Error : <f...