Could you elaborate what you mean by service task and what you need to interrupt?
Is the task running but the work take too long?
Which server version do you use?
by service task i mean a domain specific task for which i have written a few custom service task handlers to create different type of domain specific tasks.
my use case is that if the business logic in the task takes more than a fixed amount of time , i want to either abort the process or move to the next task.
these are 2 separate cases. for some domain specific tasks i want to abort the process if the this timeout is reached while for others i want the process to move ahead in the workflow.
That sounds like a use-case for batches JSR-352 which are available in JavaEE7.
Other EE components does not have such control, except Transaction timeouts but here is no guarantee that the task is interrupted directly.