-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from cadence-oss/update-basic-test
Update basic test with 2 states
- Loading branch information
Showing
9 changed files
with
95 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,16 @@ | ||
package iwf.integ.basic; | ||
|
||
import iwf.core.ImmutableStateDef; | ||
import iwf.core.StateDef; | ||
import iwf.core.Workflow; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public class BasicWorkflow implements Workflow { | ||
@Override | ||
public List<StateDef> getStates() { | ||
return Arrays.asList( | ||
ImmutableStateDef.builder() | ||
.canStartWorkflow(true) | ||
.workflowState( | ||
new BasicWorkflowS1() | ||
) | ||
.build() | ||
StateDef.startingState(new BasicWorkflowS1()), | ||
StateDef.nonStartingState(new BasicWorkflowS2()) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package iwf.integ.basic; | ||
|
||
import iwf.core.Context; | ||
import iwf.core.StateDecision; | ||
import iwf.core.WorkflowState; | ||
import iwf.core.attributes.QueryAttributesRW; | ||
import iwf.core.attributes.SearchAttributesRW; | ||
import iwf.core.attributes.StateLocalAttributesR; | ||
import iwf.core.attributes.StateLocalAttributesW; | ||
import iwf.core.command.CommandRequest; | ||
import iwf.core.command.CommandResults; | ||
|
||
public class BasicWorkflowS2 implements WorkflowState<Integer> { | ||
|
||
public static final String StateId = "S2"; | ||
|
||
@Override | ||
public String getStateId() { | ||
return StateId; | ||
} | ||
|
||
@Override | ||
public Class<Integer> getInputType() { | ||
return Integer.class; | ||
} | ||
|
||
@Override | ||
public CommandRequest start(final Context context, final Integer input, final StateLocalAttributesW stateLocals, final SearchAttributesRW searchAttributes, final QueryAttributesRW queryAttributes) { | ||
return CommandRequest.empty; | ||
} | ||
|
||
@Override | ||
public StateDecision decide(final Context context, final Integer input, final CommandResults commandResults, final StateLocalAttributesR stateLocals, final SearchAttributesRW searchAttributes, final QueryAttributesRW queryAttributes) { | ||
final int output = input + 1; | ||
return StateDecision.gracefulCompleteWorkflow(output); | ||
} | ||
} |