@@ -82,112 +82,9 @@ you've built them using the preceding instructions.
82
82
83
83
### Hello World
84
84
85
- The sample has three executables. You should run each command in a separate terminal window, from
86
- the ` samples ` directory.
85
+ To run hello world:
87
86
88
- mvn exec:java -Dexec.mainClass=HelloWorldWorker
89
- mvn exec:java -Dexec.mainClass=com.amazonaws.services.simpleworkflow.flow.examples.helloworld.WorkflowHost
90
- mvn exec:java -Dexec.mainClass=HelloWorldStarter
91
-
92
- ### Hello Lambda
93
-
94
- The * HelloLambda* sample requires the use of an [ AWS Lambda] ( http://aws.amazon.com/lambda/ )
95
- function. You can create the function in any way supported by AWS Lambda, including by using the AWS
96
- Eclipse Toolkit.
97
-
98
- ** Note** : Using Lambda can incur costs to your AWS account. For more information, see the [ AWS
99
- Lambda Pricing page] ( http://aws.amazon.com/lambda/pricing/ ) .
100
-
101
- Visit the following pages to learn how to create AWS Lambda functions:
102
-
103
- * [ in Java using Eclipse] ( http://docs.aws.amazon.com/AWSToolkitEclipse/latest/GettingStartedGuide/lambda-tutorial.html ) .
104
-
105
- * [ in Java without Eclipse] ( http://docs.aws.amazon.com/lambda/latest/dg/java-lambda.html ) .
106
-
107
- * [ in Node.js] ( http://docs.aws.amazon.com/lambda/latest/dg/authoring-function-in-nodejs.html ) .
108
-
109
- When you create the function, be sure that it exists in the same AWS region that you will run the
110
- * HelloLambda* sample in. You will also need to provide Amazon SWF with access to your Lambda
111
- function in order to run it using the sample.
112
-
113
- ** To create a Lambda role for SWF:**
114
-
115
- 1 . Open the [ Amazon IAM console] ( https://console.aws.amazon.com/iam/ )
116
-
117
- 2 . Click ** Roles** , then ** Create New Role** .
118
-
119
- 3 . Give your role a name, such as `swf-lambda' and click ** Next Step** .
120
-
121
- 4 . Under ** AWS Service Roles** , choose ** AWS SWF** , and click ** Next Step** .
122
-
123
- 5 . Choose ** AWSLambdaRole** from the list, click ** Next Step** and then ** Create Role** once you've
124
- reviewed the role.
125
-
126
- Once you have a Lambda function to run and an IAM policy that gives SWF access to it, then find the
127
- following section in the ` access.properties ` file and provide it with information about the function
128
- and role that you created:
129
-
130
- ####### HelloLambda Sample Config Values ######
131
- SWF.LambdaRole.ARN=<Your IAM role that authorizes SWF to invoke Lambda functions>
132
- SWFLambdaFunction.Name=<The name of your Lambda function>
133
- SWFLambdaFunction.Input=<Input for your Lambda function>
134
-
135
- The * HelloLambda* sample uses an AWS Lambda task instead of running an activity, so you only need to
136
- run the workflow host and workflow starter. Run each command in a separate terminal window from the
137
- ` samples ` directory.
138
-
139
- mvn exec:java -Dexec.mainClass=com.amazonaws.services.simpleworkflow.flow.examples.hellolambda.WorkflowHost
140
- mvn exec:java -Dexec.mainClass=com.amazonaws.services.simpleworkflow.flow.examples.hellolambda.WorkflowExecutionStarter
141
-
142
- ### Booking
143
-
144
- The sample has three executables. You should run each command in a separate terminal window, from
145
- the ` samples ` directory.
146
-
147
- mvn exec:java -Dexec.mainClass=ActivityHost
148
- mvn exec:java -Dexec.mainClass=WorkflowHost
149
- mvn exec:java -Dexec.mainClass=WorkflowExecutionStarter
150
-
151
- ### Cron
152
-
153
- The sample has three executables. You should run each command in a separate terminal window, from
154
- the ` samples ` directory.
155
-
156
- mvn exec:java -Dexec.mainClass=ActivityHost
157
- mvn exec:java -Dexec.mainClass=WorkflowHost
158
- mvn exec:java -Dexec.mainClass=CronWorkflowExecutionStarter -Dexec.args="\"*/10 * * * * *\" PST 60"
159
-
160
- The workflow starter takes three command line arguments that * must* be specified:
161
-
162
- 1 . CRON_PATTERN: specifies the pattern used to determine the cron schedule for the periodic activity
163
- task. The above command specifies the pattern ` */10 * * * * * ` to run the task every 10 seconds.
164
-
165
- 2 . TIME_ZONE: specifies the time zone to use for time calculations. The above command specifies PST
166
- (Pacific Standard Time).
167
-
168
- 3 . CONTINUE_AS_NEW_AFTER_SECONDS: specifies the duration, in seconds, after which the current
169
- execution should be closed and continued as a new execution. The above command specifies 60 seconds.
170
-
171
- ### Cron With Retry
172
-
173
- The sample has three executables. You should run each command in a separate terminal window, from
174
- the ` samples ` directory.
175
-
176
- mvn exec:java -Dexec.mainClass=ActivityHost
177
- mvn exec:java -Dexec.mainClass=WorkflowHost
178
- mvn exec:java -Dexec.mainClass=CronWithRetryWorkflowExecutionStarter" -Dmain-args="\"*/10 * * * * *\" PST 60
179
-
180
- The workflow starter takes three command line arguments that * must* be specified:
181
-
182
- 1 . CRON_PATTERN: specifies the pattern used to determine the cron schedule for the periodic activity
183
- task. The above command specifies the pattern ` */10 * * * * * ` to run the task every 10 seconds.
184
-
185
- 2 . TIME_ZONE: specifies the time zone to use for time calculations. The above command specifies PST
186
- (Pacific Standard Time).
187
-
188
- 3 . CONTINUE_AS_NEW_AFTER_SECONDS: specifies the duration, in seconds, after which the current
189
- execution should be closed and continued as a new execution. The above command specifies 60
190
- seconds.
87
+ mvn exec:java -Dexec.mainClass=com.uber.cadence.samples.helloworld.HelloWorld
191
88
192
89
### File Processing
193
90
@@ -201,28 +98,25 @@ bucket that you want the sample to use:
201
98
####### FileProcessing Sample Config Values ##########
202
99
Workflow.Input.TargetBucketName=<Your S3 bucket name>
203
100
204
- The sample has three executables. You should run each command in a separate terminal window, from
205
- the ` samples ` directory.
101
+ The sample has two executables. You should run each command in a separate terminal window. The first one
102
+ is the worker that hosts workflow and activities implementation:
206
103
207
- mvn exec:java -Dexec.mainClass=ActivityHost
208
- mvn exec:java -Dexec.mainClass=WorkflowHost
209
- mvn exec:java -Dexec.mainClass=WorkflowExecutionStarter
104
+ mvn exec:java -Dexec.mainClass=com.uber.cadence.samples.fileprocessing.FileProcessingWorker
105
+
106
+ The second is responsible for starting workflows:
210
107
108
+ mvn exec:java -Dexec.mainClass=com.uber.cadence.samples.fileprocessing.FileProcessingStarter
109
+
211
110
### Periodic Workflow
212
111
213
- The sample has three executables. You should run each command in a separate terminal window, from
214
- the ` samples ` directory.
215
-
216
- mvn exec:java -Dexec.mainClass=PeriodicWorkflowWorker
217
- mvn exec:java -Dexec.mainClass=com.amazonaws.services.simpleworkflow.flow.examples.periodicworkflow.WorkflowHost
218
- mvn exec:java -Dexec.mainClass=WorkflowExecutionStarter
112
+ mvn exec:java -Dexec.mainClass=com.uber.cadence.samples.periodicworkflow.PeriodicWorkflowWorker
113
+
114
+ mvn exec:java -Dexec.mainClass=com.uber.cadence.samples.periodicworkflow.PeriodicWorkflowStarter
219
115
220
116
### Split Merge
221
117
222
- The sample has three executables. You should run each command in a separate terminal window, from
223
- the ` samples ` directory.
118
+ The sample has two executables. You should run each command in a separate terminal window.
224
119
225
- mvn exec:java -Dexec.mainClass=ActivityHost
226
- mvn exec:java -Dexec.mainClass=WorkflowHost
227
- mvn exec:java -Dexec.mainClass=WorkflowExecutionStarter
120
+ mvn exec:java -Dexec.mainClass=com.uber.cadence.samples.splitmerge.SplitMergeWorker
121
+ mvn exec:java -Dexec.mainClass=com.uber.cadence.samples.splitmerge.SplitMergeStarter
228
122
0 commit comments