Skip to content

Commit

Permalink
Fix comments for javadocs (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng authored Jul 27, 2023
1 parent cdeb5e1 commit 6f1ffd6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/main/java/io/iworkflow/core/ObjectWorkflow.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ default List<CommunicationMethodDef> getCommunicationSchema() {
* Define the workflowType of this workflow definition. By default(when return empty string), it's the simple name of the workflow instance,
* which should be the case for most scenarios.
* <p>
* In case of dynamic workflow implementation, return customized values based on constructor input.
* Implement this to provide a different workflowType than default to avoid breaking changes when changing workflow class name.
* However, {@link Client} must then use String to provide workflow type to start workflows.
*
* @return the workflow type
*/
default String getWorkflowType() {
Expand Down
19 changes: 10 additions & 9 deletions src/main/java/io/iworkflow/core/WorkflowState.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ public interface WorkflowState<I> {
* @param input the state input which is deserialized by {@link ObjectEncoder} with {@link #getInputType}
* @param persistence persistence API for 1) data attributes, 2) search attributes and 3) stateExecutionLocals 4) recordEvent
* DataAttributes and SearchAttributes are defined by {@link ObjectWorkflow} interface.
* StateExecutionLocals are for passing data within the state execution from this start API to {@link #execute} API
* StateExecutionLocals are for passing data within the state execution from this waitUntil API to {@link #execute} API
* RecordEvent is for storing some tracking info(e.g. RPC call input/output) when executing the API.
* Note that any write API will be recorded to server after the whole start API response is accepted.
* Note that any write API will be recorded to server after the whole waitUntil API response is accepted by server.
* @param communication communication API, right now only for publishing value to InternalChannel
* Note that any write API will be recorded to server after the whole start API response is accepted.
* Note that any write API will be recorded to server after the whole waitUntil API response is accepted by server.
* @return the requested commands for this step
*/
default CommandRequest waitUntil(
Expand All @@ -49,18 +49,18 @@ default CommandRequest waitUntil(

/**
* Implement this method to execute the state business, when requested commands are ready if {@link #waitUntil} is implemented
* If {@link #waitUntil} is not implemented, the state will invoke this API directly
* If {@link #waitUntil} is not implemented, the state will invoke this execute API directly
*
* @param context the context info of this API invocation, like workflow start time, workflowId, etc
* @param input the state input which is deserialized by {@link ObjectEncoder} with {@link #getInputType}
* @param commandResults the results of the command that executed by {@link #waitUntil}
* @param persistence persistence API for 1) data attributes, 2) search attributes and 3) stateExecutionLocals 4) recordEvent
* DataAttributes and SearchAttributes are defined by {@link ObjectWorkflow} interface.
* StateExecutionLocals are for passing data within the state execution from this start API to {@link #execute} API
* StateExecutionLocals are for passing data within the state execution from this API to {@link #execute} API
* RecordEvent is for storing some tracking info(e.g. RPC call input/output) when executing the API.
* Note that the write API will be recorded to server after the whole start API response is accepted.
* Note that the write API will be recorded to server after the whole execute API response is accepted by server.
* @param communication communication API, right now only for publishing value to InternalChannel
* Note that the write API will be recorded to server after the whole decide API response is accepted.
* Note that the write API will be recorded to server after the whole execute API response is accepted by server.
* @return the decision of what to do next(e.g. transition to next states)
*/
StateDecision execute(
Expand All @@ -82,9 +82,10 @@ default String getStateId() {
}

/**
* Optional configuration to adjust the state behaviors. Default values:
* Optional configuration to adjust the state behaviors. Default values if not set:
* - waitUntilApiFailurePolicy: FAIL_WORKFLOW_ON_FAILURE
* - PersistenceLoadingPolicy for dataAttributes/searchAttributes: LOAD_ALL_WITHOUT_LOCKING ,
* - start/decide API:
* - waitUntil/execute API:
* - timeout: 30s
* - retryPolicy:
* - InitialIntervalSeconds: 1
Expand Down

0 comments on commit 6f1ffd6

Please sign in to comment.