Hi Joe,
Can you please explain what kind of task are you talking about?
If it's a human task why do you want to mark it as "complete" by your business logic and if it is business logic that is performed within the task why do you assign it and to whom?
Did you check out
http://docs.jboss.com/jbpm/v4/userguide/html_single/#custom ?