User's Manual

136 Chapter 11. Services Tutorials
public HelloWorldTask(OID oid) throws
DataObjectNotFoundException {
super(oid);
}
public HelloWorldTask(BigDecimal id) throws
DataObjectNotFoundException {
this(new OID(BASE_DATA_OBJECT_TYPE, id));
}
protected HelloWorldTask(ObjectType type) {
super(type);
}
protected HelloWorldTask(String typeName) {
super(typeName);
}
// Add functionality in these methods
public void enableEvt() {
System.out.println(getLabel()+": I am enabled");
}
public void disableEvt() {
System.out.println(getLabel()+": I have been disabled");
}
public void finishEvt() {
System.out.println(getLabel()+": I am finished");
}
public void rollbackEvt() {
System.out.println(getLabel()+": I was rollbacked");
}
//Write clone functionality. Note the use of copyAttributes
//
public Object clone() {
HelloWorldTask taskClone = new HelloWorldTask();
copyAttributes(taskClone);
return taskClone;
}
//Add this method because future versions will
protected void copyAttributes(HelloWorldTask taskClone) {
taskClone.setLabel(getLabel());
taskClone.setDescription(getDescription());
taskClone.setActive(isActive());
}
}
Ensure that the constructors, events, and clone methods are coded for the new task type.
3. Write the PDL for the new subclass of task. This is a simple case; you would probably have
additional tables for select and DML statements.
object type HelloWorldTask extends Task {
retrieve {
super;
}
insert {