Skip to content

Commit

Permalink
Fixed README code sample (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfateev authored and meiliang86 committed Apr 25, 2019
1 parent b1ea07b commit 2f1fae0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ If this does not work, see instructions for running the Cadence Server at https:

## Get CLI

TODO
[CLI is avaialable as an executable or as a docker image](https://github.com/uber/cadence/blob/master/tools/cli/README.md)

# Build a configuration

Expand All @@ -31,12 +31,12 @@ Add *cadence-client* as a dependency to your *pom.xml*:
<dependency>
<groupId>com.uber.cadence</groupId>
<artifactId>cadence-client</artifactId>
<version>2.0.0</version>
<version>2.4.0</version>
</dependency>

or to *build.gradle*:

compile group: 'com.uber.cadence', name: 'cadence-client', version: '1.0.5'
compile group: 'com.uber.cadence', name: 'cadence-client', version: '2.4.0'

# Overview

Expand Down Expand Up @@ -113,8 +113,9 @@ public interface FileProcessingActivities {

void deleteLocalFile(String fileName);
}

```
It is recommended to use a single value type argument for activity methods. This way adding new arguments as fields to the value type is a backwards compatible change.

An optional @ActivityMethod annotation can be used to specify activity options like timeouts or a task list. Required options
that are not specified through the annotation must be specified at run time.

Expand Down Expand Up @@ -272,6 +273,8 @@ public interface FileProcessingWorkflow {
void retryNow();
}
```
It is recommended to use a single value type argument for workflow methods. This way adding new arguments as fields to the value type is a backwards compatible change.

## Starting workflow executions

Given a workflow interface executing a workflow requires initializing a `WorkflowClient` instance, creating
Expand All @@ -296,7 +299,7 @@ String result = workflow.processFile(workflowArgs);
Asynchronous:
```java
// Returns as soon as the workflow starts.
WorkflowExecution workflowExecution = WorkflowClient.asyncStart(workflow::processFile, workflowArgs);
WorkflowExecution workflowExecution = WorkflowClient.start(workflow::processFile, workflowArgs);

System.out.println("Started process file workflow with workflowId=\"" + workflowExecution.getWorkflowId()
+ "\" and runId=\"" + workflowExecution.getRunId() + "\"");
Expand Down

0 comments on commit 2f1fae0

Please sign in to comment.