Designing a More Sophisticated Process

Still, we may desire to design a more sophisticated process. In cases where multiple completion steps are necessary, it works best to have a more elaborate state machine. To address such needs, here’s the definition of a Process interface:

package com.saasovation.common.domain.model.process; import java.util.Date; public interface Process {     public enum ProcessCompletionType {         NotCompleted,         CompletedNormally,         TimedOut     }     public long allowableDuration();     public boolean canTimeout();     public long currentDuration();     public String description();     public boolean didProcessingComplete();     public void informTimeout(Date aTimedOutDate); ...

Get Implementing Domain-Driven Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.