When creating automated qualifiers and automated actions, you use the following subclasses of CustomItem:
•CustomCondition—Use when creating automated qualifiers for rules and conditions.
•CustomAction—Use when creating automated actions for rules and wizards.
The following table provides the basic differences between qualifiers and actions.
Qualifiers and Actions
Qualifiers |
Actions |
Extend CustomCondition and the class of the enterprise entity, |
Extend CustomAction and the class of the enterprise entity, |
Implement the abstract method CustomCondition.condition(final M record) that returns true or false. |
Implement the abstract method CustomAction.action(final) that does not return anything. |
Define your logic in the condition(M) method. Because the qualifier returns a Boolean value, if the return value is true for rules, TeamConnect runs the action associated with this condition. If it is false, the action does not execute. |
Define your logic in the action(M) method. |
You call the condition(M) and action(M) methods when the qualifiers and actions run. Override these methods to access an instance of the object.
The following code snippet demonstrates the basic structure of a qualifier in Java. You must determine what else to import for your qualifier.
import com.mitratech.teamconnect.enterprise.api.model.Project; import com.mitratech.teamconnect.enterprise.api.model.rule.CustomCondition; public class MyCustomCondition extends CustomCondition<Project> { @Override public boolean condition (final Project record){ // Put your code here } } |
The following code snippet demonstrates the basic structure of an action in Java. You must determine what else to import for your action.
import com.mitratech.teamconnect.enterprise.api.model.Project; import com.mitratech.teamconnect.enterprise.api.model.rule.CustomAction; public class MyCustomAction extends CustomAction<Project> { @Override public boolean action (final Project record) { // Put your code here } } |