User's Manual

Chapter 11. Services Tutorials 137
super;
}
update {
super;
}
delete {
super;
}
}
4. In your package initializer section, create and add a new instantiator.
DomainObjectInstantiator instHelloWorldTask =
new ACSObjectInstantiator() {
public DomainObject doNewInstance(DataObject
dataObject) {
return new HelloWorldTask(dataObject);
}
};
DomainObjectFactory.registerInstantiator(
"com.arsdigita.workflow.simple.",
instHelloWorldTask);
5. Create the workflow template.
public class WFTutorialHello {
public void WFTutorialHello() {
HelloWorldTask helloTask1 =
new HelloWorldTask("hello 1", "description");
HelloWorldTask helloTask2 =
new HelloWorldTask("hello 2", "description");
//Note(1): Save the task before adding the dependency
helloTask1.save();
helloTask2.save();
helloTask2.addDependency(helloTask1);
helloTask2.save();
User user = new User(__USER_ID__)
Workflow wf = new Workflow("hello example",
"tutorial example of creating a task");
wf.addTask(helloTask1);
wf.addTask(helloTask2);
//Note(2): The workflow mad
helloTask1.save();
helloTask2.save();
wf.start();
helloTask1.finish();
helloTask2.finish();
}
}