File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
src/main/java/com/uber/cadence/samples Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ public class TripBookingSaga {
27
27
28
28
static final String TASK_LIST = "TripBooking" ;
29
29
30
+ @ SuppressWarnings ("CatchAndPrintStackTrace" )
30
31
public static void main (String [] args ) {
31
-
32
32
// Get worker to poll the common task list.
33
33
Worker .Factory factory = new Worker .Factory (DOMAIN );
34
34
final Worker workerForCommonTaskList = factory .newWorker (TASK_LIST );
Original file line number Diff line number Diff line change 19
19
20
20
import static com .uber .cadence .samples .common .SampleConstants .DOMAIN ;
21
21
22
- import com .google .common .base .Charsets ;
23
22
import com .uber .cadence .client .WorkflowClient ;
24
23
import com .uber .cadence .client .WorkflowOptions ;
25
24
import com .uber .cadence .worker .Worker ;
29
28
import java .time .Duration ;
30
29
import java .util .ArrayList ;
31
30
import java .util .List ;
32
- import java . util . Random ;
31
+ import org . apache . commons . lang . RandomStringUtils ;
33
32
34
33
/**
35
34
* Demonstrates asynchronous signalling of a workflow. Requires a local instance of Cadence server
@@ -95,10 +94,8 @@ public static void main(String[] args) throws Exception {
95
94
worker .registerWorkflowImplementationTypes (GreetingWorkflowImpl .class );
96
95
factory .start ();
97
96
98
- // In real applications use a business level ID like customerId or orderId
99
- byte [] idBytes = new byte [10 ];
100
- new Random ().nextBytes (idBytes );
101
- String workflowId = new String (idBytes , Charsets .UTF_8 );
97
+ // In a real application use a business ID like customer ID or order ID
98
+ String workflowId = RandomStringUtils .randomAlphabetic (10 );
102
99
103
100
// Start a workflow execution. Usually this is done from another program.
104
101
WorkflowClient workflowClient = WorkflowClient .newInstance (DOMAIN );
You can’t perform that action at this time.
0 commit comments