File tree Expand file tree Collapse file tree
src/main/java/com/uber/cadence/samples Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ public class TripBookingSaga {
2727
2828 static final String TASK_LIST = "TripBooking" ;
2929
30+ @ SuppressWarnings ("CatchAndPrintStackTrace" )
3031 public static void main (String [] args ) {
31-
3232 // Get worker to poll the common task list.
3333 Worker .Factory factory = new Worker .Factory (DOMAIN );
3434 final Worker workerForCommonTaskList = factory .newWorker (TASK_LIST );
Original file line number Diff line number Diff line change 1919
2020import static com .uber .cadence .samples .common .SampleConstants .DOMAIN ;
2121
22- import com .google .common .base .Charsets ;
2322import com .uber .cadence .client .WorkflowClient ;
2423import com .uber .cadence .client .WorkflowOptions ;
2524import com .uber .cadence .worker .Worker ;
2928import java .time .Duration ;
3029import java .util .ArrayList ;
3130import java .util .List ;
32- import java . util . Random ;
31+ import org . apache . commons . lang . RandomStringUtils ;
3332
3433/**
3534 * 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 {
9594 worker .registerWorkflowImplementationTypes (GreetingWorkflowImpl .class );
9695 factory .start ();
9796
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 );
10299
103100 // Start a workflow execution. Usually this is done from another program.
104101 WorkflowClient workflowClient = WorkflowClient .newInstance (DOMAIN );
You can’t perform that action at this time.
0 commit comments