Showing preview only (1,488K chars total). Download the full file or copy to clipboard to get everything.
Repository: temporalio/samples-java
Branch: main
Commit: 1fd2eef51384
Files: 632
Total size: 1.3 MB
Directory structure:
gitextract_xaqm8zrf/
├── .github/
│ ├── CODEOWNERS
│ ├── dependabot.yml
│ └── workflows/
│ └── ci.yml
├── .gitignore
├── LICENSE
├── README.md
├── build.gradle
├── core/
│ ├── build.gradle
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── io/
│ │ │ └── temporal/
│ │ │ └── samples/
│ │ │ ├── apikey/
│ │ │ │ ├── ApiKeyWorker.java
│ │ │ │ ├── MyWorkflow.java
│ │ │ │ ├── MyWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── Starter.java
│ │ │ ├── asyncchild/
│ │ │ │ ├── ChildWorkflow.java
│ │ │ │ ├── ChildWorkflowImpl.java
│ │ │ │ ├── ParentWorkflow.java
│ │ │ │ ├── ParentWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── Starter.java
│ │ │ ├── asyncuntypedchild/
│ │ │ │ ├── ChildWorkflow.java
│ │ │ │ ├── ChildWorkflowImpl.java
│ │ │ │ ├── ParentWorkflow.java
│ │ │ │ ├── ParentWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── Starter.java
│ │ │ ├── autoheartbeat/
│ │ │ │ ├── AutoHeartbeatUtil.java
│ │ │ │ ├── README.md
│ │ │ │ ├── Starter.java
│ │ │ │ ├── activities/
│ │ │ │ │ ├── AutoActivities.java
│ │ │ │ │ └── AutoActivitiesImpl.java
│ │ │ │ ├── interceptor/
│ │ │ │ │ ├── AutoHeartbeatActivityInboundCallsInterceptor.java
│ │ │ │ │ └── AutoHeartbeatWorkerInterceptor.java
│ │ │ │ └── workflows/
│ │ │ │ ├── AutoWorkflow.java
│ │ │ │ └── AutoWorkflowImpl.java
│ │ │ ├── batch/
│ │ │ │ ├── heartbeatingactivity/
│ │ │ │ │ ├── HeartbeatingActivityBatchStarter.java
│ │ │ │ │ ├── HeartbeatingActivityBatchWorker.java
│ │ │ │ │ ├── HeartbeatingActivityBatchWorkflow.java
│ │ │ │ │ ├── HeartbeatingActivityBatchWorkflowImpl.java
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── RecordLoader.java
│ │ │ │ │ ├── RecordLoaderImpl.java
│ │ │ │ │ ├── RecordProcessor.java
│ │ │ │ │ ├── RecordProcessorActivity.java
│ │ │ │ │ ├── RecordProcessorActivityImpl.java
│ │ │ │ │ ├── RecordProcessorImpl.java
│ │ │ │ │ └── SingleRecord.java
│ │ │ │ ├── iterator/
│ │ │ │ │ ├── IteratorBatchStarter.java
│ │ │ │ │ ├── IteratorBatchWorker.java
│ │ │ │ │ ├── IteratorBatchWorkflow.java
│ │ │ │ │ ├── IteratorBatchWorkflowImpl.java
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── RecordLoader.java
│ │ │ │ │ ├── RecordLoaderImpl.java
│ │ │ │ │ ├── RecordProcessorWorkflow.java
│ │ │ │ │ ├── RecordProcessorWorkflowImpl.java
│ │ │ │ │ └── SingleRecord.java
│ │ │ │ └── slidingwindow/
│ │ │ │ ├── BatchProgress.java
│ │ │ │ ├── BatchWorkflow.java
│ │ │ │ ├── BatchWorkflowImpl.java
│ │ │ │ ├── ProcessBatchInput.java
│ │ │ │ ├── README.md
│ │ │ │ ├── RecordIterable.java
│ │ │ │ ├── RecordLoader.java
│ │ │ │ ├── RecordLoaderImpl.java
│ │ │ │ ├── RecordProcessorWorkflow.java
│ │ │ │ ├── RecordProcessorWorkflowImpl.java
│ │ │ │ ├── SingleRecord.java
│ │ │ │ ├── SlidingWindowBatchStarter.java
│ │ │ │ ├── SlidingWindowBatchWorker.java
│ │ │ │ ├── SlidingWindowBatchWorkflow.java
│ │ │ │ └── SlidingWindowBatchWorkflowImpl.java
│ │ │ ├── bookingsaga/
│ │ │ │ ├── Booking.java
│ │ │ │ ├── README.md
│ │ │ │ ├── TripBookingActivities.java
│ │ │ │ ├── TripBookingActivitiesImpl.java
│ │ │ │ ├── TripBookingClient.java
│ │ │ │ ├── TripBookingWorker.java
│ │ │ │ ├── TripBookingWorkflow.java
│ │ │ │ └── TripBookingWorkflowImpl.java
│ │ │ ├── bookingsyncsaga/
│ │ │ │ ├── Booking.java
│ │ │ │ ├── README.md
│ │ │ │ ├── TripBookingActivities.java
│ │ │ │ ├── TripBookingActivitiesImpl.java
│ │ │ │ ├── TripBookingClient.java
│ │ │ │ ├── TripBookingWorker.java
│ │ │ │ ├── TripBookingWorkflow.java
│ │ │ │ └── TripBookingWorkflowImpl.java
│ │ │ ├── common/
│ │ │ │ └── QueryWorkflowExecution.java
│ │ │ ├── countinterceptor/
│ │ │ │ ├── ClientCounter.java
│ │ │ │ ├── InterceptorStarter.java
│ │ │ │ ├── README.md
│ │ │ │ ├── SimpleClientCallsInterceptor.java
│ │ │ │ ├── SimpleClientInterceptor.java
│ │ │ │ ├── SimpleCountActivityInboundCallsInterceptor.java
│ │ │ │ ├── SimpleCountWorkerInterceptor.java
│ │ │ │ ├── SimpleCountWorkflowInboundCallsInterceptor.java
│ │ │ │ ├── SimpleCountWorkflowOutboundCallsInterceptor.java
│ │ │ │ ├── WorkerCounter.java
│ │ │ │ ├── activities/
│ │ │ │ │ ├── MyActivities.java
│ │ │ │ │ └── MyActivitiesImpl.java
│ │ │ │ └── workflow/
│ │ │ │ ├── MyChildWorkflow.java
│ │ │ │ ├── MyChildWorkflowImpl.java
│ │ │ │ ├── MyWorkflow.java
│ │ │ │ └── MyWorkflowImpl.java
│ │ │ ├── customannotation/
│ │ │ │ ├── BenignExceptionTypes.java
│ │ │ │ ├── BenignExceptionTypesAnnotationInterceptor.java
│ │ │ │ ├── CustomAnnotation.java
│ │ │ │ └── README.md
│ │ │ ├── customchangeversion/
│ │ │ │ ├── CustomChangeVersionActivities.java
│ │ │ │ ├── CustomChangeVersionActivitiesImpl.java
│ │ │ │ ├── CustomChangeVersionStarter.java
│ │ │ │ ├── CustomChangeVersionWorkflow.java
│ │ │ │ ├── CustomChangeVersionWorkflowImpl.java
│ │ │ │ └── README.md
│ │ │ ├── dsl/
│ │ │ │ ├── DslActivities.java
│ │ │ │ ├── DslActivitiesImpl.java
│ │ │ │ ├── DslWorkflow.java
│ │ │ │ ├── DslWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ ├── Starter.java
│ │ │ │ └── model/
│ │ │ │ ├── Flow.java
│ │ │ │ └── FlowAction.java
│ │ │ ├── earlyreturn/
│ │ │ │ ├── EarlyReturnClient.java
│ │ │ │ ├── EarlyReturnWorker.java
│ │ │ │ ├── README.md
│ │ │ │ ├── Transaction.java
│ │ │ │ ├── TransactionActivities.java
│ │ │ │ ├── TransactionActivitiesImpl.java
│ │ │ │ ├── TransactionRequest.java
│ │ │ │ ├── TransactionWorkflow.java
│ │ │ │ ├── TransactionWorkflowImpl.java
│ │ │ │ └── TxResult.java
│ │ │ ├── encodefailures/
│ │ │ │ ├── CustomerAgeCheck.java
│ │ │ │ ├── CustomerAgeCheckImpl.java
│ │ │ │ ├── InvalidCustomerException.java
│ │ │ │ ├── MyCustomer.java
│ │ │ │ ├── README.md
│ │ │ │ ├── SimplePrefixPayloadCodec.java
│ │ │ │ └── Starter.java
│ │ │ ├── encryptedpayloads/
│ │ │ │ ├── CryptCodec.java
│ │ │ │ └── EncryptedPayloadsActivity.java
│ │ │ ├── envconfig/
│ │ │ │ ├── LoadFromFile.java
│ │ │ │ ├── LoadProfile.java
│ │ │ │ └── README.md
│ │ │ ├── excludefrominterceptor/
│ │ │ │ ├── README.md
│ │ │ │ ├── RunMyWorkflows.java
│ │ │ │ ├── activities/
│ │ │ │ │ ├── ForInterceptorActivities.java
│ │ │ │ │ ├── ForInterceptorActivitiesImpl.java
│ │ │ │ │ ├── MyActivities.java
│ │ │ │ │ └── MyActivitiesImpl.java
│ │ │ │ ├── interceptor/
│ │ │ │ │ ├── MyActivityInboundCallsInterceptor.java
│ │ │ │ │ ├── MyWorkerInterceptor.java
│ │ │ │ │ ├── MyWorkflowInboundCallsInterceptor.java
│ │ │ │ │ └── MyWorkflowOutboundCallsInterceptor.java
│ │ │ │ └── workflows/
│ │ │ │ ├── MyWorkflow.java
│ │ │ │ ├── MyWorkflowOne.java
│ │ │ │ ├── MyWorkflowOneImpl.java
│ │ │ │ ├── MyWorkflowTwo.java
│ │ │ │ └── MyWorkflowTwoImpl.java
│ │ │ ├── fileprocessing/
│ │ │ │ ├── FileProcessingStarter.java
│ │ │ │ ├── FileProcessingWorker.java
│ │ │ │ ├── FileProcessingWorkflow.java
│ │ │ │ ├── FileProcessingWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ ├── StoreActivities.java
│ │ │ │ └── StoreActivitiesImpl.java
│ │ │ ├── getresultsasync/
│ │ │ │ ├── MyWorkflow.java
│ │ │ │ ├── MyWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ ├── Starter.java
│ │ │ │ └── Worker.java
│ │ │ ├── hello/
│ │ │ │ ├── HelloAccumulator.java
│ │ │ │ ├── HelloActivity.java
│ │ │ │ ├── HelloActivityExclusiveChoice.java
│ │ │ │ ├── HelloActivityRetry.java
│ │ │ │ ├── HelloAsync.java
│ │ │ │ ├── HelloAsyncActivityCompletion.java
│ │ │ │ ├── HelloAsyncLambda.java
│ │ │ │ ├── HelloAwait.java
│ │ │ │ ├── HelloCancellationScope.java
│ │ │ │ ├── HelloCancellationScopeWithTimer.java
│ │ │ │ ├── HelloChild.java
│ │ │ │ ├── HelloCron.java
│ │ │ │ ├── HelloDelayedStart.java
│ │ │ │ ├── HelloDetachedCancellationScope.java
│ │ │ │ ├── HelloDynamic.java
│ │ │ │ ├── HelloEagerWorkflowStart.java
│ │ │ │ ├── HelloException.java
│ │ │ │ ├── HelloLocalActivity.java
│ │ │ │ ├── HelloParallelActivity.java
│ │ │ │ ├── HelloPeriodic.java
│ │ │ │ ├── HelloPolymorphicActivity.java
│ │ │ │ ├── HelloQuery.java
│ │ │ │ ├── HelloSaga.java
│ │ │ │ ├── HelloSchedules.java
│ │ │ │ ├── HelloSearchAttributes.java
│ │ │ │ ├── HelloSideEffect.java
│ │ │ │ ├── HelloSignal.java
│ │ │ │ ├── HelloSignalWithStartAndWorkflowInit.java
│ │ │ │ ├── HelloSignalWithTimer.java
│ │ │ │ ├── HelloStandaloneActivity.java
│ │ │ │ ├── HelloTypedSearchAttributes.java
│ │ │ │ ├── HelloUpdate.java
│ │ │ │ ├── HelloWorkflowTimer.java
│ │ │ │ └── README.md
│ │ │ ├── keymanagementencryption/
│ │ │ │ └── awsencryptionsdk/
│ │ │ │ ├── EncryptedPayloads.java
│ │ │ │ ├── KeyringCodec.java
│ │ │ │ └── README.md
│ │ │ ├── listworkflows/
│ │ │ │ ├── Customer.java
│ │ │ │ ├── CustomerActivities.java
│ │ │ │ ├── CustomerActivitiesImpl.java
│ │ │ │ ├── CustomerWorkflow.java
│ │ │ │ ├── CustomerWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── Starter.java
│ │ │ ├── metrics/
│ │ │ │ ├── MetricsStarter.java
│ │ │ │ ├── MetricsUtils.java
│ │ │ │ ├── MetricsWorker.java
│ │ │ │ ├── README.md
│ │ │ │ ├── activities/
│ │ │ │ │ ├── MetricsActivities.java
│ │ │ │ │ └── MetricsActivitiesImpl.java
│ │ │ │ └── workflow/
│ │ │ │ ├── MetricsWorkflow.java
│ │ │ │ └── MetricsWorkflowImpl.java
│ │ │ ├── moneybatch/
│ │ │ │ ├── Account.java
│ │ │ │ ├── AccountActivityWorker.java
│ │ │ │ ├── AccountImpl.java
│ │ │ │ ├── AccountTransferWorker.java
│ │ │ │ ├── AccountTransferWorkflow.java
│ │ │ │ ├── AccountTransferWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── TransferRequester.java
│ │ │ ├── moneytransfer/
│ │ │ │ ├── Account.java
│ │ │ │ ├── AccountActivityWorker.java
│ │ │ │ ├── AccountImpl.java
│ │ │ │ ├── AccountTransferWorker.java
│ │ │ │ ├── AccountTransferWorkflow.java
│ │ │ │ ├── AccountTransferWorkflowImpl.java
│ │ │ │ ├── README.MD
│ │ │ │ └── TransferRequester.java
│ │ │ ├── nexus/
│ │ │ │ ├── README.MD
│ │ │ │ ├── caller/
│ │ │ │ │ ├── CallerStarter.java
│ │ │ │ │ ├── CallerWorker.java
│ │ │ │ │ ├── EchoCallerWorkflow.java
│ │ │ │ │ ├── EchoCallerWorkflowImpl.java
│ │ │ │ │ ├── HelloCallerWorkflow.java
│ │ │ │ │ └── HelloCallerWorkflowImpl.java
│ │ │ │ ├── handler/
│ │ │ │ │ ├── EchoClient.java
│ │ │ │ │ ├── EchoClientImpl.java
│ │ │ │ │ ├── HandlerWorker.java
│ │ │ │ │ ├── HelloHandlerWorkflow.java
│ │ │ │ │ ├── HelloHandlerWorkflowImpl.java
│ │ │ │ │ └── SampleNexusServiceImpl.java
│ │ │ │ ├── options/
│ │ │ │ │ └── ClientOptions.java
│ │ │ │ └── service/
│ │ │ │ ├── SampleNexusService.java
│ │ │ │ └── description.md
│ │ │ ├── nexuscancellation/
│ │ │ │ ├── README.MD
│ │ │ │ ├── caller/
│ │ │ │ │ ├── CallerStarter.java
│ │ │ │ │ ├── CallerWorker.java
│ │ │ │ │ ├── HelloCallerWorkflow.java
│ │ │ │ │ └── HelloCallerWorkflowImpl.java
│ │ │ │ └── handler/
│ │ │ │ ├── HandlerWorker.java
│ │ │ │ └── HelloHandlerWorkflowImpl.java
│ │ │ ├── nexuscontextpropagation/
│ │ │ │ ├── README.MD
│ │ │ │ ├── caller/
│ │ │ │ │ ├── CallerStarter.java
│ │ │ │ │ ├── CallerWorker.java
│ │ │ │ │ ├── EchoCallerWorkflowImpl.java
│ │ │ │ │ └── HelloCallerWorkflowImpl.java
│ │ │ │ ├── handler/
│ │ │ │ │ ├── HandlerWorker.java
│ │ │ │ │ ├── HelloHandlerWorkflowImpl.java
│ │ │ │ │ └── SampleNexusServiceImpl.java
│ │ │ │ └── propagation/
│ │ │ │ ├── MDCContextPropagator.java
│ │ │ │ └── NexusMDCContextInterceptor.java
│ │ │ ├── nexusmessaging/
│ │ │ │ ├── README.md
│ │ │ │ ├── callerpattern/
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── caller/
│ │ │ │ │ │ ├── CallerStarter.java
│ │ │ │ │ │ ├── CallerWorker.java
│ │ │ │ │ │ ├── CallerWorkflow.java
│ │ │ │ │ │ └── CallerWorkflowImpl.java
│ │ │ │ │ ├── handler/
│ │ │ │ │ │ ├── GreetingActivity.java
│ │ │ │ │ │ ├── GreetingActivityImpl.java
│ │ │ │ │ │ ├── GreetingWorkflow.java
│ │ │ │ │ │ ├── GreetingWorkflowImpl.java
│ │ │ │ │ │ ├── HandlerWorker.java
│ │ │ │ │ │ └── NexusGreetingServiceImpl.java
│ │ │ │ │ └── service/
│ │ │ │ │ ├── Language.java
│ │ │ │ │ └── NexusGreetingService.java
│ │ │ │ └── ondemandpattern/
│ │ │ │ ├── README.md
│ │ │ │ ├── caller/
│ │ │ │ │ ├── CallerRemoteStarter.java
│ │ │ │ │ ├── CallerRemoteWorker.java
│ │ │ │ │ ├── CallerRemoteWorkflow.java
│ │ │ │ │ └── CallerRemoteWorkflowImpl.java
│ │ │ │ ├── handler/
│ │ │ │ │ ├── GreetingActivity.java
│ │ │ │ │ ├── GreetingActivityImpl.java
│ │ │ │ │ ├── GreetingWorkflow.java
│ │ │ │ │ ├── GreetingWorkflowImpl.java
│ │ │ │ │ ├── HandlerWorker.java
│ │ │ │ │ └── NexusRemoteGreetingServiceImpl.java
│ │ │ │ └── service/
│ │ │ │ ├── Language.java
│ │ │ │ └── NexusRemoteGreetingService.java
│ │ │ ├── nexusmultipleargs/
│ │ │ │ ├── README.MD
│ │ │ │ ├── caller/
│ │ │ │ │ ├── CallerStarter.java
│ │ │ │ │ ├── CallerWorker.java
│ │ │ │ │ ├── EchoCallerWorkflow.java
│ │ │ │ │ ├── EchoCallerWorkflowImpl.java
│ │ │ │ │ ├── HelloCallerWorkflow.java
│ │ │ │ │ └── HelloCallerWorkflowImpl.java
│ │ │ │ └── handler/
│ │ │ │ ├── HandlerWorker.java
│ │ │ │ ├── HelloHandlerWorkflow.java
│ │ │ │ ├── HelloHandlerWorkflowImpl.java
│ │ │ │ └── SampleNexusServiceImpl.java
│ │ │ ├── packetdelivery/
│ │ │ │ ├── Packet.java
│ │ │ │ ├── PacketDelivery.java
│ │ │ │ ├── PacketDeliveryActivities.java
│ │ │ │ ├── PacketDeliveryActivitiesImpl.java
│ │ │ │ ├── PacketDeliveryWorkflow.java
│ │ │ │ ├── PacketDeliveryWorkflowImpl.java
│ │ │ │ ├── PacketUtils.java
│ │ │ │ ├── README.md
│ │ │ │ └── Starter.java
│ │ │ ├── payloadconverter/
│ │ │ │ ├── cloudevents/
│ │ │ │ │ ├── CEWorkflow.java
│ │ │ │ │ ├── CEWorkflowImpl.java
│ │ │ │ │ ├── CloudEventsPayloadConverter.java
│ │ │ │ │ ├── README.md
│ │ │ │ │ └── Starter.java
│ │ │ │ └── crypto/
│ │ │ │ ├── CryptoWorkflow.java
│ │ │ │ ├── CryptoWorkflowImpl.java
│ │ │ │ ├── MyCustomer.java
│ │ │ │ ├── README.md
│ │ │ │ └── Starter.java
│ │ │ ├── peractivityoptions/
│ │ │ │ ├── FailingActivities.java
│ │ │ │ ├── FailingActivitiesImpl.java
│ │ │ │ ├── PerActivityOptionsWorkflow.java
│ │ │ │ ├── PerActivityOptionsWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── Starter.java
│ │ │ ├── polling/
│ │ │ │ ├── PollingActivities.java
│ │ │ │ ├── PollingWorkflow.java
│ │ │ │ ├── README.md
│ │ │ │ ├── TestService.java
│ │ │ │ ├── frequent/
│ │ │ │ │ ├── FrequentPollingActivityImpl.java
│ │ │ │ │ ├── FrequentPollingStarter.java
│ │ │ │ │ ├── FrequentPollingWorkflowImpl.java
│ │ │ │ │ └── README.md
│ │ │ │ ├── infrequent/
│ │ │ │ │ ├── InfrequentPollingActivityImpl.java
│ │ │ │ │ ├── InfrequentPollingStarter.java
│ │ │ │ │ ├── InfrequentPollingWorkflowImpl.java
│ │ │ │ │ └── README.md
│ │ │ │ ├── infrequentwithretryafter/
│ │ │ │ │ ├── InfrequentPollingWithRetryAfterActivityImpl.java
│ │ │ │ │ ├── InfrequentPollingWithRetryAfterStarter.java
│ │ │ │ │ ├── InfrequentPollingWithRetryAfterWorkflowImpl.java
│ │ │ │ │ └── README.md
│ │ │ │ └── periodicsequence/
│ │ │ │ ├── PeriodicPollingActivityImpl.java
│ │ │ │ ├── PeriodicPollingChildWorkflowImpl.java
│ │ │ │ ├── PeriodicPollingStarter.java
│ │ │ │ ├── PeriodicPollingWorkflowImpl.java
│ │ │ │ ├── PollingChildWorkflow.java
│ │ │ │ └── README.md
│ │ │ ├── retryonsignalinterceptor/
│ │ │ │ ├── FailureRequester.java
│ │ │ │ ├── MyActivity.java
│ │ │ │ ├── MyActivityImpl.java
│ │ │ │ ├── MyWorkflow.java
│ │ │ │ ├── MyWorkflowImpl.java
│ │ │ │ ├── MyWorkflowWorker.java
│ │ │ │ ├── QueryRequester.java
│ │ │ │ ├── README.MD
│ │ │ │ ├── RetryOnSignalInterceptorListener.java
│ │ │ │ ├── RetryOnSignalWorkerInterceptor.java
│ │ │ │ ├── RetryOnSignalWorkflowInboundCallsInterceptor.java
│ │ │ │ ├── RetryOnSignalWorkflowOutboundCallsInterceptor.java
│ │ │ │ └── RetryRequester.java
│ │ │ ├── safemessagepassing/
│ │ │ │ ├── ClusterManagerActivities.java
│ │ │ │ ├── ClusterManagerActivitiesImpl.java
│ │ │ │ ├── ClusterManagerWorkflow.java
│ │ │ │ ├── ClusterManagerWorkflowImpl.java
│ │ │ │ ├── ClusterManagerWorkflowStarter.java
│ │ │ │ ├── ClusterManagerWorkflowWorker.java
│ │ │ │ └── README.md
│ │ │ ├── sleepfordays/
│ │ │ │ ├── README.md
│ │ │ │ ├── SendEmailActivity.java
│ │ │ │ ├── SendEmailActivityImpl.java
│ │ │ │ ├── SleepForDaysImpl.java
│ │ │ │ ├── SleepForDaysWorkflow.java
│ │ │ │ ├── Starter.java
│ │ │ │ └── Worker.java
│ │ │ ├── ssl/
│ │ │ │ ├── MyWorkflow.java
│ │ │ │ ├── MyWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ ├── SslEnabledWorkerCustomCA.java
│ │ │ │ └── Starter.java
│ │ │ ├── standaloneactivities/
│ │ │ │ ├── CountActivities.java
│ │ │ │ ├── ExecuteActivity.java
│ │ │ │ ├── GreetingActivities.java
│ │ │ │ ├── GreetingActivitiesImpl.java
│ │ │ │ ├── ListActivities.java
│ │ │ │ ├── README.md
│ │ │ │ ├── StandaloneActivityWorker.java
│ │ │ │ └── StartActivity.java
│ │ │ ├── terminateworkflow/
│ │ │ │ ├── MyWorkflow.java
│ │ │ │ ├── MyWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── Starter.java
│ │ │ ├── tracing/
│ │ │ │ ├── JaegerUtils.java
│ │ │ │ ├── README.md
│ │ │ │ ├── Starter.java
│ │ │ │ ├── TracingWorker.java
│ │ │ │ └── workflow/
│ │ │ │ ├── TracingActivities.java
│ │ │ │ ├── TracingActivitiesImpl.java
│ │ │ │ ├── TracingChildWorkflow.java
│ │ │ │ ├── TracingChildWorkflowImpl.java
│ │ │ │ ├── TracingWorkflow.java
│ │ │ │ └── TracingWorkflowImpl.java
│ │ │ ├── updatabletimer/
│ │ │ │ ├── DynamicSleepWorkflow.java
│ │ │ │ ├── DynamicSleepWorkflowImpl.java
│ │ │ │ ├── DynamicSleepWorkflowStarter.java
│ │ │ │ ├── DynamicSleepWorkflowWorker.java
│ │ │ │ ├── README.md
│ │ │ │ ├── UpdatableTimer.java
│ │ │ │ └── WakeUpTimeUpdater.java
│ │ │ └── workerversioning/
│ │ │ ├── Activities.java
│ │ │ ├── ActivitiesImpl.java
│ │ │ ├── AutoUpgradingWorkflow.java
│ │ │ ├── AutoUpgradingWorkflowV1Impl.java
│ │ │ ├── AutoUpgradingWorkflowV1bImpl.java
│ │ │ ├── PinnedWorkflow.java
│ │ │ ├── PinnedWorkflowV1Impl.java
│ │ │ ├── PinnedWorkflowV2Impl.java
│ │ │ ├── README.md
│ │ │ ├── Starter.java
│ │ │ ├── WorkerV1.java
│ │ │ ├── WorkerV1_1.java
│ │ │ └── WorkerV2.java
│ │ └── resources/
│ │ ├── config.toml
│ │ ├── dsl/
│ │ │ └── sampleflow.json
│ │ └── logback.xml
│ └── test/
│ ├── java/
│ │ └── io/
│ │ └── temporal/
│ │ └── samples/
│ │ ├── asyncchild/
│ │ │ └── AsyncChildTest.java
│ │ ├── asyncuntypedchild/
│ │ │ └── AsyncUntypedChildTest.java
│ │ ├── batch/
│ │ │ ├── heartbeatingactivity/
│ │ │ │ └── HeartbeatingActivityBatchWorkflowTest.java
│ │ │ ├── iterator/
│ │ │ │ └── IteratorIteratorBatchWorkflowTest.java
│ │ │ └── slidingwindow/
│ │ │ └── SlidingWindowBatchWorkflowTest.java
│ │ ├── bookingsaga/
│ │ │ └── TripBookingWorkflowTest.java
│ │ ├── bookingsyncsaga/
│ │ │ └── TripBookingWorkflowTest.java
│ │ ├── countinterceptor/
│ │ │ ├── ClientCountInterceptorTest.java
│ │ │ └── WorkerCountInterceptorTest.java
│ │ ├── dsl/
│ │ │ └── DslWorkflowTest.java
│ │ ├── earlyreturn/
│ │ │ └── TransactionWorkflowTest.java
│ │ ├── encodefailures/
│ │ │ └── EncodeFailuresTest.java
│ │ ├── excludefrominterceptor/
│ │ │ └── ExcludeFromInterceptorTest.java
│ │ ├── fileprocessing/
│ │ │ └── FileProcessingTest.java
│ │ ├── getresultsasync/
│ │ │ └── GetResultsAsyncTest.java
│ │ ├── hello/
│ │ │ ├── HelloAccumulatorTest.java
│ │ │ ├── HelloActivityExclusiveChoiceJUnit5Test.java
│ │ │ ├── HelloActivityExclusiveChoiceTest.java
│ │ │ ├── HelloActivityJUnit5Test.java
│ │ │ ├── HelloActivityReplayTest.java
│ │ │ ├── HelloActivityRetryTest.java
│ │ │ ├── HelloActivityTest.java
│ │ │ ├── HelloAsyncActivityCompletionTest.java
│ │ │ ├── HelloAsyncLambdaTest.java
│ │ │ ├── HelloAsyncTest.java
│ │ │ ├── HelloAwaitTest.java
│ │ │ ├── HelloCancellationScopeTest.java
│ │ │ ├── HelloCancellationScopeWithTimerTest.java
│ │ │ ├── HelloChildJUnit5Test.java
│ │ │ ├── HelloChildTest.java
│ │ │ ├── HelloCronTest.java
│ │ │ ├── HelloDelayedStartTest.java
│ │ │ ├── HelloDetachedCancellationScopeTest.java
│ │ │ ├── HelloDynamicActivityJUnit5Test.java
│ │ │ ├── HelloDynamicTest.java
│ │ │ ├── HelloEagerWorkflowStartTest.java
│ │ │ ├── HelloExceptionTest.java
│ │ │ ├── HelloLocalActivityTest.java
│ │ │ ├── HelloParallelActivityTest.java
│ │ │ ├── HelloPeriodicTest.java
│ │ │ ├── HelloPolymorphicActivityTest.java
│ │ │ ├── HelloQueryTest.java
│ │ │ ├── HelloSearchAttributesTest.java
│ │ │ ├── HelloSideEffectTest.java
│ │ │ ├── HelloSignalTest.java
│ │ │ ├── HelloSignalWithStartAndWorkflowInitTest.java
│ │ │ ├── HelloSignalWithTimerTest.java
│ │ │ ├── HelloStandaloneActivityTest.java
│ │ │ ├── HelloUpdateAndCancellationTest.java
│ │ │ ├── HelloUpdateTest.java
│ │ │ └── HelloWorkflowTimerTest.java
│ │ ├── interceptorreplaytest/
│ │ │ └── InterceptorReplayTest.java
│ │ ├── listworkflows/
│ │ │ └── ListWorkflowsTest.java
│ │ ├── metrics/
│ │ │ └── MetricsTest.java
│ │ ├── moneybatch/
│ │ │ └── TransferWorkflowTest.java
│ │ ├── moneytransfer/
│ │ │ └── TransferWorkflowTest.java
│ │ ├── nexus/
│ │ │ └── caller/
│ │ │ ├── CallerWorkflowJunit5MockTest.java
│ │ │ ├── CallerWorkflowJunit5Test.java
│ │ │ ├── CallerWorkflowMockTest.java
│ │ │ ├── CallerWorkflowTest.java
│ │ │ ├── NexusServiceJunit5Test.java
│ │ │ └── NexusServiceMockTest.java
│ │ ├── payloadconverter/
│ │ │ ├── CloudEventsPayloadConverterTest.java
│ │ │ └── CryptoPayloadConverterTest.java
│ │ ├── peractivityoptions/
│ │ │ └── PerActivityOptionsTest.java
│ │ ├── polling/
│ │ │ ├── FrequentPollingTest.java
│ │ │ ├── InfrequentPollingTest.java
│ │ │ └── PeriodicPollingTest.java
│ │ ├── retryonsignalinterceptor/
│ │ │ └── RetryOnSignalInterceptorTest.java
│ │ ├── safemessagepassing/
│ │ │ └── ClusterManagerWorkflowWorkerTest.java
│ │ ├── sleepfordays/
│ │ │ ├── SleepForDaysJUnit5Test.java
│ │ │ └── SleepForDaysTest.java
│ │ ├── standaloneactivities/
│ │ │ └── StandaloneActivitiesTest.java
│ │ ├── terminateworkflow/
│ │ │ └── TerminateWorkflowTest.java
│ │ └── tracing/
│ │ └── TracingTest.java
│ └── resources/
│ └── dsl/
│ └── sampleflow.json
├── docker/
│ └── github/
│ ├── Dockerfile
│ ├── README.md
│ └── docker-compose.yaml
├── gradle/
│ ├── springai.gradle
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
├── springai/
│ ├── basic/
│ │ ├── build.gradle
│ │ └── src/
│ │ └── main/
│ │ ├── java/
│ │ │ └── io/
│ │ │ └── temporal/
│ │ │ └── samples/
│ │ │ └── springai/
│ │ │ └── chat/
│ │ │ ├── ChatExampleApplication.java
│ │ │ ├── ChatWorkflow.java
│ │ │ ├── ChatWorkflowImpl.java
│ │ │ ├── StringTools.java
│ │ │ ├── TimestampTools.java
│ │ │ ├── WeatherActivity.java
│ │ │ └── WeatherActivityImpl.java
│ │ └── resources/
│ │ └── application.yaml
│ ├── mcp/
│ │ ├── build.gradle
│ │ └── src/
│ │ └── main/
│ │ ├── java/
│ │ │ └── io/
│ │ │ └── temporal/
│ │ │ └── samples/
│ │ │ └── springai/
│ │ │ └── mcp/
│ │ │ ├── McpApplication.java
│ │ │ ├── McpWorkflow.java
│ │ │ └── McpWorkflowImpl.java
│ │ └── resources/
│ │ └── application.yaml
│ ├── multimodel/
│ │ ├── build.gradle
│ │ └── src/
│ │ └── main/
│ │ ├── java/
│ │ │ └── io/
│ │ │ └── temporal/
│ │ │ └── samples/
│ │ │ └── springai/
│ │ │ └── multimodel/
│ │ │ ├── ChatModelConfig.java
│ │ │ ├── MultiModelApplication.java
│ │ │ ├── MultiModelWorkflow.java
│ │ │ └── MultiModelWorkflowImpl.java
│ │ └── resources/
│ │ └── application.yaml
│ └── rag/
│ ├── build.gradle
│ └── src/
│ └── main/
│ ├── java/
│ │ └── io/
│ │ └── temporal/
│ │ └── samples/
│ │ └── springai/
│ │ └── rag/
│ │ ├── RagApplication.java
│ │ ├── RagWorkflow.java
│ │ ├── RagWorkflowImpl.java
│ │ └── VectorStoreConfig.java
│ └── resources/
│ └── application.yaml
├── springboot/
│ ├── build.gradle
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── io/
│ │ │ └── temporal/
│ │ │ └── samples/
│ │ │ └── springboot/
│ │ │ ├── SamplesController.java
│ │ │ ├── TemporalSpringbootSamplesApplication.java
│ │ │ ├── actuator/
│ │ │ │ ├── README.md
│ │ │ │ └── WorkerActuatorEndpoint.java
│ │ │ ├── camel/
│ │ │ │ ├── CamelConfig.java
│ │ │ │ ├── CamelResource.java
│ │ │ │ ├── CamelRoutes.java
│ │ │ │ ├── OfficeOrder.java
│ │ │ │ ├── OrderActivity.java
│ │ │ │ ├── OrderActivityImpl.java
│ │ │ │ ├── OrderRepository.java
│ │ │ │ ├── OrderWorkflow.java
│ │ │ │ ├── OrderWorkflowImpl.java
│ │ │ │ └── README.md
│ │ │ ├── customize/
│ │ │ │ ├── CustomizeActivity.java
│ │ │ │ ├── CustomizeActivityImpl.java
│ │ │ │ ├── CustomizeWorkflow.java
│ │ │ │ ├── CustomizeWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── TemporalOptionsConfig.java
│ │ │ ├── hello/
│ │ │ │ ├── HelloActivity.java
│ │ │ │ ├── HelloActivityImpl.java
│ │ │ │ ├── HelloWorkflow.java
│ │ │ │ ├── HelloWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── model/
│ │ │ │ └── Person.java
│ │ │ ├── kafka/
│ │ │ │ ├── KafkaActivity.java
│ │ │ │ ├── KafkaActivityImpl.java
│ │ │ │ ├── KafkaConfig.java
│ │ │ │ ├── MessageController.java
│ │ │ │ ├── MessageWorkflow.java
│ │ │ │ ├── MessageWorkflowImpl.java
│ │ │ │ └── README.md
│ │ │ ├── metrics/
│ │ │ │ └── README.md
│ │ │ └── update/
│ │ │ ├── ProductNotAvailableForAmountException.java
│ │ │ ├── PurchaseActivities.java
│ │ │ ├── PurchaseActivitiesImpl.java
│ │ │ ├── PurchaseWorkflow.java
│ │ │ ├── PurchaseWorkflowImpl.java
│ │ │ ├── README.md
│ │ │ ├── ResourceNotFoundException.java
│ │ │ └── model/
│ │ │ ├── Product.java
│ │ │ ├── ProductRepository.java
│ │ │ └── Purchase.java
│ │ └── resources/
│ │ ├── application-tc.yaml
│ │ ├── application.yaml
│ │ ├── data.sql
│ │ ├── static/
│ │ │ └── js/
│ │ │ ├── jquery.sse.js
│ │ │ └── samplessse.js
│ │ └── templates/
│ │ ├── actuator.html
│ │ ├── camel.html
│ │ ├── customize.html
│ │ ├── fragments.html
│ │ ├── hello.html
│ │ ├── index.html
│ │ ├── kafka.html
│ │ ├── metrics.html
│ │ └── update.html
│ └── test/
│ ├── java/
│ │ └── io/
│ │ └── temporal/
│ │ └── samples/
│ │ └── springboot/
│ │ ├── CamelSampleTest.java
│ │ ├── CustomizeSampleTest.java
│ │ ├── HelloSampleTest.java
│ │ ├── HelloSampleTestMockedActivity.java
│ │ ├── KafkaConsumerTestHelper.java
│ │ ├── KafkaSampleTest.java
│ │ └── UpdateSampleTest.java
│ └── resources/
│ ├── application.yaml
│ └── data.sql
└── springboot-basic/
├── build.gradle
└── src/
├── main/
│ ├── java/
│ │ └── io/
│ │ └── temporal/
│ │ └── samples/
│ │ └── springboot/
│ │ ├── SamplesController.java
│ │ ├── TemporalSpringbootSamplesApplication.java
│ │ └── hello/
│ │ ├── HelloActivity.java
│ │ ├── HelloActivityImpl.java
│ │ ├── HelloWorkflow.java
│ │ ├── HelloWorkflowImpl.java
│ │ ├── README.md
│ │ └── model/
│ │ └── Person.java
│ └── resources/
│ ├── application-tc.yaml
│ ├── application.yaml
│ ├── static/
│ │ └── js/
│ │ ├── jquery.sse.js
│ │ └── samplessse.js
│ └── templates/
│ ├── fragments.html
│ ├── hello.html
│ └── index.html
└── test/
├── java/
│ └── io/
│ └── temporal/
│ └── samples/
│ └── springboot/
│ └── HelloSampleTest.java
└── resources/
└── application.yaml
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/CODEOWNERS
================================================
# Primary owners
* @tsurdilo @temporalio/sdk @antmendoza
# Below are owners for samples for modules
# that are owned by teams other than the SDK team.
# For each one, we add the owning team, as well as
# @temporalio/sdk, so the SDK team can continue to
# manage repo-wide concerns
/springai/ @temporalio/ai-sdk @temporalio/sdk
================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
================================================
FILE: .github/workflows/ci.yml
================================================
name: "Continuous Integration"
on: [push, pull_request]
permissions:
contents: read
jobs:
validation:
name: "Gradle wrapper validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: gradle/actions/wrapper-validation@ac396bf1a80af16236baf54bd7330ae21dc6ece5 # v6
unittest:
name: Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}
- name: Run unit tests
run: |
docker compose -f ./docker/github/docker-compose.yaml up --exit-code-from unit-test unit-test
code_format:
name: Code format
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: "17"
distribution: "temurin"
- name: Set up Gradle
uses: gradle/actions/setup-gradle@ac396bf1a80af16236baf54bd7330ae21dc6ece5 # v6
- name: Run copyright and code format checks
run: ./gradlew --no-daemon spotlessCheck
================================================
FILE: .gitignore
================================================
target
.*.swp
.*.swo
*.iml
.DS_Store
.idea
.gradle
**/build/
**/out/
.classpath
.project
.settings/
bin/
core/.vscode/
.claude/
================================================
FILE: LICENSE
================================================
Temporal Java SDK
Copyright (c) 2025 Temporal Technologies, Inc. All Rights Reserved
Copyright (c) 2017 Uber Technologies, Inc. All Rights Reserved
Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
================================================
FILE: README.md
================================================
# Temporal Java SDK Samples
This repository contains samples that demonstrate various capabilities of
Temporal using the [Java SDK](https://github.com/temporalio/sdk-java).
It contains the following modules:
* [Core](/core): showcases many different SDK features.
* [SpringBoot](/springboot): showcases SpringBoot autoconfig integration.
* [SpringBoot Basic](/springboot-basic): Minimal sample showing SpringBoot autoconfig integration without any extra external dependencies.
* [Spring AI](/springai): demonstrates the Temporal Spring AI integration — durable AI agents with chat models, tools, MCP servers, vector stores, and embeddings.
## Learn more about Temporal and Java SDK
- [Temporal Server repo](https://github.com/temporalio/temporal)
- [Java SDK repo](https://github.com/temporalio/sdk-java)
- [Java SDK Guide](https://docs.temporal.io/dev-guide/java)
## Requirements
- Java 17+
- Local Temporal Server, easiest to get started would be using [Temporal CLI](https://github.com/temporalio/cli).
For more options see docs [here](https://docs.temporal.io/kb/all-the-ways-to-run-a-cluster).
## Build and run tests
1. Clone this repository:
git clone https://github.com/temporalio/samples-java
cd samples-java
2. Build and run Tests
./gradlew build
## Running Samples:
You can run both "Core" and "SpringBoot" samples from the main samples project directory.
Details on how to run each sample can be found in following two sections.
To skip to SpringBoot samples click [here](#Running-SpringBoot-Samples).
### Running "Core" samples
See the README.md file in each main sample directory for cut/paste Gradle command to run specific example.
<!-- @@@SNIPSTART samples-java-readme-samples-directory -->
#### Hello samples
- [**Hello**](/core/src/main/java/io/temporal/samples/hello): This sample includes a number of individual Workflows that can be executed independently. Each one demonstrates something specific.
- [**HelloAccumulator**](/core/src/main/java/io/temporal/samples/hello/HelloAccumulator.java): Demonstrates a Workflow Definition that accumulates signals and continues as new.
- [**HelloActivity**](/core/src/main/java/io/temporal/samples/hello/HelloActivity.java): Demonstrates a Workflow Definition that executes a single Activity.
- [**HelloActivityRetry**](/core/src/main/java/io/temporal/samples/hello/HelloActivityRetry.java): Demonstrates how to Retry an Activity Execution.
- [**HelloActivityExclusiveChoice**](/core/src/main/java/io/temporal/samples/hello/HelloActivityExclusiveChoice.java): Demonstrates how to execute Activities based on dynamic input.
- [**HelloAsync**](/core/src/main/java/io/temporal/samples/hello/HelloAsync.java): Demonstrates how to execute Activities asynchronously and wait for them using Promises.
- [**HelloAwait**](/core/src/main/java/io/temporal/samples/hello/HelloAwait.java): Demonstrates how to use Await statement to wait for a condition.
- [**HelloParallelActivity**](/core/src/main/java/io/temporal/samples/hello/HelloParallelActivity.java): Demonstrates how to execute multiple Activities in parallel, asynchronously, and wait for them using `Promise.allOf`.
- [**HelloAsyncActivityCompletion**](/core/src/main/java/io/temporal/samples/hello/HelloAsyncActivityCompletion.java): Demonstrates how to complete an Activity Execution asynchronously.
- [**HelloAsyncLambda**](/core/src/main/java/io/temporal/samples/hello/HelloAsyncLambda.java): Demonstrates how to execute part of a Workflow asynchronously in a separate task (thread).
- [**HelloCancellationScope**](/core/src/main/java/io/temporal/samples/hello/HelloCancellationScope.java): Demonstrates how to explicitly cancel parts of a Workflow Execution.
- [**HelloCancellationScopeWithTimer**](/core/src/main/java/io/temporal/samples/hello/HelloCancellationScopeWithTimer.java): Demonstrates how to cancel activity when workflow timer fires and complete execution. This can prefered over using workflow run/execution timeouts.
- [**HelloDetachedCancellationScope**](/core/src/main/java/io/temporal/samples/hello/HelloDetachedCancellationScope.java): Demonstrates how to execute cleanup code after a Workflow Execution has been explicitly cancelled.
- [**HelloChild**](/core/src/main/java/io/temporal/samples/hello/HelloChild.java): Demonstrates how to execute a simple Child Workflow.
- [**HelloCron**](/core/src/main/java/io/temporal/samples/hello/HelloCron.java): Demonstrates how to execute a Workflow according to a cron schedule.
- [**HelloDynamic**](/core/src/main/java/io/temporal/samples/hello/HelloDynamic.java): Demonstrates how to use `DynamicWorkflow` and `DynamicActivity` interfaces.
- [**HelloEagerWorkflowStart**](/core/src/main/java/io/temporal/samples/hello/HelloEagerWorkflowStart.java): Demonstrates the use of a eager workflow start.
- [**HelloPeriodic**](/core/src/main/java/io/temporal/samples/hello/HelloPeriodic.java): Demonstrates the use of the Continue-As-New feature.
- [**HelloException**](/core/src/main/java/io/temporal/samples/hello/HelloException.java): Demonstrates how to handle exception propagation and wrapping.
- [**HelloLocalActivity**](/core/src/main/java/io/temporal/samples/hello/HelloLocalActivity.java): Demonstrates the use of a [Local Activity](https://docs.temporal.io/docs/jargon/mesh/#local-activity).
- [**HelloPolymorphicActivity**](/core/src/main/java/io/temporal/samples/hello/HelloPolymorphicActivity.java): Demonstrates Activity Definitions that extend a common interface.
- [**HelloQuery**](/core/src/main/java/io/temporal/samples/hello/HelloQuery.java): Demonstrates how to Query the state of a Workflow Execution.
- [**HelloSchedules**](/core/src/main/java/io/temporal/samples/hello/HelloSchedules.java): Demonstrates how to create and interact with a Schedule.
- [**HelloSignal**](/core/src/main/java/io/temporal/samples/hello/HelloSignal.java): Demonstrates how to send and handle a Signal.
- [**HelloSaga**](/core/src/main/java/io/temporal/samples/hello/HelloSaga.java): Demonstrates how to use the SAGA feature.
- [**HelloSearchAttributes**](/core/src/main/java/io/temporal/samples/hello/HelloSearchAttributes.java): Demonstrates how to add custom Search Attributes to Workflow Executions.
- [**HelloSideEffect**](/core/src/main/java/io/temporal/samples/hello/HelloSideEffect.java)**: Demonstrates how to implement a Side Effect.
- [**HelloUpdate**](/core/src/main/java/io/temporal/samples/hello/HelloUpdate.java): Demonstrates how to create and interact with an Update.
- [**HelloDelayedStart**](/core/src/main/java/io/temporal/samples/hello/HelloDelayedStart.java): Demonstrates how to use delayed start config option when starting a Workflow Executions.
- [**HelloSignalWithTimer**](/core/src/main/java/io/temporal/samples/hello/HelloSignalWithTimer.java): Demonstrates how to use collect signals for certain amount of time and then process last one.
- [**HelloWorkflowTimer**](/core/src/main/java/io/temporal/samples/hello/HelloWorkflowTimer.java): Demonstrates how we can use workflow timer to restrict duration of workflow execution instead of workflow run/execution timeouts.
- [**Auto-Heartbeating**](/core/src/main/java/io/temporal/samples/autoheartbeat/): Demonstrates use of Auto-heartbeating utility via activity interceptor.
- [**HelloSignalWithStartAndWorkflowInit**](/core/src/main/java/io/temporal/samples/hello/HelloSignalWithStartAndWorkflowInit.java): Demonstrates how WorkflowInit can be useful with SignalWithStart to initialize workflow variables.
- [**HelloStandaloneActivity**](/core/src/main/java/io/temporal/samples/hello/HelloStandaloneActivity.java): Demonstrates how to execute a Standalone Activity directly from an ActivityClient, without a Workflow.
#### Scenario-based samples
- [**File Processing Sample**](/core/src/main/java/io/temporal/samples/fileprocessing): Demonstrates how to route tasks to specific Workers. This sample has a set of Activities that download a file, processes it, and uploads the result to a destination. Any Worker can execute the first Activity. However, the second and third Activities must be executed on the same host as the first one.
- [**Booking SAGA**](/core/src/main/java/io/temporal/samples/bookingsaga): Demonstrates Temporals take on the Camunda BPMN "trip booking" example.
- [**Synchronous Booking SAGA**](/core/src/main/java/io/temporal/samples/bookingsyncsaga): Demonstrates low latency SAGA with potentially long compensations.
- [**Money Transfer**](/core/src/main/java/io/temporal/samples/moneytransfer): Demonstrates the use of a dedicated Activity Worker.
- [**Money Batch**](/core/src/main/java/io/temporal/samples/moneybatch): Demonstrates a situation where a single deposit should be initiated for multiple withdrawals. For example, a seller might want to be paid once per fixed number of transactions. This sample can be easily extended to perform a payment based on more complex criteria, such as at a specific time or an accumulated amount. The sample also demonstrates how to Signal the Workflow when it executes (*Signal with start*). If the Workflow is already executing, it just receives the Signal. If it is not executing, then the Workflow executes first, and then the Signal is delivered to it. *Signal with start* is a "lazy" way to execute Workflows when Signaling them.
- [**Domain-Specific-Language - Define sequence of steps in JSON**](/core/src/main/java/io/temporal/samples/dsl): Demonstrates using domain specific language (DSL) defined in JSON to specify sequence of steps to be performed in our workflow.
- [**Polling Services**](/core/src/main/java/io/temporal/samples/polling): Recommended implementation of an activity that needs to periodically poll an external resource waiting its successful completion
- [**Heartbeating Activity Batch**](/core/src/main/java/io/temporal/samples/batch/heartbeatingactivity): Batch job implementation using a heartbeating activity.
- [**Iterator Batch**](/core/src/main/java/io/temporal/samples/batch/iterator): Batch job implementation using the workflow iterator pattern.
- [**Sliding Window Batch**](/core/src/main/java/io/temporal/samples/batch/slidingwindow): A batch implementation that maintains a configured number of child workflows during processing.
- [**Safe Message Passing**](/core/src/main/java/io/temporal/samples/safemessagepassing): Safely handling concurrent updates and signals messages.
- [**Custom Annotation**](/core/src/main/java/io/temporal/samples/customannotation): Demonstrates how to create a custom annotation using an interceptor.
- [**Async Packet Delivery**](/core/src/main/java/io/temporal/samples/packetdelivery): Demonstrates running multiple execution paths async within single execution.
- [**Worker Versioning**](/core/src/main/java/io/temporal/samples/workerversioning): Demonstrates how to use worker versioning to manage workflow code changes.
- [**Environment Configuration**](/core/src/main/java/io/temporal/samples/envconfig):
Load client configuration from TOML files with programmatic overrides.
#### API demonstrations
- [**Async Untyped Child Workflow**](/core/src/main/java/io/temporal/samples/asyncuntypedchild): Demonstrates how to invoke an untyped child workflow async, that can complete after parent workflow is already completed.
- [**Updatable Timer**](/core/src/main/java/io/temporal/samples/updatabletimer): Demonstrates the use of a helper class which relies on `Workflow.await` to implement a blocking sleep that can be updated at any moment.
- [**Workflow Count Interceptor**](/core/src/main/java/io/temporal/samples/countinterceptor): Demonstrates how to create and register a simple Workflow Count Interceptor.
- [**Workflow Retry On Signal Interceptor**](/core/src/main/java/io/temporal/samples/retryonsignalinterceptor): Demonstrates how to create and register an interceptor that retries an activity on a signal.
- [**List Workflows**](/core/src/main/java/io/temporal/samples/listworkflows): Demonstrates the use of custom search attributes and ListWorkflowExecutionsRequest with custom queries.
- [**Payload Converter - CloudEvents**](/core/src/main/java/io/temporal/samples/payloadconverter/cloudevents): Demonstrates the use of a custom payload converter for CloudEvents.
- [**Payload Converter - Crypto**](/core/src/main/java/io/temporal/samples/payloadconverter/crypto): Demonstrates the use of a custom payload converter using jackson-json-crypto.
- [**Async Child Workflow**](/core/src/main/java/io/temporal/samples/asyncchild): Demonstrates how to invoke a child workflow async, that can complete after parent workflow is already completed.
- [**Terminate Workflow**](/core/src/main/java/io/temporal/samples/terminateworkflow): Demonstrates how to terminate a workflow using client API.
- [**Get Workflow Results Async**](/core/src/main/java/io/temporal/samples/getresultsasync): Demonstrates how to start and get workflow results in async manner.
- [**Per Activity Type Options**](/core/src/main/java/io/temporal/samples/peractivityoptions): Demonstrates how to set per Activity type options.
- [**Configure WorkflowClient to use mTLS**](/core/src/main/java/io/temporal/samples/ssl): Demonstrates how to configure WorkflowClient when using mTLS.
- [**Configure WorkflowClient to use API Key**](/core/src/main/java/io/temporal/samples/apikey): Demonstrates how to configure WorkflowClient when using API Keys.
- [**Payload Codec**](/core/src/main/java/io/temporal/samples/encodefailures): Demonstrates how to use simple codec to encode/decode failure messages.
- [**Exclude Workflow/ActivityTypes from Interceptors**](/core/src/main/java/io/temporal/samples/excludefrominterceptor): Demonstrates how to exclude certain workflow / activity types from interceptors.
- [**Standalone Activities**](/core/src/main/java/io/temporal/samples/standaloneactivities): Demonstrates how to start, execute, list, and count Standalone Activities — Activities that run independently without a Workflow, using ActivityClient.
#### SDK Metrics
- [**Set up SDK metrics**](/core/src/main/java/io/temporal/samples/metrics): Demonstrates how to set up and scrape SDK metrics.
#### Tracing Support
- [**Set up OpenTracing and/or OpenTelemetry with Jaeger**](/core/src/main/java/io/temporal/samples/tracing): Demonstrates how to set up OpenTracing and/or OpenTelemetry and view traces using Jaeger.
#### Encryption Support
- [**Encrypted Payloads**](/core/src/main/java/io/temporal/samples/encryptedpayloads): Demonstrates how to use simple codec to encrypt and decrypt payloads.
- [**AWS Encryption SDK**](/core/src/main/java/io/temporal/samples/keymanagementencryption/awsencryptionsdk): Demonstrates how to use the AWS Encryption SDK to encrypt and decrypt payloads with AWS KMS.
#### Nexus Samples
- [**Getting Started**](/core/src/main/java/io/temporal/samples/nexus): Demonstrates how to get started with Temporal and Nexus.
- [**Mapping Multiple Arguments**](/core/src/main/java/io/temporal/samples/nexus): Demonstrates how map a Nexus operation to a Workflow that takes multiple arguments.
- [**Cancellation**](/core/src/main/java/io/temporal/samples/nexuscancellation): Demonstrates how to cancel an async Nexus operation.
- [**Context/Header Propagation**](/core/src/main/java/io/temporal/samples/nexuscontextpropagation): Demonstrates how to propagate context through Nexus operation headers.
- [**Nexus Messaging**](/core/src/main/java/io/temporal/samples/nexusmessaging): Demonstrates how to send signal, update and query messages through Nexus.
This contains two samples, one sending messages to an existing workflow and a second that creates a workflow through Nexus
and sends messages to it.
<!-- @@@SNIPEND -->
### Running SpringBoot Samples
These samples use SpringBoot 2 by default. To switch to using SpringBoot 3 look at the [gradle.properties](gradle.properties) file
and follow simple instructions there.
1. Start SpringBoot from main repo dir:
./gradlew :springboot:bootRun
To run the basic sample run
./gradlew :springboot-basic:bootRun
2. Navigate to [localhost:3030](http://localhost:3030)
3. Select which sample you want to run
More info on each sample:
- [**Hello**](/springboot/src/main/java/io/temporal/samples/springboot/hello): Invoke simple "Hello" workflow from a GET endpoint
- [**SDK Metrics**](/springboot/src/main/java/io/temporal/samples/springboot/metrics): Learn how to set up SDK Metrics
- [**Synchronous Update**](/springboot/src/main/java/io/temporal/samples/springboot/update): Learn how to use Synchronous Update feature with this purchase sample
- [**Kafka Request / Reply**](/springboot/src/main/java/io/temporal/samples/springboot/kafka): Sample showing possible integration with event streaming platforms such as Kafka
- [**Customize Options**](/springboot/src/main/java/io/temporal/samples/springboot/customize): Sample showing how to customize options such as WorkerOptions, WorkerFactoryOptions, etc (see options config [here](springboot/src/main/java/io/temporal/samples/springboot/customize/TemporalOptionsConfig.java))
- [**Apache Camel Route**](/springboot/src/main/java/io/temporal/samples/springboot/camel): Sample showing how to start Workflow execution from a Camel Route
- [**Custom Actuator Endpoint**](/springboot/src/main/java/io/temporal/samples/springboot/actuator): Sample showing how to create a custom Actuator endpoint that shows registered Workflow and Activity impls per task queue.
#### Temporal Cloud
To run any of the SpringBoot samples in your Temporal Cloud namespace:
1. Edit the [application-tc.yaml](/springboot/src/main/resources/application-tc.yaml) to set your namespace and client certificates.
2. Start SpringBoot from main repo dir with the `tc` profile:
./gradlew bootRun --args='--spring.profiles.active=tc'
3. Follow the previous section from step 2
### Running Spring AI Samples
The Spring AI samples demonstrate the [Temporal Spring AI integration](https://github.com/temporalio/sdk-java/tree/master/temporal-spring-ai), which makes Spring AI agents durable on Temporal — model calls run as Temporal Activities recorded in Workflow history, and tools are dispatched per their type so they fit Workflow execution.
Each sample is its own Spring Boot application with an interactive CLI. Run from the main repo dir:
./gradlew :springai:basic:bootRun
./gradlew :springai:mcp:bootRun
./gradlew :springai:multimodel:bootRun
./gradlew :springai:rag:bootRun
All samples need an `OPENAI_API_KEY` environment variable; some need additional setup (see each sample's source for details).
More info on each sample:
- [**Basic**](/springai/basic): Chat workflow with three tool flavors — activity-backed (`WeatherActivity`), plain workflow tools (`StringTools`), and `@SideEffectTool` (`TimestampTools`) — plus a `PromptChatMemoryAdvisor` for conversation history.
- [**MCP**](/springai/mcp): Connects to a Model Context Protocol server and exposes its tools to the AI through Temporal activities. Defaults to the filesystem MCP server.
- [**Multi-Model**](/springai/multimodel): Two providers in one workflow (OpenAI and Anthropic), per-model `ActivityOptions` overrides via a Spring bean, plus a route that exercises Anthropic's extended-thinking mode through provider-specific `ChatOptions` pass-through. Requires `ANTHROPIC_API_KEY` in addition to `OPENAI_API_KEY`.
- [**RAG**](/springai/rag): Vector store + embeddings for retrieval-augmented generation. Add documents, then ask questions; the workflow searches the vector store and grounds the answer in the retrieved context.
================================================
FILE: build.gradle
================================================
plugins {
id "net.ltgt.errorprone" version "4.0.1"
id 'com.diffplug.spotless' version '6.25.0' apply false
id "org.springframework.boot" version "${springBootPluginVersion}"
}
subprojects {
apply plugin: 'java'
apply plugin: 'net.ltgt.errorprone'
apply plugin: 'com.diffplug.spotless'
compileJava {
options.compilerArgs << "-Werror"
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
ext {
otelVersion = '1.30.1'
otelVersionAlpha = "${otelVersion}-alpha"
javaSDKVersion = '1.35.0'
camelVersion = '3.22.1'
jarVersion = '1.0.0'
}
repositories {
mavenLocal()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
mavenCentral()
}
dependencies {
}
apply plugin: 'com.diffplug.spotless'
spotless {
java {
target 'src/*/java/**/*.java'
targetExclude '**/.idea/**'
googleJavaFormat('1.24.0')
}
}
compileJava.dependsOn 'spotlessApply'
test {
useJUnitPlatform()
}
}
================================================
FILE: core/build.gradle
================================================
dependencies {
// Temporal SDK
implementation "io.temporal:temporal-sdk:$javaSDKVersion"
implementation "io.temporal:temporal-opentracing:$javaSDKVersion"
testImplementation("io.temporal:temporal-testing:$javaSDKVersion")
// Environment configuration
implementation "io.temporal:temporal-envconfig:$javaSDKVersion"
// Needed for SDK related functionality
implementation "io.grpc:grpc-util"
implementation(platform("com.fasterxml.jackson:jackson-bom:2.17.2"))
implementation "com.fasterxml.jackson.core:jackson-databind"
implementation "com.fasterxml.jackson.core:jackson-core"
implementation "io.micrometer:micrometer-registry-prometheus"
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.5.6'
implementation group: 'com.jayway.jsonpath', name: 'json-path', version: '2.9.0'
implementation(platform("io.opentelemetry:opentelemetry-bom:$otelVersion"))
implementation "io.opentelemetry:opentelemetry-sdk"
implementation "io.opentelemetry:opentelemetry-exporter-jaeger"
implementation "io.opentelemetry:opentelemetry-extension-trace-propagators"
implementation "io.opentelemetry:opentelemetry-opentracing-shim:$otelVersionAlpha"
implementation "io.opentelemetry:opentelemetry-semconv:$otelVersionAlpha"
implementation 'io.jaegertracing:jaeger-client:1.8.1'
// Used in samples
implementation group: 'commons-configuration', name: 'commons-configuration', version: '1.10'
implementation group: 'io.cloudevents', name: 'cloudevents-core', version: '4.0.1'
implementation group: 'io.cloudevents', name: 'cloudevents-api', version: '4.0.1'
implementation group: 'io.cloudevents', name: 'cloudevents-json-jackson', version: '3.0.0'
implementation group: 'net.thisptr', name: 'jackson-jq', version: '1.0.0-preview.20240207'
implementation group: 'commons-cli', name: 'commons-cli', version: '1.9.0'
// Used in AWS Encryption SDK sample
implementation group: 'com.amazonaws', name: 'aws-encryption-sdk-java', version: '3.0.1'
implementation("software.amazon.cryptography:aws-cryptographic-material-providers:1.0.2")
implementation(platform("software.amazon.awssdk:bom:2.20.91"))
implementation("software.amazon.awssdk:kms")
implementation("software.amazon.awssdk:dynamodb")
// we don't update it to 2.1.0 because 2.1.0 requires Java 11
implementation 'com.codingrodent:jackson-json-crypto:1.1.0'
testImplementation "junit:junit:4.13.2"
testImplementation "org.mockito:mockito-core:5.12.0"
testImplementation(platform("org.junit:junit-bom:5.10.3"))
testImplementation "org.junit.jupiter:junit-jupiter-api"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine"
dependencies {
errorproneJavac('com.google.errorprone:javac:9+181-r4173-1')
errorprone('com.google.errorprone:error_prone_core:2.28.0')
}
}
task execute(type: JavaExec) {
mainClass = findProperty("mainClass") ?: ""
classpath = sourceSets.main.runtimeClasspath
if (findProperty("args")) {
args findProperty("args").tokenize()
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/apikey/ApiKeyWorker.java
================================================
package io.temporal.samples.apikey;
import io.temporal.client.WorkflowClient;
import io.temporal.client.WorkflowClientOptions;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.serviceclient.WorkflowServiceStubs;
import io.temporal.serviceclient.WorkflowServiceStubsOptions;
import io.temporal.worker.Worker;
import io.temporal.worker.WorkerFactory;
import java.io.IOException;
public class ApiKeyWorker {
static final String TASK_QUEUE = "MyTaskQueue";
public static void main(String[] args) throws Exception {
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
// For temporal cloud this would be ${cloud-region}.{cloud}.api.temporal.io:7233
// Example us-east-1.aws.api.temporal.io:7233
String targetEndpoint = System.getenv("TEMPORAL_ENDPOINT");
// Your registered namespace.
String namespace = System.getenv("TEMPORAL_NAMESPACE");
// Your API Key
String apiKey = System.getenv("TEMPORAL_API_KEY");
if (targetEndpoint == null || namespace == null || apiKey == null) {
throw new IllegalArgumentException(
"TEMPORAL_ENDPOINT, TEMPORAL_NAMESPACE, and TEMPORAL_API_KEY environment variables must be set");
}
// Create API Key enabled client with environment config as base
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(
WorkflowServiceStubsOptions.newBuilder(profile.toWorkflowServiceStubsOptions())
.setTarget(targetEndpoint)
.setEnableHttps(true)
.addApiKey(() -> apiKey)
.build());
// Now setup and start workflow worker
WorkflowClient client =
WorkflowClient.newInstance(
service,
WorkflowClientOptions.newBuilder(profile.toWorkflowClientOptions())
.setNamespace(namespace)
.build());
// worker factory that can be used to create workers for specific task queues
WorkerFactory factory = WorkerFactory.newInstance(client);
/*
* Define the workflow worker. Workflow workers listen to a defined task queue and process
* workflows and activities.
*/
Worker worker = factory.newWorker(TASK_QUEUE);
/*
* Register our workflow implementation with the worker.
* Workflow implementations must be known to the worker at runtime in
* order to dispatch workflow tasks.
*/
worker.registerWorkflowImplementationTypes(MyWorkflowImpl.class);
/*
* Start all the workers registered for a specific task queue.
* The started workers then start polling for workflows and activities.
*/
factory.start();
System.out.println("Worker started. Press Ctrl+C to exit.");
// Keep the worker running
Thread.currentThread().join();
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/apikey/MyWorkflow.java
================================================
package io.temporal.samples.apikey;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
@WorkflowInterface
public interface MyWorkflow {
@WorkflowMethod
String execute();
}
================================================
FILE: core/src/main/java/io/temporal/samples/apikey/MyWorkflowImpl.java
================================================
package io.temporal.samples.apikey;
public class MyWorkflowImpl implements MyWorkflow {
@Override
public String execute() {
return "done";
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/apikey/README.md
================================================
# Workflow execution with API Key
This example shows how to secure your Temporal application with API Key authentication.
This is required to connect with Temporal Cloud or any production Temporal deployment that uses API Key authentication.
## Prerequisites
1. A Temporal Cloud account
2. A namespace in Temporal Cloud
3. An API Key for your namespace
## Getting your API Key
1. Log in to your Temporal Cloud account
2. Navigate to your namespace
3. Go to Namespace Settings > API Keys
4. Click "Create API Key"
5. Give your API Key a name and select the appropriate permissions
6. Copy the API Key value (you won't be able to see it again)
## Export env variables
Before running the example you need to export the following env variables:
```bash
# Your Temporal Cloud endpoint (e.g., us-east-1.aws.api.temporal.io:7233)
export TEMPORAL_ENDPOINT="us-east-1.aws.api.temporal.io:7233"
# Your Temporal Cloud namespace
export TEMPORAL_NAMESPACE="your-namespace"
# Your API Key from Temporal Cloud
export TEMPORAL_API_KEY="your-api-key"
```
## Running this sample
This sample consists of two components that need to be run in separate terminals:
1. First, start the worker:
```bash
./gradlew -q execute -PmainClass=io.temporal.samples.apikey.ApiKeyWorker
```
2. Then, in a new terminal, run the starter:
```bash
./gradlew -q execute -PmainClass=io.temporal.samples.apikey.Starter
```
## Expected result
When running the worker, you should see:
```text
[main] INFO i.t.s.WorkflowServiceStubsImpl - Created WorkflowServiceStubs for channel: ManagedChannelOrphanWrapper{delegate=ManagedChannelImpl{logId=1, target=us-east-1.aws.api.temporal.io:7233}}
[main] INFO io.temporal.internal.worker.Poller - start: Poller{name=Workflow Poller taskQueue="MyTaskQueue", namespace="your-namespace"}
Worker started. Press Ctrl+C to exit.
```
When running the starter, you should see:
```text
[main] INFO i.t.s.WorkflowServiceStubsImpl - Created WorkflowServiceStubs for channel: ManagedChannelOrphanWrapper{delegate=ManagedChannelImpl{logId=1, target=us-east-1.aws.api.temporal.io:7233}}
[main] INFO io.temporal.internal.worker.Poller - start: Poller{name=Workflow Poller taskQueue="MyTaskQueue", namespace="your-namespace"}
done
```
## Troubleshooting
If you encounter any issues:
1. Verify your environment variables are set correctly:
```bash
echo $TEMPORAL_ENDPOINT
echo $TEMPORAL_NAMESPACE
echo $TEMPORAL_API_KEY
```
2. Check that your API Key has the correct permissions for your namespace
3. Ensure your namespace is active and accessible
4. If you get connection errors, verify your endpoint is correct and accessible from your network
5. Make sure you're running the commands from the correct directory (where the `gradlew` script is located)
================================================
FILE: core/src/main/java/io/temporal/samples/apikey/Starter.java
================================================
package io.temporal.samples.apikey;
import io.temporal.client.WorkflowClient;
import io.temporal.client.WorkflowClientOptions;
import io.temporal.client.WorkflowOptions;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.serviceclient.WorkflowServiceStubs;
import io.temporal.serviceclient.WorkflowServiceStubsOptions;
import io.temporal.worker.Worker;
import io.temporal.worker.WorkerFactory;
import java.io.IOException;
public class Starter {
static final String TASK_QUEUE = "MyTaskQueue";
static final String WORKFLOW_ID = "HelloAPIKeyWorkflow";
public static void main(String[] args) throws Exception {
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
// For temporal cloud this would be ${cloud-region}.{cloud}.api.temporal.io:7233
// Example us-east-1.aws.api.temporal.io:7233
String targetEndpoint = System.getenv("TEMPORAL_ENDPOINT");
// Your registered namespace.
String namespace = System.getenv("TEMPORAL_NAMESPACE");
// Your API Key
String apiKey = System.getenv("TEMPORAL_API_KEY");
if (targetEndpoint == null || namespace == null || apiKey == null) {
throw new IllegalArgumentException(
"TEMPORAL_ENDPOINT, TEMPORAL_NAMESPACE, and TEMPORAL_API_KEY environment variables must be set");
}
// Create API Key enabled client with environment config as base
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(
WorkflowServiceStubsOptions.newBuilder(profile.toWorkflowServiceStubsOptions())
.setTarget(targetEndpoint)
.setEnableHttps(true)
.addApiKey(() -> apiKey)
.build());
WorkflowClient client =
WorkflowClient.newInstance(
service,
WorkflowClientOptions.newBuilder(profile.toWorkflowClientOptions())
.setNamespace(namespace)
.build());
WorkerFactory factory = WorkerFactory.newInstance(client);
Worker worker = factory.newWorker(TASK_QUEUE);
worker.registerWorkflowImplementationTypes(MyWorkflowImpl.class);
factory.start();
// Create the workflow client stub. It is used to start our workflow execution.
MyWorkflow workflow =
client.newWorkflowStub(
MyWorkflow.class,
WorkflowOptions.newBuilder()
.setWorkflowId(WORKFLOW_ID)
.setTaskQueue(TASK_QUEUE)
.build());
String greeting = workflow.execute();
// Display workflow execution results
System.out.println(greeting);
System.exit(0);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/asyncchild/ChildWorkflow.java
================================================
package io.temporal.samples.asyncchild;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
@WorkflowInterface
public interface ChildWorkflow {
@WorkflowMethod
String executeChild();
}
================================================
FILE: core/src/main/java/io/temporal/samples/asyncchild/ChildWorkflowImpl.java
================================================
package io.temporal.samples.asyncchild;
import io.temporal.workflow.Workflow;
import java.time.Duration;
public class ChildWorkflowImpl implements ChildWorkflow {
@Override
public String executeChild() {
Workflow.sleep(Duration.ofSeconds(3));
return "Child workflow done";
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/asyncchild/ParentWorkflow.java
================================================
package io.temporal.samples.asyncchild;
import io.temporal.api.common.v1.WorkflowExecution;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
@WorkflowInterface
public interface ParentWorkflow {
@WorkflowMethod
WorkflowExecution executeParent();
}
================================================
FILE: core/src/main/java/io/temporal/samples/asyncchild/ParentWorkflowImpl.java
================================================
package io.temporal.samples.asyncchild;
import io.temporal.api.common.v1.WorkflowExecution;
import io.temporal.api.enums.v1.ParentClosePolicy;
import io.temporal.workflow.Async;
import io.temporal.workflow.ChildWorkflowOptions;
import io.temporal.workflow.Promise;
import io.temporal.workflow.Workflow;
public class ParentWorkflowImpl implements ParentWorkflow {
@Override
public WorkflowExecution executeParent() {
// We set the parentClosePolicy to "Abandon"
// This will allow child workflow to continue execution after parent completes
ChildWorkflowOptions childWorkflowOptions =
ChildWorkflowOptions.newBuilder()
.setWorkflowId("childWorkflow")
.setParentClosePolicy(ParentClosePolicy.PARENT_CLOSE_POLICY_ABANDON)
.build();
// Get the child workflow stub
ChildWorkflow child = Workflow.newChildWorkflowStub(ChildWorkflow.class, childWorkflowOptions);
// Start the child workflow async
Async.function(child::executeChild);
// Get the child workflow execution promise
Promise<WorkflowExecution> childExecution = Workflow.getWorkflowExecution(child);
// Call .get on the promise. This will block until the child workflow starts execution (or start
// fails)
return childExecution.get();
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/asyncchild/README.md
================================================
# Async Child Workflow execution
The sample demonstrates shows how to invoke a Child Workflow asynchronously.
The Child Workflow is allowed to complete its execution even after the Parent Workflow completes.
```bash
./gradlew -q execute -PmainClass=io.temporal.samples.asyncchild.Starter
```
================================================
FILE: core/src/main/java/io/temporal/samples/asyncchild/Starter.java
================================================
package io.temporal.samples.asyncchild;
import io.temporal.api.common.v1.WorkflowExecution;
import io.temporal.api.workflow.v1.WorkflowExecutionInfo;
import io.temporal.api.workflowservice.v1.DescribeWorkflowExecutionRequest;
import io.temporal.api.workflowservice.v1.DescribeWorkflowExecutionResponse;
import io.temporal.client.WorkflowClient;
import io.temporal.client.WorkflowOptions;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.serviceclient.WorkflowServiceStubs;
import io.temporal.worker.Worker;
import io.temporal.worker.WorkerFactory;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
public class Starter {
public static final String TASK_QUEUE = "asyncChildTaskQueue";
public static void main(String[] args) {
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(profile.toWorkflowServiceStubsOptions());
WorkflowClient client = WorkflowClient.newInstance(service, profile.toWorkflowClientOptions());
WorkerFactory factory = WorkerFactory.newInstance(client);
createWorker(factory);
WorkflowOptions parentWorkflowOptions =
WorkflowOptions.newBuilder()
.setWorkflowId("parentWorkflow")
.setTaskQueue(TASK_QUEUE)
.build();
ParentWorkflow parentWorkflowStub =
client.newWorkflowStub(ParentWorkflow.class, parentWorkflowOptions);
// Start parent workflow and wait for it to complete
WorkflowExecution childWorkflowExecution = parentWorkflowStub.executeParent();
// Get the child workflow execution status (after parent completed)
System.out.println(
"Child execution status: " + getStatusAsString(childWorkflowExecution, client, service));
// Wait for child workflow to complete
sleep(4);
// Check the status of the child workflow again
System.out.println(
"Child execution status: " + getStatusAsString(childWorkflowExecution, client, service));
System.exit(0);
}
private static void createWorker(WorkerFactory factory) {
Worker worker = factory.newWorker(TASK_QUEUE);
worker.registerWorkflowImplementationTypes(ParentWorkflowImpl.class, ChildWorkflowImpl.class);
factory.start();
}
private static String getStatusAsString(
WorkflowExecution execution, WorkflowClient client, WorkflowServiceStubs service) {
DescribeWorkflowExecutionRequest describeWorkflowExecutionRequest =
DescribeWorkflowExecutionRequest.newBuilder()
.setNamespace(client.getOptions().getNamespace())
.setExecution(execution)
.build();
DescribeWorkflowExecutionResponse resp =
service.blockingStub().describeWorkflowExecution(describeWorkflowExecutionRequest);
WorkflowExecutionInfo workflowExecutionInfo = resp.getWorkflowExecutionInfo();
return workflowExecutionInfo.getStatus().toString();
}
private static void sleep(int seconds) {
try {
Thread.sleep(TimeUnit.SECONDS.toMillis(seconds));
} catch (Exception e) {
System.out.println("Exception: " + e.getMessage());
System.exit(0);
}
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/asyncuntypedchild/ChildWorkflow.java
================================================
package io.temporal.samples.asyncuntypedchild;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
/**
* Define the child workflow Interface. It must contain one method annotated with @WorkflowMethod
*
* @see WorkflowInterface
* @see WorkflowMethod
*/
@WorkflowInterface
public interface ChildWorkflow {
/**
* Define the child workflow method. This method is executed when the workflow is started. The
* workflow completes when the workflow method finishes execution.
*/
@WorkflowMethod
String composeGreeting(String greeting, String name);
}
================================================
FILE: core/src/main/java/io/temporal/samples/asyncuntypedchild/ChildWorkflowImpl.java
================================================
package io.temporal.samples.asyncuntypedchild;
import io.temporal.workflow.Workflow;
/**
* Define the parent workflow implementation. It implements the getGreeting workflow method
*
* <p>Note that a workflow implementation must always be public for the Temporal library to be able
* to create its instances.
*/
public class ChildWorkflowImpl implements ChildWorkflow {
@Override
public String composeGreeting(String greeting, String name) {
// Sleep for 2 seconds to ensure the child completes after the parent.
Workflow.sleep(2000);
return greeting + " " + name + "!";
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/asyncuntypedchild/ParentWorkflow.java
================================================
package io.temporal.samples.asyncuntypedchild;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
/**
* Define the parent workflow interface. It must contain one method annotated with @WorkflowMethod
*
* @see WorkflowInterface
* @see WorkflowMethod
*/
@WorkflowInterface
public interface ParentWorkflow {
/**
* Define the parent workflow method. This method is executed when the workflow is started. The
* workflow completes when the workflow method finishes execution.
*/
@WorkflowMethod
String getGreeting(String name);
}
================================================
FILE: core/src/main/java/io/temporal/samples/asyncuntypedchild/ParentWorkflowImpl.java
================================================
package io.temporal.samples.asyncuntypedchild;
import static io.temporal.samples.asyncuntypedchild.Starter.WORKFLOW_ID;
import io.temporal.api.common.v1.WorkflowExecution;
import io.temporal.api.enums.v1.ParentClosePolicy;
import io.temporal.workflow.*;
// Define the parent workflow implementation. It implements the getGreeting workflow method
public class ParentWorkflowImpl implements ParentWorkflow {
@Override
public String getGreeting(String name) {
/*
* Define the child workflow stub. Since workflows are stateful,
* a new stub must be created for each child workflow.
*/
ChildWorkflowStub child =
Workflow.newUntypedChildWorkflowStub(
ChildWorkflow.class.getSimpleName(),
ChildWorkflowOptions.newBuilder()
.setParentClosePolicy(ParentClosePolicy.PARENT_CLOSE_POLICY_ABANDON)
.setWorkflowId("Child_of_" + WORKFLOW_ID)
.build());
/*
* Invoke the child workflows composeGreeting workflow method async.
* This call is non-blocking and returns immediately returning a {@link io.temporal.workflow.Promise},
* you can invoke `get()` on the returned promise to wait for the child workflow result.
*/
child.executeAsync(String.class, "Hello", name);
// Wait for the child workflow to start before returning the result
Promise<WorkflowExecution> childExecution = child.getExecution();
WorkflowExecution childWorkflowExecution = childExecution.get();
// return the child workflowId
return childWorkflowExecution.getWorkflowId();
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/asyncuntypedchild/README.md
================================================
# Async Child Workflow execution
The sample demonstrates shows how to invoke an Untyped Child Workflow asynchronously.
The Child Workflow continues running for some time after the Parent Workflow completes.
```bash
./gradlew -q execute -PmainClass=io.temporal.samples.asyncuntypedchild.Starter
```
================================================
FILE: core/src/main/java/io/temporal/samples/asyncuntypedchild/Starter.java
================================================
package io.temporal.samples.asyncuntypedchild;
import io.temporal.client.WorkflowClient;
import io.temporal.client.WorkflowOptions;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.serviceclient.WorkflowServiceStubs;
import io.temporal.worker.Worker;
import io.temporal.worker.WorkerFactory;
import java.io.IOException;
/**
* Sample Temporal Workflow Definition that demonstrates the execution of a Child Workflow. Child
* workflows allow you to group your Workflow logic into small logical and reusable units that solve
* a particular problem. They can be typically reused by multiple other Workflows.
*/
public class Starter {
static final String WORKFLOW_ID = "ParentWithAsyncUntypedChild";
static final String TASK_QUEUE = WORKFLOW_ID + "Queue";
/**
* With the workflow, and child workflow defined, we can now start execution. The main method is
* the workflow starter.
*/
public static void main(String[] args) {
// Get a Workflow service stub.
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(profile.toWorkflowServiceStubsOptions());
/*
* Get a Workflow service client which can be used to start, Signal, and Query Workflow Executions.
*/
WorkflowClient client = WorkflowClient.newInstance(service, profile.toWorkflowClientOptions());
/*
* Define the workflow factory. It is used to create workflow workers for a specific task queue.
*/
WorkerFactory factory = WorkerFactory.newInstance(client);
/*
* Define the workflow worker. Workflow workers listen to a defined task queue and process
* workflows and activities.
*/
Worker worker = factory.newWorker(TASK_QUEUE);
/*
* Register the parent and child workflow implementation with the worker.
* Since workflows are stateful in nature,
* we need to register the workflow types.
*/
worker.registerWorkflowImplementationTypes(ParentWorkflowImpl.class, ChildWorkflowImpl.class);
/*
* Start all the workers registered for a specific task queue.
* The started workers then start polling for workflows and activities.
*/
factory.start();
// Start a workflow execution. Usually this is done from another program.
// Uses task queue from the GreetingWorkflow @WorkflowMethod annotation.
// Create our parent workflow client stub. It is used to start the parent workflow execution.
ParentWorkflow workflow =
client.newWorkflowStub(
ParentWorkflow.class,
WorkflowOptions.newBuilder()
.setWorkflowId(WORKFLOW_ID)
.setTaskQueue(TASK_QUEUE)
.build());
// Execute our parent workflow and wait for it to complete, it returns the child workflow id.
String childWorkflowId = workflow.getGreeting("World");
System.out.println("Child WorkflowId=[" + childWorkflowId + "] started in abandon mode");
String childResult = client.newUntypedWorkflowStub(childWorkflowId).getResult(String.class);
System.out.println("Result from child workflow = " + childResult);
System.exit(0);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/autoheartbeat/AutoHeartbeatUtil.java
================================================
/*
* Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved
*
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Modifications copyright (C) 2017 Uber Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. A copy of the License is
* located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package io.temporal.samples.autoheartbeat;
import io.temporal.activity.ActivityExecutionContext;
import java.time.Instant;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
public class AutoHeartbeatUtil {
private final long period;
private final long initialDelay;
private final TimeUnit periodTimeUnit;
private final ScheduledExecutorService timerService =
Executors.newSingleThreadScheduledExecutor();
private final ActivityExecutionContext context;
private final Object details;
private String heartbeaterId;
public AutoHeartbeatUtil(
long period,
long initialDelay,
TimeUnit periodTimeUnit,
ActivityExecutionContext context,
Object details) {
this.period = period;
this.initialDelay = initialDelay;
this.periodTimeUnit = periodTimeUnit;
this.context = context;
this.details = details;
// Set to activity id better, for sample we just use type
heartbeaterId = context.getInfo().getActivityType();
}
public ScheduledFuture<?> start() {
System.out.println("Autoheartbeater[" + heartbeaterId + "] starting...");
return timerService.scheduleAtFixedRate(
() -> {
// try {
System.out.println(
"Autoheartbeater["
+ heartbeaterId
+ "]"
+ "heartbeating at: "
+ printShortCurrentTime());
context.heartbeat(details);
},
initialDelay,
period,
periodTimeUnit);
}
public void stop() {
System.out.println("Autoheartbeater[" + heartbeaterId + "] being requested to stop.");
// Try not to execute another heartbeat that could have been queued up
// Note this can at times take a second or two so make sure to test this out on your workers
// So can set best heartbeat timeout (sometimes might need larger value to accomodate)
timerService.shutdownNow();
}
private String printShortCurrentTime() {
return DateTimeFormatter.ofPattern("HH:mm:ss")
.withZone(ZoneId.systemDefault())
.format(Instant.now());
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/autoheartbeat/README.md
================================================
# Auto-heartbeating sample for activities that define HeartbeatTimeout
This sample shows an implementation of an "auto-heartbeating" utility that can be applied via interceptor to all
activities where you define HeartbeatTimeout. Use case where this can be helpful include situations where you have
long-running activities where you want to heartbeat but its difficult to explicitly call heartbeat api in activity code
directly.
Another useful scenario for this is where you have activity that at times can complete in very short amount of time,
but then at times can take for example minutes. In this case you have to set longer StartToClose timeout
but you might not want first heartbeat to be sent right away but send it after the "shorter" duration of activity
execution.
Warning: make sure to test this sample for your use case. This includes load testing. This sample was not
tested on large scale workloads. In addition note that it is recommended to heartbeat from activity code itself. Using
this type of autoheartbeating utility does have disatvantage that activity code itself can continue running after
a handled activity cancelation. Please be aware of these warnings when applying this sample.
1. Start the Sample:
```bash
./gradlew -q execute -PmainClass=io.temporal.samples.autoheartbeat.Starter
```
================================================
FILE: core/src/main/java/io/temporal/samples/autoheartbeat/Starter.java
================================================
/*
* Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved
*
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Modifications copyright (C) 2017 Uber Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. A copy of the License is
* located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package io.temporal.samples.autoheartbeat;
import io.temporal.client.WorkflowClient;
import io.temporal.client.WorkflowOptions;
import io.temporal.client.WorkflowStub;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.failure.CanceledFailure;
import io.temporal.samples.autoheartbeat.activities.AutoActivitiesImpl;
import io.temporal.samples.autoheartbeat.interceptor.AutoHeartbeatWorkerInterceptor;
import io.temporal.samples.autoheartbeat.workflows.AutoWorkflow;
import io.temporal.samples.autoheartbeat.workflows.AutoWorkflowImpl;
import io.temporal.serviceclient.WorkflowServiceStubs;
import io.temporal.worker.Worker;
import io.temporal.worker.WorkerFactory;
import io.temporal.worker.WorkerFactoryOptions;
import java.io.IOException;
public class Starter {
static final String TASK_QUEUE = "AutoheartbeatTaskQueue";
static final String WORKFLOW_ID = "AutoHeartbeatWorkflow";
public static void main(String[] args) {
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(profile.toWorkflowServiceStubsOptions());
WorkflowClient client = WorkflowClient.newInstance(service, profile.toWorkflowClientOptions());
// Configure our auto heartbeat workflow interceptor which will apply
// AutoHeartbeaterUtil to each activity workflow schedules which has a heartbeat
// timeout configured
WorkerFactoryOptions wfo =
WorkerFactoryOptions.newBuilder()
.setWorkerInterceptors(new AutoHeartbeatWorkerInterceptor())
.build();
WorkerFactory factory = WorkerFactory.newInstance(client, wfo);
Worker worker = factory.newWorker(TASK_QUEUE);
worker.registerWorkflowImplementationTypes(AutoWorkflowImpl.class);
worker.registerActivitiesImplementations(new AutoActivitiesImpl());
factory.start();
// first run completes execution with autoheartbeat utils
firstRun(client);
// second run cancels running (pending) activity via signal (specific scope cancel)
secondRun(client);
// third run cancels running execution which cancels activity as well
thirdRun(client);
// fourth run turns off autoheartbeat for activities and lets activity time out on heartbeat
// timeout
fourthRun(client);
System.exit(0);
}
@SuppressWarnings("unused")
private static void firstRun(WorkflowClient client) {
System.out.println("**** First Run: run workflow to completion");
AutoWorkflow firstRun =
client.newWorkflowStub(
AutoWorkflow.class,
WorkflowOptions.newBuilder()
.setWorkflowId(WORKFLOW_ID)
.setTaskQueue(TASK_QUEUE)
.build());
try {
String firstRunResult = firstRun.exec("Auto heartbeating is cool");
System.out.println("First run result: " + firstRunResult);
} catch (Exception e) {
System.out.println("First run - Workflow exec exception: " + e.getClass().getName());
}
}
@SuppressWarnings("unused")
private static void secondRun(WorkflowClient client) {
System.out.println("\n\n**** Second Run: cancel activities via signal");
AutoWorkflow secondRun =
client.newWorkflowStub(
AutoWorkflow.class,
WorkflowOptions.newBuilder()
.setWorkflowId(WORKFLOW_ID)
.setTaskQueue(TASK_QUEUE)
.build());
WorkflowClient.start(secondRun::exec, "Auto heartbeating is cool");
doSleeps(4);
secondRun.cancelActivity();
try {
String secondRunResult = WorkflowStub.fromTyped(secondRun).getResult(String.class);
System.out.println("Second run result: " + secondRunResult);
} catch (Exception e) {
System.out.println("Second run - Workflow exec exception: " + e.getClass().getName());
}
}
@SuppressWarnings("unused")
private static void thirdRun(WorkflowClient client) {
System.out.println("\n\n**** Third Run: cancel workflow execution");
AutoWorkflow thirdRun =
client.newWorkflowStub(
AutoWorkflow.class,
WorkflowOptions.newBuilder()
.setWorkflowId(WORKFLOW_ID)
.setTaskQueue(TASK_QUEUE)
.build());
WorkflowClient.start(thirdRun::exec, "Auto heartbeating is cool");
doSleeps(10);
try {
WorkflowStub.fromTyped(thirdRun).cancel();
String thirdRunResult = WorkflowStub.fromTyped(thirdRun).getResult(String.class);
System.out.println("Third run result: " + thirdRunResult);
} catch (Exception e) {
// we are expecting workflow cancelation
if (e.getCause() instanceof CanceledFailure) {
System.out.println("Third run - Workflow execution canceled.");
} else {
System.out.println("Third run - Workflow exec exception: " + e.getMessage());
}
}
}
@SuppressWarnings("unused")
private static void fourthRun(WorkflowClient client) {
System.out.println("\n\n**** Fourth Run: cause heartbeat timeout");
// we disable autoheartbeat via env var
System.setProperty("sample.disableAutoHeartbeat", "true");
AutoWorkflow fourth =
client.newWorkflowStub(
AutoWorkflow.class,
WorkflowOptions.newBuilder()
.setWorkflowId(WORKFLOW_ID)
.setTaskQueue(TASK_QUEUE)
.build());
try {
String fourthRunResult = fourth.exec("Auto heartbeating is cool");
System.out.println("Fourth run result: " + fourthRunResult);
} catch (Exception e) {
System.out.println("Fourth run - Workflow exec exception: " + e.getClass().getName());
}
}
private static void doSleeps(int seconds) {
try {
Thread.sleep(seconds * 1000L);
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/autoheartbeat/activities/AutoActivities.java
================================================
/*
* Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved
*
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Modifications copyright (C) 2017 Uber Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. A copy of the License is
* located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package io.temporal.samples.autoheartbeat.activities;
import io.temporal.activity.ActivityInterface;
@ActivityInterface
public interface AutoActivities {
String runActivityOne(String input);
String runActivityTwo(String input);
}
================================================
FILE: core/src/main/java/io/temporal/samples/autoheartbeat/activities/AutoActivitiesImpl.java
================================================
/*
* Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved
*
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Modifications copyright (C) 2017 Uber Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. A copy of the License is
* located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package io.temporal.samples.autoheartbeat.activities;
import java.util.concurrent.TimeUnit;
public class AutoActivitiesImpl implements AutoActivities {
@Override
public String runActivityOne(String input) {
return runActivity("runActivityOne - " + input, 10);
}
@Override
public String runActivityTwo(String input) {
return runActivity("runActivityTwo - " + input, 5);
}
@SuppressWarnings("FutureReturnValueIgnored")
private String runActivity(String input, int seconds) {
for (int i = 0; i < seconds; i++) {
sleep(1);
}
return "Activity completed: " + input;
}
private void sleep(int seconds) {
try {
Thread.sleep(TimeUnit.SECONDS.toMillis(seconds));
} catch (InterruptedException ee) {
// Empty
}
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/autoheartbeat/interceptor/AutoHeartbeatActivityInboundCallsInterceptor.java
================================================
/*
* Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved
*
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Modifications copyright (C) 2017 Uber Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. A copy of the License is
* located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package io.temporal.samples.autoheartbeat.interceptor;
import io.temporal.activity.Activity;
import io.temporal.activity.ActivityExecutionContext;
import io.temporal.client.ActivityCanceledException;
import io.temporal.common.interceptors.ActivityInboundCallsInterceptor;
import io.temporal.common.interceptors.ActivityInboundCallsInterceptorBase;
import io.temporal.samples.autoheartbeat.AutoHeartbeatUtil;
import java.time.Duration;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
public class AutoHeartbeatActivityInboundCallsInterceptor
extends ActivityInboundCallsInterceptorBase {
private ActivityExecutionContext activityExecutionContext;
private Duration activityHeartbeatTimeout;
private AutoHeartbeatUtil autoHeartbeater;
private ScheduledFuture scheduledFuture;
public AutoHeartbeatActivityInboundCallsInterceptor(ActivityInboundCallsInterceptor next) {
super(next);
}
@Override
public void init(ActivityExecutionContext context) {
this.activityExecutionContext = context;
activityHeartbeatTimeout = activityExecutionContext.getInfo().getHeartbeatTimeout();
super.init(context);
}
@Override
@SuppressWarnings({"FutureReturnValueIgnored", "CatchAndPrintStackTrace"})
public ActivityOutput execute(ActivityInput input) {
// If activity has heartbeat timeout defined we want to apply auto-heartbeter
// Unless we explicitly disabled autoheartbeating via system property
if (activityHeartbeatTimeout != null
&& activityHeartbeatTimeout.getSeconds() > 0
&& !Boolean.parseBoolean(System.getProperty("sample.disableAutoHeartbeat"))) {
System.out.println(
"Auto heartbeating applied for activity: "
+ activityExecutionContext.getInfo().getActivityType());
autoHeartbeater =
new AutoHeartbeatUtil(2, 0, TimeUnit.SECONDS, activityExecutionContext, input);
scheduledFuture = autoHeartbeater.start();
} else {
System.out.println(
"Auto heartbeating not being applied for activity: "
+ activityExecutionContext.getInfo().getActivityType());
}
if (scheduledFuture != null) {
CompletableFuture activityExecFuture =
CompletableFuture.supplyAsync(() -> super.execute(input));
CompletableFuture autoHeartbeatFuture =
CompletableFuture.supplyAsync(
() -> {
try {
return scheduledFuture.get();
} catch (Exception e) {
throw new ActivityCanceledException(activityExecutionContext.getInfo());
}
});
try {
return (ActivityOutput)
CompletableFuture.anyOf(autoHeartbeatFuture, activityExecFuture).get();
} catch (Exception e) {
if (e instanceof ExecutionException) {
ExecutionException ee = (ExecutionException) e;
if (ee.getCause() instanceof ActivityCanceledException) {
throw new ActivityCanceledException(activityExecutionContext.getInfo());
}
}
throw Activity.wrap(e);
} finally {
if (autoHeartbeater != null) {
autoHeartbeater.stop();
}
}
} else {
return super.execute(input);
}
}
public interface AutoHeartbeaterCancellationCallback {
void handle(Exception e);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/autoheartbeat/interceptor/AutoHeartbeatWorkerInterceptor.java
================================================
/*
* Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved
*
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Modifications copyright (C) 2017 Uber Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. A copy of the License is
* located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package io.temporal.samples.autoheartbeat.interceptor;
import io.temporal.common.interceptors.ActivityInboundCallsInterceptor;
import io.temporal.common.interceptors.WorkerInterceptorBase;
public class AutoHeartbeatWorkerInterceptor extends WorkerInterceptorBase {
@Override
public ActivityInboundCallsInterceptor interceptActivity(ActivityInboundCallsInterceptor next) {
return new AutoHeartbeatActivityInboundCallsInterceptor(next);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/autoheartbeat/workflows/AutoWorkflow.java
================================================
/*
* Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved
*
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Modifications copyright (C) 2017 Uber Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. A copy of the License is
* located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package io.temporal.samples.autoheartbeat.workflows;
import io.temporal.workflow.SignalMethod;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
@WorkflowInterface
public interface AutoWorkflow {
@WorkflowMethod
String exec(String input);
@SignalMethod
void cancelActivity();
}
================================================
FILE: core/src/main/java/io/temporal/samples/autoheartbeat/workflows/AutoWorkflowImpl.java
================================================
/*
* Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved
*
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Modifications copyright (C) 2017 Uber Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. A copy of the License is
* located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package io.temporal.samples.autoheartbeat.workflows;
import io.temporal.activity.ActivityCancellationType;
import io.temporal.activity.ActivityOptions;
import io.temporal.common.RetryOptions;
import io.temporal.failure.ActivityFailure;
import io.temporal.failure.CanceledFailure;
import io.temporal.failure.TimeoutFailure;
import io.temporal.samples.autoheartbeat.activities.AutoActivities;
import io.temporal.workflow.CancellationScope;
import io.temporal.workflow.Workflow;
import java.time.Duration;
public class AutoWorkflowImpl implements AutoWorkflow {
private CancellationScope scope;
@Override
public String exec(String input) {
AutoActivities activitiesOne =
Workflow.newActivityStub(
AutoActivities.class,
ActivityOptions.newBuilder()
.setStartToCloseTimeout(Duration.ofSeconds(22))
.setHeartbeatTimeout(Duration.ofSeconds(8))
.setCancellationType(ActivityCancellationType.WAIT_CANCELLATION_COMPLETED)
// for sample purposes
.setRetryOptions(RetryOptions.newBuilder().setMaximumAttempts(3).build())
.build());
AutoActivities activitiesTwo =
Workflow.newActivityStub(
AutoActivities.class,
ActivityOptions.newBuilder()
.setStartToCloseTimeout(Duration.ofSeconds(20))
.setHeartbeatTimeout(Duration.ofSeconds(7))
.setCancellationType(ActivityCancellationType.WAIT_CANCELLATION_COMPLETED)
// for sample purposes
.setRetryOptions(RetryOptions.newBuilder().setMaximumAttempts(3).build())
.build());
// Start our activity in CancellationScope so we can cancel it if needed
scope =
Workflow.newCancellationScope(
() -> {
activitiesOne.runActivityOne(input);
activitiesTwo.runActivityTwo(input);
});
try {
scope.run();
} catch (ActivityFailure e) {
if (e.getCause() instanceof CanceledFailure) {
// We dont want workflow to fail in we canceled our scope, just log and return
return "Workflow result after activity cancellation";
} else if (e.getCause() instanceof TimeoutFailure) {
return "Workflow result after activity timeout of type: "
+ ((TimeoutFailure) e.getCause()).getTimeoutType().name();
} else {
throw e;
}
}
return "completed";
}
@Override
public void cancelActivity() {
scope.cancel("Canceling scope from signal handler");
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/HeartbeatingActivityBatchStarter.java
================================================
package io.temporal.samples.batch.heartbeatingactivity;
import static io.temporal.samples.batch.heartbeatingactivity.HeartbeatingActivityBatchWorker.TASK_QUEUE;
import io.temporal.api.common.v1.WorkflowExecution;
import io.temporal.client.WorkflowClient;
import io.temporal.client.WorkflowOptions;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.serviceclient.WorkflowServiceStubs;
import java.io.IOException;
/** Starts a single execution of HeartbeatingActivityBatchWorkflow. */
public class HeartbeatingActivityBatchStarter {
public static void main(String[] args) {
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(profile.toWorkflowServiceStubsOptions());
WorkflowClient workflowClient =
WorkflowClient.newInstance(service, profile.toWorkflowClientOptions());
WorkflowOptions options = WorkflowOptions.newBuilder().setTaskQueue(TASK_QUEUE).build();
HeartbeatingActivityBatchWorkflow batchWorkflow =
workflowClient.newWorkflowStub(HeartbeatingActivityBatchWorkflow.class, options);
WorkflowExecution execution = WorkflowClient.start(batchWorkflow::processBatch);
System.out.println(
"Started batch workflow. WorkflowId="
+ execution.getWorkflowId()
+ ", RunId="
+ execution.getRunId());
System.exit(0);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/HeartbeatingActivityBatchWorker.java
================================================
package io.temporal.samples.batch.heartbeatingactivity;
import io.temporal.client.WorkflowClient;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.serviceclient.WorkflowServiceStubs;
import io.temporal.worker.Worker;
import io.temporal.worker.WorkerFactory;
import java.io.IOException;
/**
* A worker process that hosts implementations of HeartbeatingActivityBatchWorkflow and
* RecordProcessorActivity.
*/
public final class HeartbeatingActivityBatchWorker {
static final String TASK_QUEUE = "HeartbeatingActivityBatch";
public static void main(String[] args) {
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(profile.toWorkflowServiceStubsOptions());
WorkflowClient client = WorkflowClient.newInstance(service, profile.toWorkflowClientOptions());
WorkerFactory factory = WorkerFactory.newInstance(client);
Worker worker = factory.newWorker(TASK_QUEUE);
worker.registerWorkflowImplementationTypes(HeartbeatingActivityBatchWorkflowImpl.class);
worker.registerActivitiesImplementations(
new RecordProcessorActivityImpl(new RecordLoaderImpl(), new RecordProcessorImpl()));
factory.start();
System.out.println("Worker started for task queue: " + TASK_QUEUE);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/HeartbeatingActivityBatchWorkflow.java
================================================
package io.temporal.samples.batch.heartbeatingactivity;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
@WorkflowInterface
public interface HeartbeatingActivityBatchWorkflow {
/**
* Processes the batch of records.
*
* @return total number of processed records.
*/
@WorkflowMethod
int processBatch();
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/HeartbeatingActivityBatchWorkflowImpl.java
================================================
package io.temporal.samples.batch.heartbeatingactivity;
import io.temporal.activity.ActivityOptions;
import io.temporal.workflow.Workflow;
import java.time.Duration;
/**
* A sample implementation of processing a batch by an activity.
*
* <p>An activity can run as long as needed. It reports that it is still alive through heartbeat. If
* the worker is restarted the activity is retried after the heartbeat timeout. Temporal allows
* store data in heartbeat _details_. These details are available to the next activity attempt. The
* progress of the record processing is stored in the details to avoid reprocessing records from the
* beginning on failures.
*/
public final class HeartbeatingActivityBatchWorkflowImpl
implements HeartbeatingActivityBatchWorkflow {
/**
* Activity that is used to process batch records. The start-to-close timeout is set to a high
* value to support large batch sizes. Heartbeat timeout is required to quickly restart the
* activity in case of failures. The heartbeat timeout is also needed to record heartbeat details
* at the service.
*/
private final RecordProcessorActivity recordProcessor =
Workflow.newActivityStub(
RecordProcessorActivity.class,
ActivityOptions.newBuilder()
.setStartToCloseTimeout(Duration.ofHours(1))
.setHeartbeatTimeout(Duration.ofSeconds(10))
.build());
@Override
public int processBatch() {
// No special logic needed here as activity is retried automatically by the service.
return recordProcessor.processRecords();
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/README.md
================================================
A sample implementation of processing a batch by an Activity.
An Activity can run as long as needed.
It reports that it is still alive through Heartbeat.
If the Worker is restarted, the Activity is retried after the Heartbeat Timeout.
Temporal allows store data in Heartbeat _details_.
These details are available to the next Activity attempt.
The progress of the record processing is stored in the details to avoid reprocessing records from the beginning on failures.
#### Running the Iterator Batch Sample
The sample has two executables. Execute each command in a separate terminal window.
The first command runs the Worker that hosts the Workflow and Activity Executions. Restart the worker while the batch is
executing to see how activity timeout and retry work.
```bash
./gradlew -q execute -PmainClass=io.temporal.samples.batch.heartbeatingactivity.HeartbeatingActivityBatchWorker
```
The second command start the Workflow Execution. Each time the command runs, it starts a new Workflow Execution.
```bash
./gradlew -q execute -PmainClass=io.temporal.samples.batch.heartbeatingactivity.HeartbeatingActivityBatchStarter
```
================================================
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordLoader.java
================================================
package io.temporal.samples.batch.heartbeatingactivity;
import java.util.Optional;
/**
* Helper class that is used to iterate over a list of records.
*
* <p>A specific implementation depends on a use case. For example, it can execute an SQL DB query
* or read a comma delimited file. More complex use cases would need passing a different type of
* offset parameter.
*/
public interface RecordLoader {
/**
* Returns the next record.
*
* @param offset offset of the next record.
* @return Record at the offset. Empty optional if offset exceeds the dataset size.
*/
Optional<SingleRecord> getRecord(int offset);
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordLoaderImpl.java
================================================
package io.temporal.samples.batch.heartbeatingactivity;
import java.util.Optional;
/** Fake implementation of RecordLoader. */
public final class RecordLoaderImpl implements RecordLoader {
static final int RECORD_COUNT = 1000;
@Override
public Optional<SingleRecord> getRecord(int offset) {
if (offset >= RECORD_COUNT) {
return Optional.empty();
}
return Optional.of(new SingleRecord(offset));
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordProcessor.java
================================================
package io.temporal.samples.batch.heartbeatingactivity;
/** A helper class that implements record processing. */
public interface RecordProcessor {
/**
* Processes a single record.
*
* @param record record to process
*/
void processRecord(SingleRecord record);
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordProcessorActivity.java
================================================
package io.temporal.samples.batch.heartbeatingactivity;
import io.temporal.activity.ActivityInterface;
@ActivityInterface
public interface RecordProcessorActivity {
/** Processes all records in the dataset */
int processRecords();
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordProcessorActivityImpl.java
================================================
package io.temporal.samples.batch.heartbeatingactivity;
import io.temporal.activity.Activity;
import io.temporal.activity.ActivityExecutionContext;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* RecordProcessorActivity implementation.
*
* <p>It relies on RecordLoader to iterate over set of records and process them one by one. The
* heartbeat is used to remember offset. On activity retry the data from the last recorded heartbeat
* is used to minimize the number of records that are reprocessed. Note that not every heartbeat
* call is sent to the service. The frequency of the heartbeat service calls depends on the
* heartbeat timeout the activity was scheduled with. If no heartbeat timeout is not set then no
* heartbeat is ever sent to the service.
*
* <p>The biggest advantage of this approach is efficiency. It uses very few Temporal resources.
*
* <p>The biggest limitation of this approach is that it cannot deal with record processing
* failures. The only options are either failing the whole batch or skip the record. While it is
* possible to build additional logic to record failed records somewhere the experience is not
* seamless.
*/
public class RecordProcessorActivityImpl implements RecordProcessorActivity {
private static final Logger log = LoggerFactory.getLogger(RecordProcessorActivityImpl.class);
private final RecordLoader recordLoader;
private final RecordProcessor recordProcessor;
public RecordProcessorActivityImpl(RecordLoader recordLoader, RecordProcessor recordProcessor) {
this.recordLoader = recordLoader;
this.recordProcessor = recordProcessor;
}
@Override
public int processRecords() {
// On activity retry load the last reported offset from the heartbeat details.
ActivityExecutionContext context = Activity.getExecutionContext();
Optional<Integer> heartbeatDetails = context.getHeartbeatDetails(Integer.class);
int offset = heartbeatDetails.orElse(0);
log.info("Activity processRecords started with offset=" + offset);
// This sample implementation processes records one by one.
// If needed it can be changed to use a pool of threads or asynchronous code to process multiple
// such records in parallel.
while (true) {
Optional<SingleRecord> record = recordLoader.getRecord(offset);
if (!record.isPresent()) {
return offset;
}
recordProcessor.processRecord(record.get());
// Report that activity is still alive. The assumption is that each record takes less time
// to process than the heartbeat timeout.
// Leverage heartbeat details to record offset.
context.heartbeat(offset);
offset++;
}
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordProcessorImpl.java
================================================
package io.temporal.samples.batch.heartbeatingactivity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** Fake record processor implementation. */
public final class RecordProcessorImpl implements RecordProcessor {
private static final Logger log = LoggerFactory.getLogger(RecordProcessorImpl.class);
@Override
public void processRecord(SingleRecord record) {
// Fake processing logic
try {
Thread.sleep(100);
log.info("Processed " + record);
} catch (InterruptedException ignored) {
return;
}
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/SingleRecord.java
================================================
package io.temporal.samples.batch.heartbeatingactivity;
/** Record to process. A real application would add a use case specific data. */
public class SingleRecord {
private int id;
public SingleRecord(int id) {
this.id = id;
}
/** JSON deserializer needs it */
public SingleRecord() {}
public int getId() {
return id;
}
@Override
public String toString() {
return "Record{" + "id=" + id + '}';
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/iterator/IteratorBatchStarter.java
================================================
package io.temporal.samples.batch.iterator;
import static io.temporal.samples.batch.iterator.IteratorBatchWorker.TASK_QUEUE;
import io.temporal.api.common.v1.WorkflowExecution;
import io.temporal.client.WorkflowClient;
import io.temporal.client.WorkflowOptions;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.serviceclient.WorkflowServiceStubs;
import java.io.IOException;
/** Starts a single execution of IteratorBatchWorkflow. */
public class IteratorBatchStarter {
public static void main(String[] args) {
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(profile.toWorkflowServiceStubsOptions());
WorkflowClient workflowClient =
WorkflowClient.newInstance(service, profile.toWorkflowClientOptions());
WorkflowOptions options = WorkflowOptions.newBuilder().setTaskQueue(TASK_QUEUE).build();
IteratorBatchWorkflow batchWorkflow =
workflowClient.newWorkflowStub(IteratorBatchWorkflow.class, options);
WorkflowExecution execution = WorkflowClient.start(batchWorkflow::processBatch, 5, 0);
System.out.println(
"Started batch workflow. WorkflowId="
+ execution.getWorkflowId()
+ ", RunId="
+ execution.getRunId());
System.exit(0);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/iterator/IteratorBatchWorker.java
================================================
package io.temporal.samples.batch.iterator;
import io.temporal.client.WorkflowClient;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.serviceclient.WorkflowServiceStubs;
import io.temporal.worker.Worker;
import io.temporal.worker.WorkerFactory;
import java.io.IOException;
/**
* A worker process that hosts implementations of IteratorBatchWorkflow and RecordProcessorWorkflow
* as well as RecordLoader activity.
*/
public final class IteratorBatchWorker {
static final String TASK_QUEUE = "IteratorBatch";
public static void main(String[] args) {
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(profile.toWorkflowServiceStubsOptions());
WorkflowClient client = WorkflowClient.newInstance(service, profile.toWorkflowClientOptions());
WorkerFactory factory = WorkerFactory.newInstance(client);
Worker worker = factory.newWorker(TASK_QUEUE);
worker.registerWorkflowImplementationTypes(
IteratorBatchWorkflowImpl.class, RecordProcessorWorkflowImpl.class);
worker.registerActivitiesImplementations(new RecordLoaderImpl());
factory.start();
System.out.println("Worker started for task queue: " + TASK_QUEUE);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/iterator/IteratorBatchWorkflow.java
================================================
package io.temporal.samples.batch.iterator;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
@WorkflowInterface
public interface IteratorBatchWorkflow {
/**
* Processes the batch of records.
*
* @param offset the offset of the first record to process. 0 to start the batch processing.
* @param pageSize the number of records to process in a single workflow run.
* @return total number of processed records.
*/
@WorkflowMethod
int processBatch(int pageSize, int offset);
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/iterator/IteratorBatchWorkflowImpl.java
================================================
package io.temporal.samples.batch.iterator;
import io.temporal.activity.ActivityOptions;
import io.temporal.workflow.Async;
import io.temporal.workflow.ChildWorkflowOptions;
import io.temporal.workflow.Promise;
import io.temporal.workflow.Workflow;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
/**
* Implements iterator workflow pattern.
*
* <p>A single workflow run processes a single page of records in parallel. Each record is processed
* using its own RecordProcessorWorkflow child workflow.
*
* <p>After all child workflows complete the new run of the parent workflow is created using
* continue as new. The new run processes the next page of records. This way practically unlimited
* set of records can be processed.
*/
public final class IteratorBatchWorkflowImpl implements IteratorBatchWorkflow {
private final RecordLoader recordLoader =
Workflow.newActivityStub(
RecordLoader.class,
ActivityOptions.newBuilder().setStartToCloseTimeout(Duration.ofSeconds(5)).build());
/** Stub used to continue-as-new. */
private final IteratorBatchWorkflow nextRun =
Workflow.newContinueAsNewStub(IteratorBatchWorkflow.class);
@Override
public int processBatch(int pageSize, int offset) {
// Loads a page of records
List<SingleRecord> records = recordLoader.getRecords(pageSize, offset);
// Starts a child per record asynchrnously.
List<Promise<Void>> results = new ArrayList<>(records.size());
for (SingleRecord record : records) {
// Uses human friendly child id.
String childId = Workflow.getInfo().getWorkflowId() + "/" + record.getId();
RecordProcessorWorkflow processor =
Workflow.newChildWorkflowStub(
RecordProcessorWorkflow.class,
ChildWorkflowOptions.newBuilder().setWorkflowId(childId).build());
Promise<Void> result = Async.procedure(processor::processRecord, record);
results.add(result);
}
// Waits for all children to complete.
Promise.allOf(results).get();
// Skips error handling for the sample brevity.
// So failed RecordProcessorWorkflows are ignored.
// No more records in the dataset. Completes the workflow.
if (records.isEmpty()) {
return offset;
}
// Continues as new with the increased offset.
return nextRun.processBatch(pageSize, offset + records.size());
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/iterator/README.md
================================================
A sample implementation of the Workflow iterator pattern.
A workflow starts a configured number of Child Workflows in parallel. Each child processes a single record.
After all children complete, the parent calls continue-as-new and starts the children for the next page of records.
This allows processing a set of records of any size. The advantage of this approach is simplicity.
The main disadvantage is that it processes records in batches, with each batch waiting for the slowest child workflow.
A variation of this pattern runs activities instead of child workflows.
#### Running the Iterator Batch Sample
The sample has two executables. Execute each command in a separate terminal window.
The first command runs the Worker that hosts the Workflow and Activity Executions.
```bash
./gradlew -q execute -PmainClass=io.temporal.samples.batch.iterator.IteratorBatchWorker
```
The second command start the Workflow Execution. Each time the command runs, it starts a new Workflow Execution.
```bash
./gradlew -q execute -PmainClass=io.temporal.samples.batch.iterator.IteratorBatchStarter
```
================================================
FILE: core/src/main/java/io/temporal/samples/batch/iterator/RecordLoader.java
================================================
package io.temporal.samples.batch.iterator;
import io.temporal.activity.ActivityInterface;
import java.util.List;
/**
* Activity that is used to iterate over a list of records.
*
* <p>A specific implementation depends on a use case. For example, it can execute an SQL DB query
* or read a comma delimited file. More complex use cases would need passing a different type of
* offset parameter.
*/
@ActivityInterface
public interface RecordLoader {
/**
* Returns the next page of records.
*
* @param offset offset of the next page.
* @param pageSize maximum number of records to return.
* @return empty list if no more records to process.
*/
List<SingleRecord> getRecords(int pageSize, int offset);
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/iterator/RecordLoaderImpl.java
================================================
package io.temporal.samples.batch.iterator;
import java.util.ArrayList;
import java.util.List;
/** Fake implementation of RecordLoader. */
public final class RecordLoaderImpl implements RecordLoader {
// The sample always returns 5 pages.
// The real application would iterate over an existing dataset or file.
public static final int PAGE_COUNT = 5;
@Override
public List<SingleRecord> getRecords(int pageSize, int offset) {
List<SingleRecord> records = new ArrayList<>(pageSize);
if (offset < pageSize * PAGE_COUNT) {
for (int i = 0; i < pageSize; i++) {
records.add(new SingleRecord(offset + i));
}
}
return records;
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/iterator/RecordProcessorWorkflow.java
================================================
package io.temporal.samples.batch.iterator;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
/** Workflow that implements processing of a single record. */
@WorkflowInterface
public interface RecordProcessorWorkflow {
/** Processes a single record */
@WorkflowMethod
void processRecord(SingleRecord r);
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/iterator/RecordProcessorWorkflowImpl.java
================================================
package io.temporal.samples.batch.iterator;
import io.temporal.workflow.Workflow;
import java.time.Duration;
import java.util.Random;
import org.slf4j.Logger;
/** Fake RecordProcessorWorkflow implementation. */
public class RecordProcessorWorkflowImpl implements RecordProcessorWorkflow {
public static final Logger log = Workflow.getLogger(RecordProcessorWorkflowImpl.class);
private final Random random = Workflow.newRandom();
@Override
public void processRecord(SingleRecord r) {
// Simulate some processing
Workflow.sleep(Duration.ofSeconds(random.nextInt(30)));
log.info("Processed " + r);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/iterator/SingleRecord.java
================================================
package io.temporal.samples.batch.iterator;
/** Record to process. A real application would add a use case specific data. */
public class SingleRecord {
private int id;
public SingleRecord(int id) {
this.id = id;
}
/** JSON deserializer needs it */
public SingleRecord() {}
public int getId() {
return id;
}
@Override
public String toString() {
return "SingleRecord{" + "id=" + id + '}';
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/BatchProgress.java
================================================
package io.temporal.samples.batch.slidingwindow;
import java.util.Set;
/** Used as a result of {@link SlidingWindowBatchWorkflow#getProgress()} query. */
public final class BatchProgress {
private final int progress;
private final Set<Integer> currentRecords;
public BatchProgress(int progress, Set<Integer> currentRecords) {
this.progress = progress;
this.currentRecords = currentRecords;
}
/** Count of completed record processing child workflows. */
public int getProgress() {
return progress;
}
/** Ids of records that are currently being processed by child workflows. */
public Set<Integer> getCurrentRecords() {
return currentRecords;
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/BatchWorkflow.java
================================================
package io.temporal.samples.batch.slidingwindow;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
@WorkflowInterface
public interface BatchWorkflow {
/**
* Processes a batch of records using multiple parallel sliding window workflows.
*
* @param pageSize the number of records to start processing in a single sliding window workflow
* run.
* @param slidingWindowSize the number of records to process in parallel by a single sliding
* window workflow. Can be larger than the pageSize.
* @param partitions defines the number of SlidingWindowBatchWorkflows to run in parallel. If
* number of partitions is too low the update rate of a single SlidingWindowBatchWorkflows can
* get too high.
* @return total number of processed records.
*/
@WorkflowMethod
int processBatch(int pageSize, int slidingWindowSize, int partitions);
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/BatchWorkflowImpl.java
================================================
package io.temporal.samples.batch.slidingwindow;
import io.temporal.activity.ActivityOptions;
import io.temporal.workflow.Async;
import io.temporal.workflow.ChildWorkflowOptions;
import io.temporal.workflow.Promise;
import io.temporal.workflow.Workflow;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
/** Implements BatchWorkflow by running multiple SlidingWindowBatchWorkflows in parallel. */
public class BatchWorkflowImpl implements BatchWorkflow {
private final RecordLoader recordLoader =
Workflow.newActivityStub(
RecordLoader.class,
ActivityOptions.newBuilder().setStartToCloseTimeout(Duration.ofSeconds(5)).build());
@Override
public int processBatch(int pageSize, int slidingWindowSize, int partitions) {
// The sample partitions the data set into continuous ranges.
// A real application can choose any other way to divide the records into multiple collections.
int totalCount = recordLoader.getRecordCount();
int partitionSize = totalCount / partitions + (totalCount % partitions > 0 ? 1 : 0);
List<Promise<Integer>> results = new ArrayList<>(partitions);
for (int i = 0; i < partitions; i++) {
// Makes child id more user-friendly
String childId = Workflow.getInfo().getWorkflowId() + "/" + i;
SlidingWindowBatchWorkflow partitionWorkflow =
Workflow.newChildWorkflowStub(
SlidingWindowBatchWorkflow.class,
ChildWorkflowOptions.newBuilder().setWorkflowId(childId).build());
// Define partition boundaries.
int offset = partitionSize * i;
int maximumOffset = Math.min(offset + partitionSize, totalCount);
ProcessBatchInput input = new ProcessBatchInput();
input.setPageSize(pageSize);
input.setSlidingWindowSize(slidingWindowSize);
input.setOffset(offset);
input.setMaximumOffset(maximumOffset);
Promise<Integer> partitionResult = Async.function(partitionWorkflow::processBatch, input);
results.add(partitionResult);
}
int result = 0;
for (Promise<Integer> partitionResult : results) {
result += partitionResult.get();
}
return result;
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/ProcessBatchInput.java
================================================
package io.temporal.samples.batch.slidingwindow;
import java.util.HashSet;
import java.util.Set;
/** Input of {@link SlidingWindowBatchWorkflow#processBatch(ProcessBatchInput)} */
public final class ProcessBatchInput {
private int pageSize;
private int slidingWindowSize;
int offset;
private int maximumOffset;
private int progress;
private Set<Integer> currentRecords = new HashSet<>();
/** the number of records to load in a single RecordLoader.getRecords call. */
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
/** the number of parallel record processing child workflows to execute. */
public void setSlidingWindowSize(int slidingWindowSize) {
this.slidingWindowSize = slidingWindowSize;
}
/** index of the first record to process. 0 to start the batch processing. */
public void setOffset(int offset) {
this.offset = offset;
}
/** The maximum offset (exclusive) to process by this workflow. */
public void setMaximumOffset(int maximumOffset) {
this.maximumOffset = maximumOffset;
}
/** Total number of records processed so far by this workflow. */
public void setProgress(int progress) {
this.progress = progress;
}
/**
* Ids of records that are being processed by child workflows.
*
* <p>This puts a limit on the sliding window size as workflow arguments cannot exceed 2MB in JSON
* format. Another practical limit is the number of signals a workflow can handle per second.
* Adjust the number of partitions to keep this rate at a reasonable value.
*/
public void setCurrentRecords(Set<Integer> currentRecords) {
this.currentRecords = currentRecords;
}
public int getPageSize() {
return pageSize;
}
public int getSlidingWindowSize() {
return slidingWindowSize;
}
public int getOffset() {
return offset;
}
public int getMaximumOffset() {
return maximumOffset;
}
public int getProgress() {
return progress;
}
public Set<Integer> getCurrentRecords() {
return currentRecords;
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/README.md
================================================
A sample implementation of a batch processing Workflow that maintains a sliding window of record processing Workflows.
A Workflow starts a configured number of Child Workflows in parallel. Each child processes a single record.
When a child completes a new child immediately started.
A Parent Workflow calls continue-as-new after starting a preconfigured number of children.
A child completion is reported through a Signal as a parent cannot directly wait for a child started by a previous run.
Multiple instances of SlidingWindowBatchWorkflow run in parallel each processing a subset of records to support higher total rate of processing.
#### Running the Sliding Window Batch Sample
The sample has two executables. Execute each command in a separate terminal window.
The first command runs the Worker that hosts the Workflow and Activity Executions.
```bash
./gradlew -q execute -PmainClass=io.temporal.samples.batch.slidingwindow.SlidingWindowBatchWorker
```
Note that `Caused by: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: UnhandledCommand` info messages in the output
are expected and benign. They ensure that signals are not lost when there is a race condition between workflow calling
continue-as-new and receiving a signal. If these messages appear too frequently consider increasing the number of
partitions parameter passed to `BatchWorkflow.processBatch`. They will completely disappear
when [Issue 1289](https://github.com/temporalio/temporal/issues/1289) is implemented.
The second command start the BatchWorkflow Execution. Each time the command runs, it starts a new BatchWorkflow
Execution.
```bash
./gradlew -q execute -PmainClass=io.temporal.samples.batch.slidingwindow.SlidingWindowBatchStarter
```
================================================
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/RecordIterable.java
================================================
package io.temporal.samples.batch.slidingwindow;
import io.temporal.activity.ActivityOptions;
import io.temporal.workflow.Workflow;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import org.jetbrains.annotations.NotNull;
/** Iterable implementation that relies on RecordLoader activity. */
public class RecordIterable implements Iterable<SingleRecord> {
/**
* Iterator implementation that relies on RecordLoader activity.
*
* <p>This code assumes that RecordLoader.getRecords never returns a failure to the workflow. The
* real production application might make a different design choice.
*/
private class RecordIterator implements Iterator<SingleRecord> {
/**
* The last page of records loaded through RecordLoader activity. The activity returns an empty
* page to indicate the end of iteration.
*/
private List<SingleRecord> lastPage;
/** The offset of the last loaded batch of records. */
private int offset;
/** Index into the last loaded page of the next record to return. */
private int index;
RecordIterator() {
this.offset = initialOffset;
if (initialOffset > maximumOffset) {
this.lastPage = new ArrayList<>();
} else {
int size = Math.min(pageSize, maximumOffset - offset);
this.lastPage = recordLoader.getRecords(size, offset);
}
}
@Override
public boolean hasNext() {
return !lastPage.isEmpty();
}
@Override
public SingleRecord next() {
int size = lastPage.size();
if (size == 0) {
throw new NoSuchElementException();
}
SingleRecord result = lastPage.get(index++);
if (size == index) {
offset += index;
index = 0;
lastPage = recordLoader.getRecords(pageSize, offset);
}
return result;
}
}
private final int initialOffset;
private final int pageSize;
private final int maximumOffset;
private final RecordLoader recordLoader =
Workflow.newActivityStub(
RecordLoader.class,
ActivityOptions.newBuilder().setStartToCloseTimeout(Duration.ofSeconds(5)).build());
/**
* @param pageSize size of a single page to load.
* @param initialOffset the initial offset to load records from.
* @param maximumOffset the maximum offset (exclusive).
*/
public RecordIterable(int pageSize, int initialOffset, int maximumOffset) {
this.pageSize = pageSize;
this.initialOffset = initialOffset;
this.maximumOffset = maximumOffset;
}
@NotNull
@Override
public Iterator<SingleRecord> iterator() {
return new RecordIterator();
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/RecordLoader.java
================================================
package io.temporal.samples.batch.slidingwindow;
import io.temporal.activity.ActivityInterface;
import java.util.List;
@ActivityInterface
public interface RecordLoader {
/**
* Returns the next page of records.
*
* @param offset offset of the next page.
* @param pageSize maximum number of records to return.
* @return empty list if no more records to process.
*/
List<SingleRecord> getRecords(int pageSize, int offset);
/**
* Returns the total record count.
*
* <p>Used to divide record ranges among partitions. Some applications might choose a completely
* different approach for partitioning the data set.
*/
int getRecordCount();
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/RecordLoaderImpl.java
================================================
package io.temporal.samples.batch.slidingwindow;
import java.util.ArrayList;
import java.util.List;
/** Fake loader implementation. The real application would iterate over a dataset or file. */
public final class RecordLoaderImpl implements RecordLoader {
private static final int TOTAL_COUNT = 300;
@Override
public List<SingleRecord> getRecords(int pageSize, int offset) {
List<SingleRecord> records = new ArrayList<>(pageSize);
if (offset < TOTAL_COUNT) {
for (int i = offset; i < Math.min(offset + pageSize, TOTAL_COUNT); i++) {
records.add(new SingleRecord(i));
}
}
return records;
}
@Override
public int getRecordCount() {
return TOTAL_COUNT;
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/RecordProcessorWorkflow.java
================================================
package io.temporal.samples.batch.slidingwindow;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
/** Workflow that implements processing of a single record. */
@WorkflowInterface
public interface RecordProcessorWorkflow {
/**
* Processes a single record. Must report completion to a parent through {@link
* SlidingWindowBatchWorkflow#reportCompletion(int)}
*/
@WorkflowMethod
void processRecord(SingleRecord r);
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/RecordProcessorWorkflowImpl.java
================================================
package io.temporal.samples.batch.slidingwindow;
import io.temporal.workflow.Workflow;
import java.time.Duration;
import java.util.Optional;
import java.util.Random;
import org.slf4j.Logger;
/** Fake RecordProcessorWorkflow implementation. */
public final class RecordProcessorWorkflowImpl implements RecordProcessorWorkflow {
public static final Logger log = Workflow.getLogger(RecordProcessorWorkflowImpl.class);
private final Random random = Workflow.newRandom();
@Override
public void processRecord(SingleRecord r) {
processRecordImpl(r);
// This workflow is always expected to have a parent.
// But for unit testing it might be useful to skip the notification.
Optional<String> parentWorkflowId = Workflow.getInfo().getParentWorkflowId();
if (parentWorkflowId.isPresent()) {
String parentId = parentWorkflowId.get();
SlidingWindowBatchWorkflow parent =
Workflow.newExternalWorkflowStub(SlidingWindowBatchWorkflow.class, parentId);
// Notify parent about record processing completion
parent.reportCompletion(r.getId());
}
}
/** Application specific record processing logic goes here. */
private void processRecordImpl(SingleRecord r) {
// Simulate some processing
Workflow.sleep(Duration.ofSeconds(random.nextInt(10)));
log.info("Processed " + r);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/SingleRecord.java
================================================
package io.temporal.samples.batch.slidingwindow;
/** Record to process. */
public class SingleRecord {
private int id;
public SingleRecord(int id) {
this.id = id;
}
/** Needed for JSON deserialization. */
public SingleRecord() {}
public int getId() {
return id;
}
@Override
public String toString() {
return "SingleRecord{" + "id=" + id + '}';
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/SlidingWindowBatchStarter.java
================================================
package io.temporal.samples.batch.slidingwindow;
import static io.temporal.samples.batch.slidingwindow.SlidingWindowBatchWorker.TASK_QUEUE;
import io.temporal.client.WorkflowClient;
import io.temporal.client.WorkflowOptions;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.serviceclient.WorkflowServiceStubs;
import java.io.IOException;
public class SlidingWindowBatchStarter {
@SuppressWarnings("CatchAndPrintStackTrace")
public static void main(String[] args) {
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(profile.toWorkflowServiceStubsOptions());
WorkflowClient workflowClient =
WorkflowClient.newInstance(service, profile.toWorkflowClientOptions());
WorkflowOptions options = WorkflowOptions.newBuilder().setTaskQueue(TASK_QUEUE).build();
BatchWorkflow batchWorkflow = workflowClient.newWorkflowStub(BatchWorkflow.class, options);
WorkflowClient.start(batchWorkflow::processBatch, 10, 25, 3);
System.out.println("Started batch workflow with 3 partitions");
System.exit(0);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/SlidingWindowBatchWorker.java
================================================
package io.temporal.samples.batch.slidingwindow;
import io.temporal.client.WorkflowClient;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.serviceclient.WorkflowServiceStubs;
import io.temporal.worker.Worker;
import io.temporal.worker.WorkerFactory;
import java.io.IOException;
/** Hosts sliding window batch sample workflow and activity implementations. */
public final class SlidingWindowBatchWorker {
static final String TASK_QUEUE = "SlidingWindow";
public static void main(String[] args) {
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(profile.toWorkflowServiceStubsOptions());
WorkflowClient client = WorkflowClient.newInstance(service, profile.toWorkflowClientOptions());
WorkerFactory factory = WorkerFactory.newInstance(client);
Worker worker = factory.newWorker(TASK_QUEUE);
worker.registerWorkflowImplementationTypes(
BatchWorkflowImpl.class,
SlidingWindowBatchWorkflowImpl.class,
RecordProcessorWorkflowImpl.class);
worker.registerActivitiesImplementations(new RecordLoaderImpl());
factory.start();
System.out.println("Worker started for task queue: " + TASK_QUEUE);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/SlidingWindowBatchWorkflow.java
================================================
package io.temporal.samples.batch.slidingwindow;
import io.temporal.workflow.QueryMethod;
import io.temporal.workflow.SignalMethod;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
@WorkflowInterface
public interface SlidingWindowBatchWorkflow {
/**
* Process the batch of records.
*
* @return total number of processed records.
*/
@WorkflowMethod
int processBatch(ProcessBatchInput input);
@SignalMethod
void reportCompletion(int recordId);
@QueryMethod
BatchProgress getProgress();
}
================================================
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/SlidingWindowBatchWorkflowImpl.java
================================================
package io.temporal.samples.batch.slidingwindow;
import io.temporal.api.common.v1.WorkflowExecution;
import io.temporal.api.enums.v1.ParentClosePolicy;
import io.temporal.workflow.*;
import java.util.*;
/**
* Implements batch processing by executing a specified number of workflows in parallel. A new
* record processing workflow is started when a previously started one completes. The child
* completion is reported through reportCompletion signal as it is not yet possible to passively
* wait for a workflow that was started by a previous run.
*
* <p>Calls continue-as-new after starting 100 children. Note that the sliding window size can be
* larger than 100.
*/
public final class SlidingWindowBatchWorkflowImpl implements SlidingWindowBatchWorkflow {
/** Stub used to call continue-as-new. */
private final SlidingWindowBatchWorkflow nextRun =
Workflow.newContinueAsNewStub(SlidingWindowBatchWorkflow.class);
/** Contains ids of records that are being processed by child workflows. */
private Set<Integer> currentRecords;
/**
* Used to accumulate records to remove for signals delivered before processBatch method started
* execution
*/
private Set<Integer> recordsToRemove = new HashSet<>();
/** Count of completed record processing child workflows. */
private int progress;
/**
* @return number of processed records
*/
@Override
public int processBatch(ProcessBatchInput input) {
WorkflowInfo info = Workflow.getInfo();
this.progress = input.getProgress();
this.currentRecords = input.getCurrentRecords();
// Remove records for signals delivered before the workflow run started.
int countBefore = this.currentRecords.size();
this.currentRecords.removeAll(recordsToRemove);
this.progress += countBefore - this.currentRecords.size();
int pageSize = input.getPageSize();
int offset = input.getOffset();
int maximumOffset = input.getMaximumOffset();
int slidingWindowSize = input.getSlidingWindowSize();
Iterable<SingleRecord> records = new RecordIterable(pageSize, offset, maximumOffset);
List<Promise<WorkflowExecution>> childrenStartedByThisRun = new ArrayList<>();
Iterator<SingleRecord> recordIterator = records.iterator();
while (true) {
// After starting slidingWindowSize children blocks until a completion signal is received.
Workflow.await(() -> currentRecords.size() < slidingWindowSize);
// Completes workflow, if no more records to process.
if (!recordIterator.hasNext()) {
// Awaits for all children to complete
Workflow.await(() -> currentRecords.size() == 0);
return offset + childrenStartedByThisRun.size();
}
SingleRecord record = recordIterator.next();
// Uses ParentClosePolicy ABANDON to ensure that children survive continue-as-new of a parent.
// Assigns user-friendly child workflow id.
ChildWorkflowOptions childWorkflowOptions =
ChildWorkflowOptions.newBuilder()
.setParentClosePolicy(ParentClosePolicy.PARENT_CLOSE_POLICY_ABANDON)
.setWorkflowId(info.getWorkflowId() + "/" + record.getId())
.build();
RecordProcessorWorkflow processor =
Workflow.newChildWorkflowStub(RecordProcessorWorkflow.class, childWorkflowOptions);
// Starts a child workflow asynchronously ignoring its result.
// The assumption is that the parent workflow doesn't need to deal with child workflow
// results and failures. Another assumption is that a child in any situation calls
// the reportCompletion signal.
Async.procedure(processor::processRecord, record);
// Resolves when a child reported successful start.
// Used to wait for a child start on continue-as-new.
Promise<WorkflowExecution> childStartedPromise = Workflow.getWorkflowExecution(processor);
childrenStartedByThisRun.add(childStartedPromise);
currentRecords.add(record.getId());
// Continues-as-new after starting pageSize children
if (childrenStartedByThisRun.size() == pageSize) {
// Waits for all children to start. Without this wait, workflow completion through
// continue-as-new might lead to a situation when they never start.
// Assumes that they never fail to start as their automatically generated
// IDs are not expected to collide.
Promise.allOf(childrenStartedByThisRun).get();
// Continues as new to keep the history size bounded
ProcessBatchInput newInput = new ProcessBatchInput();
newInput.setPageSize(pageSize);
newInput.setSlidingWindowSize(slidingWindowSize);
newInput.setOffset(offset + childrenStartedByThisRun.size());
newInput.setMaximumOffset(maximumOffset);
newInput.setProgress(progress);
newInput.setCurrentRecords(currentRecords);
return nextRun.processBatch(newInput);
}
}
}
@Override
public void reportCompletion(int recordId) {
// Handle situation when signal handler is called before the workflow main method.
if (currentRecords == null) {
recordsToRemove.add(recordId);
return;
}
// Dedupes signals as in some edge cases they can be duplicated.
if (currentRecords.remove(recordId)) {
progress++;
}
}
@Override
public BatchProgress getProgress() {
return new BatchProgress(progress, currentRecords);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/bookingsaga/Booking.java
================================================
package io.temporal.samples.bookingsaga;
public final class Booking {
private String carReservationID;
private String hotelReservationID;
private String flightReservationID;
/** Empty constructor to keep Jackson serializer happy. */
public Booking() {}
public Booking(String carReservationID, String hotelReservationID, String flightReservationID) {
this.carReservationID = carReservationID;
this.hotelReservationID = hotelReservationID;
this.flightReservationID = flightReservationID;
}
public String getCarReservationID() {
return carReservationID;
}
public String getHotelReservationID() {
return hotelReservationID;
}
public String getFlightReservationID() {
return flightReservationID;
}
@Override
public String toString() {
return "Booking{"
+ "carReservationID='"
+ carReservationID
+ '\''
+ ", hotelReservationID='"
+ hotelReservationID
+ '\''
+ ", flightReservationID='"
+ flightReservationID
+ '\''
+ '}';
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/bookingsaga/README.md
================================================
## Saga example: trip booking
Temporal implementation of
the [Camunda BPMN trip booking example](https://github.com/berndruecker/trip-booking-saga-java) which demonstrates
Temporal approach to SAGA.
Run the following command to start the sample:
```bash
./gradlew -q execute -PmainClass=io.temporal.samples.bookingsaga.TripBookingSaga
```
Note that the booking is expected to fail to demonstrate the compensation flow.
Sample unit
testing: [TripBookingWorkflowTest](https://github.com/temporalio/samples-java/blob/main/core/src/test/java/io/temporal/samples/bookingsaga/TripBookingWorkflowTest.java)
================================================
FILE: core/src/main/java/io/temporal/samples/bookingsaga/TripBookingActivities.java
================================================
package io.temporal.samples.bookingsaga;
import io.temporal.activity.ActivityInterface;
@ActivityInterface
public interface TripBookingActivities {
/**
* Request a car rental reservation.
*
* @param requestId used for idempotency and compensation correlation.
* @param name customer name
* @return reservationID
*/
String reserveCar(String requestId, String name);
/**
* Request a flight reservation.
*
* @param requestId used for idempotency and compensation correlation.
* @param name customer name
* @return reservationID
*/
String bookFlight(String requestId, String name);
/**
* Request a hotel reservation.
*
* @param requestId used for idempotency and compensation correlation.
* @param name customer name
* @return reservationID
*/
String bookHotel(String requestId, String name);
/**
* Cancel a flight reservation.
*
* @param name customer name
* @param requestId the same id is passed to bookFlight
* @return cancellationConfirmationID
*/
String cancelFlight(String requestId, String name);
/**
* Cancel a hotel reservation.
*
* @param name customer name
* @param requestId the same id is passed to bookHotel
* @return cancellationConfirmationID
*/
String cancelHotel(String requestId, String name);
/**
* Cancel a car rental reservation.
*
* @param name customer name
* @param requestId the same id is passed to reserveCar
* @return cancellationConfirmationID
*/
String cancelCar(String requestId, String name);
}
================================================
FILE: core/src/main/java/io/temporal/samples/bookingsaga/TripBookingActivitiesImpl.java
================================================
package io.temporal.samples.bookingsaga;
import io.temporal.failure.ApplicationFailure;
import java.util.UUID;
public class TripBookingActivitiesImpl implements TripBookingActivities {
@Override
public String reserveCar(String requestId, String name) {
System.out.println("reserving car for request '" + requestId + "` and name `" + name + "'");
return UUID.randomUUID().toString();
}
@Override
public String bookFlight(String requestId, String name) {
System.out.println(
"failing to book flight for request '" + requestId + "' and name '" + name + "'");
throw ApplicationFailure.newNonRetryableFailure(
"Flight booking did not work", "bookingFailure");
}
@Override
public String bookHotel(String requestId, String name) {
System.out.println("booking hotel for request '" + requestId + "` and name `" + name + "'");
return UUID.randomUUID().toString();
}
@Override
public String cancelFlight(String requestId, String name) {
System.out.println("cancelling flight reservation '" + requestId + "' for '" + name + "'");
return UUID.randomUUID().toString();
}
@Override
public String cancelHotel(String requestId, String name) {
System.out.println("cancelling hotel reservation '" + requestId + "' for '" + name + "'");
return UUID.randomUUID().toString();
}
@Override
public String cancelCar(String requestId, String name) {
System.out.println("cancelling car reservation '" + requestId + "' for '" + name + "'");
return UUID.randomUUID().toString();
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/bookingsaga/TripBookingClient.java
================================================
package io.temporal.samples.bookingsaga;
import com.google.common.base.Throwables;
import io.temporal.client.WorkflowClient;
import io.temporal.client.WorkflowOptions;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.serviceclient.WorkflowServiceStubs;
import java.io.IOException;
public class TripBookingClient {
static final String TASK_QUEUE = "TripBooking";
public static void main(String[] args) {
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
// gRPC stubs wrapper that talks to the temporal service.
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(profile.toWorkflowServiceStubsOptions());
// client that can be used to start and signal workflows
WorkflowClient client = WorkflowClient.newInstance(service, profile.toWorkflowClientOptions());
WorkflowOptions options =
WorkflowOptions.newBuilder().setTaskQueue(TASK_QUEUE).setWorkflowId("Booking1").build();
TripBookingWorkflow trip = client.newWorkflowStub(TripBookingWorkflow.class, options);
try {
Booking booking = trip.bookTrip("trip1");
System.out.println("Booking: " + booking);
} catch (Exception e) {
System.out.println(Throwables.getStackTraceAsString(e));
}
System.exit(0);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/bookingsaga/TripBookingWorker.java
================================================
package io.temporal.samples.bookingsaga;
import io.temporal.client.WorkflowClient;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.serviceclient.WorkflowServiceStubs;
import io.temporal.worker.Worker;
import io.temporal.worker.WorkerFactory;
import java.io.IOException;
public class TripBookingWorker {
@SuppressWarnings("CatchAndPrintStackTrace")
public static void main(String[] args) {
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
// gRPC stubs wrapper that talks to the temporal service.
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(profile.toWorkflowServiceStubsOptions());
// client that can be used to start and signal workflows
WorkflowClient client = WorkflowClient.newInstance(service, profile.toWorkflowClientOptions());
// worker factory that can be used to create workers for specific task queues
WorkerFactory factory = WorkerFactory.newInstance(client);
// Worker that listens on a task queue and hosts both workflow and activity implementations.
Worker worker = factory.newWorker(TripBookingClient.TASK_QUEUE);
// Workflows are stateful. So you need a type to create instances.
worker.registerWorkflowImplementationTypes(TripBookingWorkflowImpl.class);
// Activities are stateless and thread safe. So a shared instance is used.
TripBookingActivities tripBookingActivities = new TripBookingActivitiesImpl();
worker.registerActivitiesImplementations(tripBookingActivities);
// Start all workers created by this factory.
factory.start();
System.out.println("Worker started for task queue: " + TripBookingClient.TASK_QUEUE);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/bookingsaga/TripBookingWorkflow.java
================================================
package io.temporal.samples.bookingsaga;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
@WorkflowInterface
public interface TripBookingWorkflow {
@WorkflowMethod
Booking bookTrip(String name);
}
================================================
FILE: core/src/main/java/io/temporal/samples/bookingsaga/TripBookingWorkflowImpl.java
================================================
package io.temporal.samples.bookingsaga;
import io.temporal.activity.ActivityOptions;
import io.temporal.failure.ActivityFailure;
import io.temporal.workflow.Saga;
import io.temporal.workflow.Workflow;
import java.time.Duration;
public class TripBookingWorkflowImpl implements TripBookingWorkflow {
private final ActivityOptions options =
ActivityOptions.newBuilder().setStartToCloseTimeout(Duration.ofSeconds(10)).build();
private final TripBookingActivities activities =
Workflow.newActivityStub(TripBookingActivities.class, options);
@Override
public Booking bookTrip(String name) {
// Configure SAGA to run compensation activities in parallel
Saga.Options sagaOptions = new Saga.Options.Builder().setParallelCompensation(true).build();
Saga saga = new Saga(sagaOptions);
try {
// addCompensation is added before the actual call to handle situations when the call failed
// due to a timeout and its success is not clear.
// The compensation code must handle situations when the actual function wasn't executed
// gracefully.
String carReservationRequestId = Workflow.randomUUID().toString();
saga.addCompensation(activities::cancelCar, carReservationRequestId, name);
String carReservationID = activities.reserveCar(carReservationRequestId, name);
String hotelReservationRequestID = Workflow.randomUUID().toString();
saga.addCompensation(activities::cancelHotel, hotelReservationRequestID, name);
String hotelReservationId = activities.bookHotel(hotelReservationRequestID, name);
String flightReservationRequestID = Workflow.randomUUID().toString();
saga.addCompensation(activities::cancelFlight, flightReservationRequestID, name);
String flightReservationID = activities.bookFlight(flightReservationRequestID, name);
return new Booking(carReservationID, hotelReservationId, flightReservationID);
} catch (ActivityFailure e) {
// Ensure that compensations are executed even if the workflow is canceled.
Workflow.newDetachedCancellationScope(() -> saga.compensate()).run();
throw e;
}
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/bookingsyncsaga/Booking.java
================================================
package io.temporal.samples.bookingsyncsaga;
public final class Booking {
private final String carReservationID;
private final String hotelReservationID;
private final String flightReservationID;
public Booking(String carReservationID, String hotelReservationID, String flightReservationID) {
this.carReservationID = carReservationID;
this.hotelReservationID = hotelReservationID;
this.flightReservationID = flightReservationID;
}
public String getCarReservationID() {
return carReservationID;
}
public String getHotelReservationID() {
return hotelReservationID;
}
public String getFlightReservationID() {
return flightReservationID;
}
@Override
public String toString() {
return "Booking{"
+ "carReservationID='"
+ carReservationID
+ '\''
+ ", hotelReservationID='"
+ hotelReservationID
+ '\''
+ ", flightReservationID='"
+ flightReservationID
+ '\''
+ '}';
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/bookingsyncsaga/README.md
================================================
## Saga example: synchronous trip booking
The sample demonstrates low latency workflow with client synchronously waiting for result using an update.
In case of failures the caller is unblocked and workflow continues executing compensations
for as long as needed.
Run the following command to start the worker:
```bash
./gradlew -q execute -PmainClass=io.temporal.samples.bookingsyncsaga.TripBookingWorker
```
Run the following command to request a booking.
Note that the booking is expected to fail to demonstrate the compensation flow.
```bash
./gradlew -q execute -PmainClass=io.temporal.samples.bookingsyncsaga.TripBookingClient
```
================================================
FILE: core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingActivities.java
================================================
package io.temporal.samples.bookingsyncsaga;
import io.temporal.activity.ActivityInterface;
@ActivityInterface
public interface TripBookingActivities {
/**
* Request a car rental reservation.
*
* @param requestId used for idempotency and compensation correlation.
* @param name customer name
* @return reservationID
*/
String reserveCar(String requestId, String name);
/**
* Request a flight reservation.
*
* @param requestId used for idempotency and compensation correlation.
* @param name customer name
* @return reservationID
*/
String bookFlight(String requestId, String name);
/**
* Request a hotel reservation.
*
* @param requestId used for idempotency and compensation correlation.
* @param name customer name
* @return reservationID
*/
String bookHotel(String requestId, String name);
/**
* Cancel a flight reservation.
*
* @param name customer name
* @param requestId the same id is passed to bookFlight
* @return cancellationConfirmationID
*/
String cancelFlight(String requestId, String name);
/**
* Cancel a hotel reservation.
*
* @param name customer name
* @param requestId the same id is passed to bookHotel
* @return cancellationConfirmationID
*/
String cancelHotel(String requestId, String name);
/**
* Cancel a car rental reservation.
*
* @param name customer name
* @param requestId the same id is passed to reserveCar
* @return cancellationConfirmationID
*/
String cancelCar(String requestId, String name);
}
================================================
FILE: core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingActivitiesImpl.java
================================================
package io.temporal.samples.bookingsyncsaga;
import io.temporal.failure.ApplicationFailure;
import java.util.UUID;
public class TripBookingActivitiesImpl implements TripBookingActivities {
@Override
public String reserveCar(String requestId, String name) {
System.out.println("reserving car for request '" + requestId + "` and name `" + name + "'");
return UUID.randomUUID().toString();
}
@Override
public String bookFlight(String requestId, String name) {
System.out.println(
"failing to book flight for request '" + requestId + "' and name '" + name + "'");
throw ApplicationFailure.newNonRetryableFailure(
"Flight booking did not work", "bookingFailure");
}
@Override
public String bookHotel(String requestId, String name) {
System.out.println("booking hotel for request '" + requestId + "` and name `" + name + "'");
return UUID.randomUUID().toString();
}
@Override
public String cancelFlight(String requestId, String name) {
System.out.println("cancelling flight reservation '" + requestId + "' for '" + name + "'");
sleep(1000);
return UUID.randomUUID().toString();
}
@Override
public String cancelHotel(String requestId, String name) {
System.out.println("cancelling hotel reservation '" + requestId + "' for '" + name + "'");
sleep(1000);
return UUID.randomUUID().toString();
}
@Override
public String cancelCar(String requestId, String name) {
System.out.println("cancelling car reservation '" + requestId + "' for '" + name + "'");
sleep(1000);
return UUID.randomUUID().toString();
}
private static void sleep(long milliseconds) {
try {
Thread.sleep(milliseconds);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingClient.java
================================================
package io.temporal.samples.bookingsyncsaga;
import com.google.common.base.Throwables;
import io.temporal.client.WorkflowClient;
import io.temporal.client.WorkflowOptions;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.serviceclient.WorkflowServiceStubs;
import java.io.IOException;
public class TripBookingClient {
static final String TASK_QUEUE = "TripBookingSync";
public static void main(String[] args) {
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
// gRPC stubs wrapper that talks to the temporal service.
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(profile.toWorkflowServiceStubsOptions());
// client that can be used to start and signal workflows
WorkflowClient client = WorkflowClient.newInstance(service, profile.toWorkflowClientOptions());
WorkflowOptions options =
WorkflowOptions.newBuilder().setTaskQueue(TASK_QUEUE).setWorkflowId("Booking1").build();
TripBookingWorkflow trip1 = client.newWorkflowStub(TripBookingWorkflow.class, options);
// Start workflow asynchronously
WorkflowClient.start(trip1::bookTrip, "trip1");
try {
// Wait for workflow to complete or fail the booking using an update.
Booking booking = trip1.waitForBooking();
System.out.println("Booking: " + booking);
} catch (Exception e) {
System.out.println(Throwables.getStackTraceAsString(e));
}
System.exit(0);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingWorker.java
================================================
package io.temporal.samples.bookingsyncsaga;
import io.temporal.client.WorkflowClient;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.serviceclient.WorkflowServiceStubs;
import io.temporal.worker.Worker;
import io.temporal.worker.WorkerFactory;
import java.io.IOException;
public class TripBookingWorker {
@SuppressWarnings("CatchAndPrintStackTrace")
public static void main(String[] args) {
// gRPC stubs wrapper that talks to the local docker instance of temporal service.
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(profile.toWorkflowServiceStubsOptions());
// client that can be used to start and signal workflows
WorkflowClient client = WorkflowClient.newInstance(service, profile.toWorkflowClientOptions());
// worker factory that can be used to create workers for specific task queues
WorkerFactory factory = WorkerFactory.newInstance(client);
// Worker that listens on a task queue and hosts both workflow and activity implementations.
Worker worker = factory.newWorker(TripBookingClient.TASK_QUEUE);
// Workflows are stateful. So you need a type to create instances.
worker.registerWorkflowImplementationTypes(TripBookingWorkflowImpl.class);
// Activities are stateless and thread safe. So a shared instance is used.
TripBookingActivities tripBookingActivities = new TripBookingActivitiesImpl();
worker.registerActivitiesImplementations(tripBookingActivities);
// Start all workers created by this factory.
factory.start();
System.out.println("Worker started for task queue: " + TripBookingClient.TASK_QUEUE);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingWorkflow.java
================================================
package io.temporal.samples.bookingsyncsaga;
import io.temporal.workflow.UpdateMethod;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
@WorkflowInterface
public interface TripBookingWorkflow {
@WorkflowMethod
void bookTrip(String name);
/**
* Used to wait for booking completion or failure. After this method returns a failure workflow
* keeps running executing compensations.
*
* @return booking information.
*/
@UpdateMethod
Booking waitForBooking();
}
================================================
FILE: core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingWorkflowImpl.java
================================================
package io.temporal.samples.bookingsyncsaga;
import io.temporal.activity.ActivityOptions;
import io.temporal.activity.LocalActivityOptions;
import io.temporal.common.RetryOptions;
import io.temporal.failure.ActivityFailure;
import io.temporal.workflow.CompletablePromise;
import io.temporal.workflow.Saga;
import io.temporal.workflow.Workflow;
import java.time.Duration;
public class TripBookingWorkflowImpl implements TripBookingWorkflow {
/**
* Use local activities for the happy path. This allows to execute the whole sequence as a single
* workflow task. Don't use local activities if you expect long retries.
*/
private final LocalActivityOptions options =
LocalActivityOptions.newBuilder()
.build()
.newBuilder()
.setStartToCloseTimeout(Duration.ofSeconds(1))
.setRetryOptions(RetryOptions.newBuilder().setMaximumAttempts(3).build())
.build();
private final TripBookingActivities activities =
Workflow.newLocalActivityStub(TripBookingActivities.class, options);
/** Use normal activities for compensations, as they potentially need long retries. */
private final ActivityOptions compensationOptions =
ActivityOptions.newBuilder()
.setStartToCloseTimeout(Duration.ofHours(1))
.setRetryOptions(RetryOptions.newBuilder().setMaximumAttempts(1).build())
.build();
private final TripBookingActivities compensationActivities =
Workflow.newActivityStub(TripBookingActivities.class, compensationOptions);
/** Used to pass result to the update function. */
private final CompletablePromise<Booking> booking = Workflow.newPromise();
@Override
public void bookTrip(String name) {
Saga.Options sagaOptions = new Saga.Options.Builder().build();
Saga saga = new Saga(sagaOptions);
try {
// addCompensation is added before the actual call to handle situations when the call failed
// due to
// a timeout and its success is not clear.
// The compensation code must handle situations when the actual function wasn't executed
// gracefully.
String carReservationRequestId = Workflow.randomUUID().toString();
saga.addCompensation(compensationActivities::cancelCar, carReservationRequestId, name);
String carReservationID = activities.reserveCar(carReservationRequestId, name);
String hotelReservationRequestID = Workflow.randomUUID().toString();
saga.addCompensation(compensationActivities::cancelHotel, hotelReservationRequestID, name);
String hotelReservationId = activities.bookHotel(hotelReservationRequestID, name);
String flightReservationRequestID = Workflow.randomUUID().toString();
saga.addCompensation(compensationActivities::cancelFlight, flightReservationRequestID, name);
String flightReservationID = activities.bookFlight(flightReservationRequestID, name);
// Unblock the update function
booking.complete(new Booking(carReservationID, hotelReservationId, flightReservationID));
} catch (ActivityFailure e) {
// Unblock the update function
booking.completeExceptionally(e);
// Ensure that compensations are executed even if the workflow is canceled.
Workflow.newDetachedCancellationScope(() -> saga.compensate()).run();
throw e;
}
}
@Override
public Booking waitForBooking() {
return booking.get();
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/common/QueryWorkflowExecution.java
================================================
package io.temporal.samples.common;
import io.temporal.api.common.v1.WorkflowExecution;
import io.temporal.client.WorkflowClient;
import io.temporal.client.WorkflowStub;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.serviceclient.WorkflowServiceStubs;
import java.io.IOException;
import java.util.Optional;
/**
* Queries a workflow execution using the Temporal query API. Temporal redirects a query to any
* currently running workflow worker for the workflow type of the requested workflow execution.
*
* @author fateev
*/
public class QueryWorkflowExecution {
public static void main(String[] args) {
if (args.length < 2 || args.length > 3) {
System.err.println(
"Usage: java "
+ QueryWorkflowExecution.class.getName()
+ " <queryType> <workflowId> [<runId>]");
System.exit(1);
}
String queryType = args[0];
String workflowId = args[1];
String runId = args.length == 3 ? args[2] : "";
// gRPC stubs wrapper that talks to the local docker instance of temporal service.
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(profile.toWorkflowServiceStubsOptions());
WorkflowClient client = WorkflowClient.newInstance(service, profile.toWorkflowClientOptions());
WorkflowExecution workflowExecution =
WorkflowExecution.newBuilder().setWorkflowId(workflowId).setRunId(runId).build();
WorkflowStub workflow = client.newUntypedWorkflowStub(workflowExecution, Optional.empty());
String result = workflow.query(queryType, String.class);
System.out.println("Query result for " + workflowExecution + ":");
System.out.println(result);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/countinterceptor/ClientCounter.java
================================================
package io.temporal.samples.countinterceptor;
import java.util.AbstractMap;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/** Simple counter class. */
public class ClientCounter {
private static final String NUM_OF_GET_RESULT = "numOfGetResult";
private static final String NUM_OF_WORKFLOW_EXECUTIONS = "numOfWorkflowExec";
private static final String NUM_OF_SIGNALS = "numOfSignals";
private static final String NUM_OF_QUERIES = "numOfQueries";
private static final Map<String, Map<String, Integer>> perWorkflowIdMap =
Collections.synchronizedMap(new HashMap<>());
public String getInfo() {
StringBuilder stringBuilder = new StringBuilder();
for (String workflowRunId : perWorkflowIdMap.keySet()) {
stringBuilder.append("\n** Workflow ID: " + workflowRunId);
Map<String, Integer> info = perWorkflowIdMap.get(workflowRunId);
stringBuilder.append(
"\n\tTotal Number of Workflow Exec: " + info.get(NUM_OF_WORKFLOW_EXECUTIONS));
stringBuilder.append("\n\tTotal Number of Signals: " + info.get(NUM_OF_SIGNALS));
stringBuilder.append("\n\tTotal Number of Queries: " + info.get(NUM_OF_QUERIES));
stringBuilder.append("\n\tTotal Number of GetResult: " + info.get(NUM_OF_GET_RESULT));
}
return stringBuilder.toString();
}
private void add(String workflowId, String type) {
if (!perWorkflowIdMap.containsKey(workflowId)) {
perWorkflowIdMap.put(workflowId, getDefaultInfoMap());
}
if (perWorkflowIdMap.get(workflowId).get(type) == null) {
perWorkflowIdMap.get(workflowId).put(type, 1);
} else {
int current = perWorkflowIdMap.get(workflowId).get(type).intValue();
int next = current + 1;
perWorkflowIdMap.get(workflowId).put(type, next);
}
}
public int getNumOfWorkflowExecutions(String workflowId) {
return perWorkflowIdMap.get(workflowId).get(NUM_OF_WORKFLOW_EXECUTIONS);
}
public int getNumOfGetResults(String workflowId) {
return perWorkflowIdMap.get(workflowId).get(NUM_OF_GET_RESULT);
}
public int getNumOfSignals(String workflowId) {
return perWorkflowIdMap.get(workflowId).get(NUM_OF_SIGNALS);
}
public int getNumOfQueries(String workflowId) {
return perWorkflowIdMap.get(workflowId).get(NUM_OF_QUERIES);
}
/**
* Creates a default counter info map for a workflowid
*
* @return default counter info map
*/
private Map<String, Integer> getDefaultInfoMap() {
return Stream.of(
new AbstractMap.SimpleImmutableEntry<>(NUM_OF_WORKFLOW_EXECUTIONS, 0),
new AbstractMap.SimpleImmutableEntry<>(NUM_OF_SIGNALS, 0),
new AbstractMap.SimpleImmutableEntry<>(NUM_OF_GET_RESULT, 0),
new AbstractMap.SimpleImmutableEntry<>(NUM_OF_QUERIES, 0))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
}
public void addStartInvocation(String workflowId) {
add(workflowId, NUM_OF_WORKFLOW_EXECUTIONS);
}
public void addSignalInvocation(String workflowId) {
add(workflowId, NUM_OF_SIGNALS);
}
public void addGetResultInvocation(String workflowId) {
add(workflowId, NUM_OF_GET_RESULT);
}
public void addQueryInvocation(String workflowId) {
add(workflowId, NUM_OF_QUERIES);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/countinterceptor/InterceptorStarter.java
================================================
package io.temporal.samples.countinterceptor;
import io.temporal.client.WorkflowClient;
import io.temporal.client.WorkflowClientOptions;
import io.temporal.client.WorkflowOptions;
import io.temporal.client.WorkflowStub;
import io.temporal.common.interceptors.WorkflowClientInterceptor;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.samples.countinterceptor.activities.MyActivitiesImpl;
import io.temporal.samples.countinterceptor.workflow.MyChildWorkflowImpl;
import io.temporal.samples.countinterceptor.workflow.MyWorkflow;
import io.temporal.samples.countinterceptor.workflow.MyWorkflowImpl;
import io.temporal.serviceclient.WorkflowServiceStubs;
import io.temporal.worker.Worker;
import io.temporal.worker.WorkerFactory;
import io.temporal.worker.WorkerFactoryOptions;
import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class InterceptorStarter {
public static SimpleCountWorkerInterceptor workerInterceptor = new SimpleCountWorkerInterceptor();
private static final String TEST_QUEUE = "test-queue";
private static final String WORKFLOW_ID = "TestInterceptorWorkflow";
private static final Logger logger = LoggerFactory.getLogger(SimpleCountWorkerInterceptor.class);
public static void main(String[] args) {
final ClientCounter clientCounter = new ClientCounter();
final WorkflowClientInterceptor clientInterceptor = new SimpleClientInterceptor(clientCounter);
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(profile.toWorkflowServiceStubsOptions());
WorkflowClient client =
WorkflowClient.newInstance(
service, WorkflowClientOptions.newBuilder().setInterceptors(clientInterceptor).build());
WorkerFactoryOptions wfo =
WorkerFactoryOptions.newBuilder()
.setWorkerInterceptors(workerInterceptor)
.validateAndBuildWithDefaults();
WorkerFactory factory = WorkerFactory.newInstance(client, wfo);
Worker worker = factory.newWorker(TEST_QUEUE);
worker.registerWorkflowImplementationTypes(MyWorkflowImpl.class, MyChildWorkflowImpl.class);
worker.registerActivitiesImplementations(new MyActivitiesImpl());
factory.start();
WorkflowOptions workflowOptions =
WorkflowOptions.newBuilder().setWorkflowId(WORKFLOW_ID).setTaskQueue(TEST_QUEUE).build();
MyWorkflow workflow = client.newWorkflowStub(MyWorkflow.class, workflowOptions);
WorkflowClient.start(workflow::exec);
workflow.signalNameAndTitle("John", "Customer");
String name = workflow.queryName();
String title = workflow.queryTitle();
// Send exit signal to workflow
workflow.exit();
// Wait for workflow completion via WorkflowStub
WorkflowStub untyped = WorkflowStub.fromTyped(workflow);
String result = untyped.getResult(String.class);
// Print workflow
logger.info("Workflow Result: " + result);
// Print the Query results
logger.info("Query results: ");
logger.info("Name: " + name);
logger.info("Title: " + title);
// Print the Worker Counter Info
logger.info("Collected Worker Counter Info: ");
logger.info(WorkerCounter.getInfo());
// Print the Client Counter Info
logger.info("Collected Client Counter Info: ");
logger.info(clientCounter.getInfo());
System.exit(0);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/countinterceptor/README.md
================================================
# Demo Workflow Interceptor
The sample demonstrates:
- the use of a simple Worker Workflow Interceptor that counts the number of Workflow Executions, Child Workflow Executions, and Activity Executions as well as the number of Signals and Queries.
- the use of a simple Client Workflow Interceptor that counts the number of Workflow Executions as well as the number of Signals, Queries and GetResult invocations.
Run the following command to start the sample:
```bash
./gradlew -q execute -PmainClass=io.temporal.samples.countinterceptor.InterceptorStarter
```
================================================
FILE: core/src/main/java/io/temporal/samples/countinterceptor/SimpleClientCallsInterceptor.java
================================================
package io.temporal.samples.countinterceptor;
import io.temporal.common.interceptors.WorkflowClientCallsInterceptor;
import io.temporal.common.interceptors.WorkflowClientCallsInterceptorBase;
import java.util.concurrent.TimeoutException;
public class SimpleClientCallsInterceptor extends WorkflowClientCallsInterceptorBase {
private ClientCounter clientCounter;
public SimpleClientCallsInterceptor(
WorkflowClientCallsInterceptor next, ClientCounter clientCounter) {
super(next);
this.clientCounter = clientCounter;
}
@Override
public WorkflowStartOutput start(WorkflowStartInput input) {
clientCounter.addStartInvocation(input.getWorkflowId());
return super.start(input);
}
@Override
public WorkflowSignalOutput signal(WorkflowSignalInput input) {
clientCounter.addSignalInvocation(input.getWorkflowExecution().getWorkflowId());
return super.signal(input);
}
@Override
public <R> GetResultOutput<R> getResult(GetResultInput<R> input) throws TimeoutException {
clientCounter.addGetResultInvocation(input.getWorkflowExecution().getWorkflowId());
return super.getResult(input);
}
@Override
public <R> QueryOutput<R> query(QueryInput<R> input) {
clientCounter.addQueryInvocation(input.getWorkflowExecution().getWorkflowId());
return super.query(input);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/countinterceptor/SimpleClientInterceptor.java
================================================
package io.temporal.samples.countinterceptor;
import io.temporal.common.interceptors.WorkflowClientCallsInterceptor;
import io.temporal.common.interceptors.WorkflowClientInterceptorBase;
public class SimpleClientInterceptor extends WorkflowClientInterceptorBase {
private ClientCounter clientCounter;
public SimpleClientInterceptor(ClientCounter clientCounter) {
this.clientCounter = clientCounter;
}
@Override
public WorkflowClientCallsInterceptor workflowClientCallsInterceptor(
WorkflowClientCallsInterceptor next) {
return new SimpleClientCallsInterceptor(next, clientCounter);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/countinterceptor/SimpleCountActivityInboundCallsInterceptor.java
================================================
package io.temporal.samples.countinterceptor;
import io.temporal.activity.ActivityExecutionContext;
import io.temporal.common.interceptors.ActivityInboundCallsInterceptor;
import io.temporal.common.interceptors.ActivityInboundCallsInterceptorBase;
public class SimpleCountActivityInboundCallsInterceptor
extends ActivityInboundCallsInterceptorBase {
private ActivityExecutionContext activityExecutionContext;
public SimpleCountActivityInboundCallsInterceptor(ActivityInboundCallsInterceptor next) {
super(next);
}
@Override
public void init(ActivityExecutionContext context) {
this.activityExecutionContext = context;
super.init(context);
}
@Override
public ActivityOutput execute(ActivityInput input) {
WorkerCounter.add(
this.activityExecutionContext.getInfo().getWorkflowId(),
WorkerCounter.NUM_OF_ACTIVITY_EXECUTIONS);
return super.execute(input);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/countinterceptor/SimpleCountWorkerInterceptor.java
================================================
package io.temporal.samples.countinterceptor;
import io.temporal.common.interceptors.*;
public class SimpleCountWorkerInterceptor extends WorkerInterceptorBase {
@Override
public WorkflowInboundCallsInterceptor interceptWorkflow(WorkflowInboundCallsInterceptor next) {
return new SimpleCountWorkflowInboundCallsInterceptor(next);
}
@Override
public ActivityInboundCallsInterceptor interceptActivity(ActivityInboundCallsInterceptor next) {
return new SimpleCountActivityInboundCallsInterceptor(next);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/countinterceptor/SimpleCountWorkflowInboundCallsInterceptor.java
================================================
package io.temporal.samples.countinterceptor;
import io.temporal.common.interceptors.WorkflowInboundCallsInterceptor;
import io.temporal.common.interceptors.WorkflowInboundCallsInterceptorBase;
import io.temporal.common.interceptors.WorkflowOutboundCallsInterceptor;
import io.temporal.workflow.Workflow;
import io.temporal.workflow.WorkflowInfo;
public class SimpleCountWorkflowInboundCallsInterceptor
extends WorkflowInboundCallsInterceptorBase {
private WorkflowInfo workflowInfo;
public SimpleCountWorkflowInboundCallsInterceptor(WorkflowInboundCallsInterceptor next) {
super(next);
}
@Override
public void init(WorkflowOutboundCallsInterceptor outboundCalls) {
this.workflowInfo = Workflow.getInfo();
super.init(new SimpleCountWorkflowOutboundCallsInterceptor(outboundCalls));
}
@Override
public WorkflowOutput execute(WorkflowInput input) {
WorkerCounter.add(this.workflowInfo.getWorkflowId(), WorkerCounter.NUM_OF_WORKFLOW_EXECUTIONS);
return super.execute(input);
}
@Override
public void handleSignal(SignalInput input) {
WorkerCounter.add(this.workflowInfo.getWorkflowId(), WorkerCounter.NUM_OF_SIGNALS);
super.handleSignal(input);
}
@Override
public QueryOutput handleQuery(QueryInput input) {
WorkerCounter.add(this.workflowInfo.getWorkflowId(), WorkerCounter.NUM_OF_QUERIES);
return super.handleQuery(input);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/countinterceptor/SimpleCountWorkflowOutboundCallsInterceptor.java
================================================
package io.temporal.samples.countinterceptor;
import io.temporal.common.interceptors.WorkflowOutboundCallsInterceptor;
import io.temporal.common.interceptors.WorkflowOutboundCallsInterceptorBase;
import io.temporal.workflow.Workflow;
public class SimpleCountWorkflowOutboundCallsInterceptor
extends WorkflowOutboundCallsInterceptorBase {
public SimpleCountWorkflowOutboundCallsInterceptor(WorkflowOutboundCallsInterceptor next) {
super(next);
}
@Override
public <R> ChildWorkflowOutput<R> executeChildWorkflow(ChildWorkflowInput<R> input) {
WorkerCounter.add(
Workflow.getInfo().getWorkflowId(), WorkerCounter.NUM_OF_CHILD_WORKFLOW_EXECUTIONS);
return super.executeChildWorkflow(input);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/countinterceptor/WorkerCounter.java
================================================
package io.temporal.samples.countinterceptor;
import java.util.AbstractMap;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* Simple counter class. Static impl just for the sake of the sample. Note: in your applications you
* should use CDI for example instead.
*/
public class WorkerCounter {
private static Map<String, Map<String, Integer>> perWorkflowIdMap =
Collections.synchronizedMap(new HashMap<>());
public static final String NUM_OF_WORKFLOW_EXECUTIONS = "numOfWorkflowExec";
public static final String NUM_OF_CHILD_WORKFLOW_EXECUTIONS = "numOfChildWorkflowExec";
public static final String NUM_OF_ACTIVITY_EXECUTIONS = "numOfActivityExec";
public static final String NUM_OF_SIGNALS = "numOfSignals";
public static final String NUM_OF_QUERIES = "numOfQueries";
public static void add(String workflowId, String type) {
if (!perWorkflowIdMap.containsKey(workflowId)) {
perWorkflowIdMap.put(workflowId, getDefaultInfoMap());
}
if (perWorkflowIdMap.get(workflowId).get(type) == null) {
perWorkflowIdMap.get(workflowId).put(type, 1);
} else {
int current = perWorkflowIdMap.get(workflowId).get(type).intValue();
int next = current + 1;
perWorkflowIdMap.get(workflowId).put(type, next);
}
}
public static int getNumOfWorkflowExecutions(String workflowId) {
return perWorkflowIdMap.get(workflowId).get(NUM_OF_WORKFLOW_EXECUTIONS);
}
public static int getNumOfChildWorkflowExecutions(String workflowId) {
return perWorkflowIdMap.get(workflowId).get(NUM_OF_CHILD_WORKFLOW_EXECUTIONS);
}
public static int getNumOfActivityExecutions(String workflowId) {
return perWorkflowIdMap.get(workflowId).get(NUM_OF_ACTIVITY_EXECUTIONS);
}
public static int getNumOfSignals(String workflowId) {
return perWorkflowIdMap.get(workflowId).get(NUM_OF_SIGNALS);
}
public static int getNumOfQueries(String workflowId) {
return perWorkflowIdMap.get(workflowId).get(NUM_OF_QUERIES);
}
public static String getInfo() {
StringBuilder stringBuilder = new StringBuilder();
for (String workflowRunId : perWorkflowIdMap.keySet()) {
stringBuilder.append("\n** Workflow ID: " + workflowRunId);
Map<String, Integer> info = perWorkflowIdMap.get(workflowRunId);
stringBuilder.append(
"\n\tTotal Number of Workflow Exec: " + info.get(NUM_OF_WORKFLOW_EXECUTIONS));
stringBuilder.append(
"\n\tTotal Number of Child Workflow Exec: " + info.get(NUM_OF_CHILD_WORKFLOW_EXECUTIONS));
stringBuilder.append(
"\n\tTotal Number of Activity Exec: " + info.get(NUM_OF_ACTIVITY_EXECUTIONS));
stringBuilder.append("\n\tTotal Number of Signals: " + info.get(NUM_OF_SIGNALS));
stringBuilder.append("\n\tTotal Number of Queries: " + info.get(NUM_OF_QUERIES));
}
return stringBuilder.toString();
}
/**
* Creates a default counter info map for a workflowid
*
* @return default counter info map
*/
private static Map<String, Integer> getDefaultInfoMap() {
return Stream.of(
new AbstractMap.SimpleImmutableEntry<>(NUM_OF_WORKFLOW_EXECUTIONS, 0),
new AbstractMap.SimpleImmutableEntry<>(NUM_OF_CHILD_WORKFLOW_EXECUTIONS, 0),
new AbstractMap.SimpleImmutableEntry<>(NUM_OF_ACTIVITY_EXECUTIONS, 0),
new AbstractMap.SimpleImmutableEntry<>(NUM_OF_SIGNALS, 0),
new AbstractMap.SimpleImmutableEntry<>(NUM_OF_QUERIES, 0))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/countinterceptor/activities/MyActivities.java
================================================
package io.temporal.samples.countinterceptor.activities;
import io.temporal.activity.ActivityInterface;
@ActivityInterface
public interface MyActivities {
String sayHello(String name, String title);
String sayGoodBye(String name, String title);
}
================================================
FILE: core/src/main/java/io/temporal/samples/countinterceptor/activities/MyActivitiesImpl.java
================================================
package io.temporal.samples.countinterceptor.activities;
public class MyActivitiesImpl implements MyActivities {
@Override
public String sayHello(String name, String title) {
return "Hello " + title + " " + name;
}
@Override
public String sayGoodBye(String name, String title) {
return "Goodbye " + title + " " + name;
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/countinterceptor/workflow/MyChildWorkflow.java
================================================
package io.temporal.samples.countinterceptor.workflow;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
@WorkflowInterface
public interface MyChildWorkflow {
@WorkflowMethod
String execChild(String name, String title);
}
================================================
FILE: core/src/main/java/io/temporal/samples/countinterceptor/workflow/MyChildWorkflowImpl.java
================================================
package io.temporal.samples.countinterceptor.workflow;
import io.temporal.activity.ActivityOptions;
import io.temporal.samples.countinterceptor.activities.MyActivities;
import io.temporal.workflow.Workflow;
import java.time.Duration;
public class MyChildWorkflowImpl implements MyChildWorkflow {
@Override
public String execChild(String name, String title) {
MyActivities activities =
Workflow.newActivityStub(
MyActivities.class,
ActivityOptions.newBuilder().setStartToCloseTimeout(Duration.ofSeconds(10)).build());
String result = activities.sayHello(name, title);
result += activities.sayGoodBye(name, title);
return result;
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/countinterceptor/workflow/MyWorkflow.java
================================================
package io.temporal.samples.countinterceptor.workflow;
import io.temporal.workflow.QueryMethod;
import io.temporal.workflow.SignalMethod;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
@WorkflowInterface
public interface MyWorkflow {
@WorkflowMethod
String exec();
@SignalMethod
void signalNameAndTitle(String greeting, String title);
@SignalMethod
void exit();
@QueryMethod
String queryName();
@QueryMethod
String queryTitle();
}
================================================
FILE: core/src/main/java/io/temporal/samples/countinterceptor/workflow/MyWorkflowImpl.java
================================================
package io.temporal.samples.countinterceptor.workflow;
import io.temporal.workflow.ChildWorkflowOptions;
import io.temporal.workflow.Workflow;
import java.time.Duration;
public class MyWorkflowImpl implements MyWorkflow {
private String name;
private String title;
private boolean exit = false;
@Override
public String exec() {
// Wait for a greeting info
Workflow.await(() -> name != null && title != null);
// Execute child workflow
ChildWorkflowOptions childWorkflowOptions =
ChildWorkflowOptions.newBuilder().setWorkflowId("TestInterceptorChildWorkflow").build();
MyChildWorkflow child =
Workflow.newChildWorkflowStub(MyChildWorkflow.class, childWorkflowOptions);
String result = child.execChild(name, title);
// Wait for exit signal
Workflow.await(Duration.ofSeconds(5), () -> exit != false);
return result;
}
@Override
public void signalNameAndTitle(String name, String title) {
this.name = name;
this.title = title;
}
@Override
public String queryName() {
return name;
}
@Override
public String queryTitle() {
return title;
}
@Override
public void exit() {
this.exit = true;
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/customannotation/BenignExceptionTypes.java
================================================
package io.temporal.samples.customannotation;
import java.lang.annotation.*;
/**
* BenignExceptionTypes is an annotation that can be used to specify an exception type is benign and
* not an issue worth logging.
*
* <p>For this annotation to work, {@link BenignExceptionTypesAnnotationInterceptor} must be passed
* as a worker interceptor to the worker factory.
*/
@Documented
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface BenignExceptionTypes {
/** Type of exceptions that should be considered benign and not logged as errors. */
Class<? extends Exception>[] value();
}
================================================
FILE: core/src/main/java/io/temporal/samples/customannotation/BenignExceptionTypesAnnotationInterceptor.java
================================================
/*
* Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved
*
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Modifications copyright (C) 2017 Uber Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. A copy of the License is
* located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package io.temporal.samples.customannotation;
import io.temporal.activity.ActivityExecutionContext;
import io.temporal.common.interceptors.ActivityInboundCallsInterceptor;
import io.temporal.common.interceptors.WorkerInterceptorBase;
import io.temporal.common.metadata.POJOActivityImplMetadata;
import io.temporal.common.metadata.POJOActivityMethodMetadata;
import io.temporal.failure.ApplicationErrorCategory;
import io.temporal.failure.ApplicationFailure;
import io.temporal.failure.TemporalFailure;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* Checks if the activity method has the {@link BenignExceptionTypes} annotation. If it does, it
* will throw an ApplicationFailure with {@link ApplicationErrorCategory#BENIGN}.
*/
public class BenignExceptionTypesAnnotationInterceptor extends WorkerInterceptorBase {
@Override
public ActivityInboundCallsInterceptor interceptActivity(ActivityInboundCallsInterceptor next) {
return new ActivityInboundCallsInterceptorAnnotation(next);
}
public static class ActivityInboundCallsInterceptorAnnotation
extends io.temporal.common.interceptors.ActivityInboundCallsInterceptorBase {
private final ActivityInboundCallsInterceptor next;
private Set<Class<? extends Exception>> benignExceptionTypes = new HashSet<>();
public ActivityInboundCallsInterceptorAnnotation(ActivityInboundCallsInterceptor next) {
super(next);
this.next = next;
}
@Override
public void init(ActivityExecutionContext context) {
List<POJOActivityMethodMetadata> activityMethods =
POJOActivityImplMetadata.newInstance(context.getInstance().getClass())
.getActivityMethods();
POJOActivityMethodMetadata currentActivityMethod =
activityMethods.stream()
.filter(x -> x.getActivityTypeName().equals(context.getInfo().getActivityType()))
.findFirst()
.get();
// Get the implementation method from the interface method
Method implementationMethod;
try {
implementationMethod =
context
.getInstance()
.getClass()
.getMethod(
currentActivityMethod.getMethod().getName(),
currentActivityMethod.getMethod().getParameterTypes());
} catch (NoSuchMethodException e) {
throw new RuntimeException(e);
}
// Get the @BenignExceptionTypes annotations from the implementation method
BenignExceptionTypes an = implementationMethod.getAnnotation(BenignExceptionTypes.class);
if (an != null && an.value() != null) {
benignExceptionTypes = new HashSet<>(Arrays.asList(an.value()));
}
next.init(context);
}
@Override
public ActivityOutput execute(ActivityInput input) {
if (benignExceptionTypes.isEmpty()) {
return next.execute(input);
}
try {
return next.execute(input);
} catch (TemporalFailure tf) {
throw tf;
} catch (Exception e) {
if (benignExceptionTypes.contains(e.getClass())) {
// If the exception is in the list of benign exceptions, throw an ApplicationFailure
// with a BENIGN category
throw ApplicationFailure.newBuilder()
.setMessage(e.getMessage())
.setType(e.getClass().getName())
.setCause(e)
.setCategory(ApplicationErrorCategory.BENIGN)
.build();
}
// If the exception is not in the list of benign exceptions, rethrow it
throw e;
}
}
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/customannotation/CustomAnnotation.java
================================================
/*
* Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved
*
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Modifications copyright (C) 2017 Uber Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. A copy of the License is
* located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package io.temporal.samples.customannotation;
import io.temporal.activity.ActivityInterface;
import io.temporal.activity.ActivityMethod;
import io.temporal.activity.ActivityOptions;
import io.temporal.client.WorkflowClient;
import io.temporal.client.WorkflowOptions;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.serviceclient.WorkflowServiceStubs;
import io.temporal.worker.Worker;
import io.temporal.worker.WorkerFactory;
import io.temporal.worker.WorkerFactoryOptions;
import io.temporal.workflow.Workflow;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
import java.io.IOException;
import java.time.Duration;
public class CustomAnnotation {
// Define the task queue name
static final String TASK_QUEUE = "CustomAnnotationTaskQueue";
// Define our workflow unique id
static final String WORKFLOW_ID = "CustomAnnotationWorkflow";
/**
* The Workflow Definition's Interface must contain one method annotated with @WorkflowMethod.
*
* <p>Workflow Definitions should not contain any heavyweight computations, non-deterministic
* code, network calls, database operations, etc. Those things should be handled by the
* Activities.
*
* @see WorkflowInterface
* @see WorkflowMethod
*/
@WorkflowInterface
public interface GreetingWorkflow {
/**
* This is the method that is executed when the Workflow Execution is started. The Workflow
* Execution completes when this method finishes execution.
*/
@WorkflowMethod
String getGreeting(String name);
}
/**
* This is the Activity Definition's Interface. Activities are building blocks of any Temporal
* Workflow and contain any business logic that could perform long running computation, network
* calls, etc.
*
* <p>Annotating Activity Definition methods with @ActivityMethod is optional.
*
* @see ActivityInterface
* @see ActivityMethod
*/
@ActivityInterface
public interface GreetingActivities {
/** Define your activity method which can be called during workflow execution */
String composeGreeting(String greeting, String name);
}
// Define the workflow implementation which implements our getGreeting workflow method.
public static class GreetingWorkflowImpl implements GreetingWorkflow {
/**
* Define the GreetingActivities stub. Activity stubs are proxies for activity invocations that
* are executed outside of the workflow thread on the activity worker, that can be on a
* different host. Temporal is going to dispatch the activity results back to the workflow and
* unblock the stub as soon as activity is completed on the activity worker.
*/
private final GreetingActivities activities =
Workflow.newActivityStub(
GreetingActivities.class,
ActivityOptions.newBuilder().setStartToCloseTimeout(Duration.ofSeconds(10)).build());
@Override
public String getGreeting(String name) {
// This is a blocking call that returns only after activity is completed.
return activities.composeGreeting("Hello", name);
}
}
/**
* Implementation of our workflow activity interface. It overwrites our defined composeGreeting
* activity method.
*/
static class GreetingActivitiesImpl implements GreetingActivities {
private int callCount;
/**
* Our activity implementation simulates a failure 3 times. Given our previously set
* RetryOptions, our workflow is going to retry our activity execution.
*/
@Override
@BenignExceptionTypes({IllegalStateException.class})
public synchronized String composeGreeting(String greeting, String name) {
if (++callCount < 4) {
System.out.println("composeGreeting activity is going to fail");
throw new IllegalStateException("not yet");
}
// after 3 unsuccessful retries we finally can complete our activity execution
System.out.println("composeGreeting activity is going to complete");
return greeting + " " + name + "!";
}
}
/**
* With our Workflow and Activities defined, we can now start execution. The main method starts
* the worker and then the workflow.
*/
public static void main(String[] args) {
// Get a Workflow service stub.
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(profile.toWorkflowServiceStubsOptions());
/*
* Get a Workflow service client which can be used to start, Signal, and Query Workflow Executions.
*/
WorkflowClient client = WorkflowClient.newInstance(service, profile.toWorkflowClientOptions());
/*
* Define the workflow factory. It is used to create workflow workers for a specific task queue.
*/
WorkerFactory factory =
WorkerFactory.newInstance(
client,
WorkerFactoryOptions.newBuilder()
.setWorkerInterceptors(new BenignExceptionTypesAnnotationInterceptor())
.build());
/*
* Define the workflow worker. Workflow workers listen to a defined task queue and process
* workflows and activities.
*/
Worker worker = factory.newWorker(TASK_QUEUE);
/*
* Register our workflow implementation with the worker.
* Workflow implementations must be known to the worker at runtime in
* order to dispatch workflow tasks.
*/
worker.registerWorkflowImplementationTypes(GreetingWorkflowImpl.class);
/*
* Register our Activity Types with the Worker. Since Activities are stateless and thread-safe,
* the Activity Type is a shared instance.
*/
worker.registerActivitiesImplementations(new GreetingActivitiesImpl());
/*
* Start all the workers registered for a specific task queue.
* The started workers then start polling for workflows and activities.
*/
factory.start();
// Set our workflow options
WorkflowOptions workflowOptions =
WorkflowOptions.newBuilder().setWorkflowId(WORKFLOW_ID).setTaskQueue(TASK_QUEUE).build();
// Create the workflow client stub. It is used to start our workflow execution.
GreetingWorkflow workflow = client.newWorkflowStub(GreetingWorkflow.class, workflowOptions);
/*
* Execute our workflow and wait for it to complete. The call to our getGreeting method is
* synchronous.
*
* See {@link io.temporal.samples.hello.HelloSignal} for an example of starting workflow
* without waiting synchronously for its result.
*/
String greeting = workflow.getGreeting("World");
// Display workflow execution results
System.out.println(greeting);
System.exit(0);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/customannotation/README.md
================================================
# Custom annotation
The sample demonstrates how to create a custom annotation using an interceptor. In this case the annotation allows specifying an exception of a certain type is benign.
This samples shows a custom annotation on an activity method, but the same approach can be used for workflow methods or Nexus operations.
```bash
./gradlew -q execute -PmainClass=io.temporal.samples.customannotation.CustomAnnotation
```
================================================
FILE: core/src/main/java/io/temporal/samples/customchangeversion/CustomChangeVersionActivities.java
================================================
package io.temporal.samples.customchangeversion;
import io.temporal.activity.ActivityInterface;
@ActivityInterface
public interface CustomChangeVersionActivities {
String customOne(String input);
String customTwo(String input);
String customThree(String input);
}
================================================
FILE: core/src/main/java/io/temporal/samples/customchangeversion/CustomChangeVersionActivitiesImpl.java
================================================
package io.temporal.samples.customchangeversion;
public class CustomChangeVersionActivitiesImpl implements CustomChangeVersionActivities {
@Override
public String customOne(String input) {
return "\ncustomOne activity - " + input;
}
@Override
public String customTwo(String input) {
return "\ncustomTwo activity - " + input;
}
@Override
public String customThree(String input) {
return "\ncustomThree activity - " + input;
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/customchangeversion/CustomChangeVersionStarter.java
================================================
package io.temporal.samples.customchangeversion;
import io.grpc.StatusRuntimeException;
import io.temporal.api.enums.v1.IndexedValueType;
import io.temporal.api.operatorservice.v1.AddSearchAttributesRequest;
import io.temporal.client.WorkflowClient;
import io.temporal.client.WorkflowOptions;
import io.temporal.client.WorkflowServiceException;
import io.temporal.common.SearchAttributeKey;
import io.temporal.common.SearchAttributes;
import io.temporal.envconfig.ClientConfigProfile;
import io.temporal.serviceclient.OperatorServiceStubs;
import io.temporal.serviceclient.OperatorServiceStubsOptions;
import io.temporal.serviceclient.WorkflowServiceStubs;
import io.temporal.worker.Worker;
import io.temporal.worker.WorkerFactory;
import java.io.IOException;
import java.util.Collections;
public class CustomChangeVersionStarter {
private static SearchAttributeKey<String> CUSTOM_CHANGE_VERSION =
SearchAttributeKey.forKeyword("CustomChangeVersion");
private static final String taskQueue = "customChangeVersionTaskQueue";
private static final String workflowId = "CustomChangeVersionWorkflow";
public static void main(String[] args) {
// Load configuration from environment and files
ClientConfigProfile profile;
try {
profile = ClientConfigProfile.load();
} catch (IOException e) {
throw new RuntimeException("Failed to load client configuration", e);
}
WorkflowServiceStubs service =
WorkflowServiceStubs.newServiceStubs(profile.toWorkflowServiceStubsOptions());
WorkflowClient client = WorkflowClient.newInstance(service, profile.toWorkflowClientOptions());
WorkerFactory workerFactory = WorkerFactory.newInstance(client);
Worker worker = workerFactory.newWorker(taskQueue);
// Register CustomChangeVersion search attribute thats used in this sample
OperatorServiceStubs operatorService =
OperatorServiceStubs.newServiceStubs(
OperatorServiceStubsOptions.newBuilder()
.setChannel(service.getRawChannel())
.validateAndBuildWithDefaults());
operatorService
.blockingStub()
.addSearchAttributes(
AddSearchAttributesRequest.newBuilder()
.setNamespace(client.getOptions().getNamespace())
.putAllSearchAttributes(
Collections.singletonMap(
"CustomChangeVersion", IndexedValueType.INDEXED_VALUE_TYPE_KEYWORD))
.build());
// Register workflow and activities
worker.registerWorkflowImplementationTypes(CustomChangeVersionWorkflowImpl.class);
worker.registerActivitiesImplementations(new CustomChangeVersionActivitiesImpl());
workerFactory.start();
CustomChangeVersionWorkflow workflow =
client.newWorkflowStub(
CustomChangeVersionWorkflow.class,
WorkflowOptions.newBuilder()
.setTaskQueue(taskQueue)
.setWorkflowId(workflowId)
.setTypedSearchAttributes(
SearchAttributes.newBuilder().set(CUSTOM_CHANGE_VERSION, "").build())
.build());
try {
String result = workflow.run("Hello");
System.out.println("Result: " + result);
} catch (WorkflowServiceException e) {
if (e.getCause() instanceof StatusRuntimeException) {
StatusRuntimeException sre = (StatusRuntimeException) e.getCause();
System.out.println(
"Error starting workflow execution: "
+ sre.getMessage()
+ " Status: "
+ sre.getStatus());
} else {
System.out.println("Error starting workflow execution: " + e.getMessage());
}
}
System.exit(0);
}
}
================================================
FILE: core/src/main/java/io/temporal/samples/customchangeversion/CustomChangeVersionWorkflow.java
================================================
package io.temporal.samples.customchangeversion;
import io.temporal.workflow.WorkflowInterface;
import io.temporal.workflow.WorkflowMethod;
@WorkflowInterface
public interface CustomChangeVersionWorkflow {
@WorkflowMethod
String run(String input);
}
================================================
FILE: core/src/main/java/io/temporal/samples/customchangeversion/CustomChangeVersionWorkflowImpl.java
================================================
package io.temporal.samples.customchangeversion;
import io.temporal.activity.ActivityOptions;
import io.temporal.common.SearchAttributeKey;
import io.temporal.workflow.Workflow;
import java.time.Duration;
/**
* CustomChangeVersionWorkflow
gitextract_xaqm8zrf/
├── .github/
│ ├── CODEOWNERS
│ ├── dependabot.yml
│ └── workflows/
│ └── ci.yml
├── .gitignore
├── LICENSE
├── README.md
├── build.gradle
├── core/
│ ├── build.gradle
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── io/
│ │ │ └── temporal/
│ │ │ └── samples/
│ │ │ ├── apikey/
│ │ │ │ ├── ApiKeyWorker.java
│ │ │ │ ├── MyWorkflow.java
│ │ │ │ ├── MyWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── Starter.java
│ │ │ ├── asyncchild/
│ │ │ │ ├── ChildWorkflow.java
│ │ │ │ ├── ChildWorkflowImpl.java
│ │ │ │ ├── ParentWorkflow.java
│ │ │ │ ├── ParentWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── Starter.java
│ │ │ ├── asyncuntypedchild/
│ │ │ │ ├── ChildWorkflow.java
│ │ │ │ ├── ChildWorkflowImpl.java
│ │ │ │ ├── ParentWorkflow.java
│ │ │ │ ├── ParentWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── Starter.java
│ │ │ ├── autoheartbeat/
│ │ │ │ ├── AutoHeartbeatUtil.java
│ │ │ │ ├── README.md
│ │ │ │ ├── Starter.java
│ │ │ │ ├── activities/
│ │ │ │ │ ├── AutoActivities.java
│ │ │ │ │ └── AutoActivitiesImpl.java
│ │ │ │ ├── interceptor/
│ │ │ │ │ ├── AutoHeartbeatActivityInboundCallsInterceptor.java
│ │ │ │ │ └── AutoHeartbeatWorkerInterceptor.java
│ │ │ │ └── workflows/
│ │ │ │ ├── AutoWorkflow.java
│ │ │ │ └── AutoWorkflowImpl.java
│ │ │ ├── batch/
│ │ │ │ ├── heartbeatingactivity/
│ │ │ │ │ ├── HeartbeatingActivityBatchStarter.java
│ │ │ │ │ ├── HeartbeatingActivityBatchWorker.java
│ │ │ │ │ ├── HeartbeatingActivityBatchWorkflow.java
│ │ │ │ │ ├── HeartbeatingActivityBatchWorkflowImpl.java
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── RecordLoader.java
│ │ │ │ │ ├── RecordLoaderImpl.java
│ │ │ │ │ ├── RecordProcessor.java
│ │ │ │ │ ├── RecordProcessorActivity.java
│ │ │ │ │ ├── RecordProcessorActivityImpl.java
│ │ │ │ │ ├── RecordProcessorImpl.java
│ │ │ │ │ └── SingleRecord.java
│ │ │ │ ├── iterator/
│ │ │ │ │ ├── IteratorBatchStarter.java
│ │ │ │ │ ├── IteratorBatchWorker.java
│ │ │ │ │ ├── IteratorBatchWorkflow.java
│ │ │ │ │ ├── IteratorBatchWorkflowImpl.java
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── RecordLoader.java
│ │ │ │ │ ├── RecordLoaderImpl.java
│ │ │ │ │ ├── RecordProcessorWorkflow.java
│ │ │ │ │ ├── RecordProcessorWorkflowImpl.java
│ │ │ │ │ └── SingleRecord.java
│ │ │ │ └── slidingwindow/
│ │ │ │ ├── BatchProgress.java
│ │ │ │ ├── BatchWorkflow.java
│ │ │ │ ├── BatchWorkflowImpl.java
│ │ │ │ ├── ProcessBatchInput.java
│ │ │ │ ├── README.md
│ │ │ │ ├── RecordIterable.java
│ │ │ │ ├── RecordLoader.java
│ │ │ │ ├── RecordLoaderImpl.java
│ │ │ │ ├── RecordProcessorWorkflow.java
│ │ │ │ ├── RecordProcessorWorkflowImpl.java
│ │ │ │ ├── SingleRecord.java
│ │ │ │ ├── SlidingWindowBatchStarter.java
│ │ │ │ ├── SlidingWindowBatchWorker.java
│ │ │ │ ├── SlidingWindowBatchWorkflow.java
│ │ │ │ └── SlidingWindowBatchWorkflowImpl.java
│ │ │ ├── bookingsaga/
│ │ │ │ ├── Booking.java
│ │ │ │ ├── README.md
│ │ │ │ ├── TripBookingActivities.java
│ │ │ │ ├── TripBookingActivitiesImpl.java
│ │ │ │ ├── TripBookingClient.java
│ │ │ │ ├── TripBookingWorker.java
│ │ │ │ ├── TripBookingWorkflow.java
│ │ │ │ └── TripBookingWorkflowImpl.java
│ │ │ ├── bookingsyncsaga/
│ │ │ │ ├── Booking.java
│ │ │ │ ├── README.md
│ │ │ │ ├── TripBookingActivities.java
│ │ │ │ ├── TripBookingActivitiesImpl.java
│ │ │ │ ├── TripBookingClient.java
│ │ │ │ ├── TripBookingWorker.java
│ │ │ │ ├── TripBookingWorkflow.java
│ │ │ │ └── TripBookingWorkflowImpl.java
│ │ │ ├── common/
│ │ │ │ └── QueryWorkflowExecution.java
│ │ │ ├── countinterceptor/
│ │ │ │ ├── ClientCounter.java
│ │ │ │ ├── InterceptorStarter.java
│ │ │ │ ├── README.md
│ │ │ │ ├── SimpleClientCallsInterceptor.java
│ │ │ │ ├── SimpleClientInterceptor.java
│ │ │ │ ├── SimpleCountActivityInboundCallsInterceptor.java
│ │ │ │ ├── SimpleCountWorkerInterceptor.java
│ │ │ │ ├── SimpleCountWorkflowInboundCallsInterceptor.java
│ │ │ │ ├── SimpleCountWorkflowOutboundCallsInterceptor.java
│ │ │ │ ├── WorkerCounter.java
│ │ │ │ ├── activities/
│ │ │ │ │ ├── MyActivities.java
│ │ │ │ │ └── MyActivitiesImpl.java
│ │ │ │ └── workflow/
│ │ │ │ ├── MyChildWorkflow.java
│ │ │ │ ├── MyChildWorkflowImpl.java
│ │ │ │ ├── MyWorkflow.java
│ │ │ │ └── MyWorkflowImpl.java
│ │ │ ├── customannotation/
│ │ │ │ ├── BenignExceptionTypes.java
│ │ │ │ ├── BenignExceptionTypesAnnotationInterceptor.java
│ │ │ │ ├── CustomAnnotation.java
│ │ │ │ └── README.md
│ │ │ ├── customchangeversion/
│ │ │ │ ├── CustomChangeVersionActivities.java
│ │ │ │ ├── CustomChangeVersionActivitiesImpl.java
│ │ │ │ ├── CustomChangeVersionStarter.java
│ │ │ │ ├── CustomChangeVersionWorkflow.java
│ │ │ │ ├── CustomChangeVersionWorkflowImpl.java
│ │ │ │ └── README.md
│ │ │ ├── dsl/
│ │ │ │ ├── DslActivities.java
│ │ │ │ ├── DslActivitiesImpl.java
│ │ │ │ ├── DslWorkflow.java
│ │ │ │ ├── DslWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ ├── Starter.java
│ │ │ │ └── model/
│ │ │ │ ├── Flow.java
│ │ │ │ └── FlowAction.java
│ │ │ ├── earlyreturn/
│ │ │ │ ├── EarlyReturnClient.java
│ │ │ │ ├── EarlyReturnWorker.java
│ │ │ │ ├── README.md
│ │ │ │ ├── Transaction.java
│ │ │ │ ├── TransactionActivities.java
│ │ │ │ ├── TransactionActivitiesImpl.java
│ │ │ │ ├── TransactionRequest.java
│ │ │ │ ├── TransactionWorkflow.java
│ │ │ │ ├── TransactionWorkflowImpl.java
│ │ │ │ └── TxResult.java
│ │ │ ├── encodefailures/
│ │ │ │ ├── CustomerAgeCheck.java
│ │ │ │ ├── CustomerAgeCheckImpl.java
│ │ │ │ ├── InvalidCustomerException.java
│ │ │ │ ├── MyCustomer.java
│ │ │ │ ├── README.md
│ │ │ │ ├── SimplePrefixPayloadCodec.java
│ │ │ │ └── Starter.java
│ │ │ ├── encryptedpayloads/
│ │ │ │ ├── CryptCodec.java
│ │ │ │ └── EncryptedPayloadsActivity.java
│ │ │ ├── envconfig/
│ │ │ │ ├── LoadFromFile.java
│ │ │ │ ├── LoadProfile.java
│ │ │ │ └── README.md
│ │ │ ├── excludefrominterceptor/
│ │ │ │ ├── README.md
│ │ │ │ ├── RunMyWorkflows.java
│ │ │ │ ├── activities/
│ │ │ │ │ ├── ForInterceptorActivities.java
│ │ │ │ │ ├── ForInterceptorActivitiesImpl.java
│ │ │ │ │ ├── MyActivities.java
│ │ │ │ │ └── MyActivitiesImpl.java
│ │ │ │ ├── interceptor/
│ │ │ │ │ ├── MyActivityInboundCallsInterceptor.java
│ │ │ │ │ ├── MyWorkerInterceptor.java
│ │ │ │ │ ├── MyWorkflowInboundCallsInterceptor.java
│ │ │ │ │ └── MyWorkflowOutboundCallsInterceptor.java
│ │ │ │ └── workflows/
│ │ │ │ ├── MyWorkflow.java
│ │ │ │ ├── MyWorkflowOne.java
│ │ │ │ ├── MyWorkflowOneImpl.java
│ │ │ │ ├── MyWorkflowTwo.java
│ │ │ │ └── MyWorkflowTwoImpl.java
│ │ │ ├── fileprocessing/
│ │ │ │ ├── FileProcessingStarter.java
│ │ │ │ ├── FileProcessingWorker.java
│ │ │ │ ├── FileProcessingWorkflow.java
│ │ │ │ ├── FileProcessingWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ ├── StoreActivities.java
│ │ │ │ └── StoreActivitiesImpl.java
│ │ │ ├── getresultsasync/
│ │ │ │ ├── MyWorkflow.java
│ │ │ │ ├── MyWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ ├── Starter.java
│ │ │ │ └── Worker.java
│ │ │ ├── hello/
│ │ │ │ ├── HelloAccumulator.java
│ │ │ │ ├── HelloActivity.java
│ │ │ │ ├── HelloActivityExclusiveChoice.java
│ │ │ │ ├── HelloActivityRetry.java
│ │ │ │ ├── HelloAsync.java
│ │ │ │ ├── HelloAsyncActivityCompletion.java
│ │ │ │ ├── HelloAsyncLambda.java
│ │ │ │ ├── HelloAwait.java
│ │ │ │ ├── HelloCancellationScope.java
│ │ │ │ ├── HelloCancellationScopeWithTimer.java
│ │ │ │ ├── HelloChild.java
│ │ │ │ ├── HelloCron.java
│ │ │ │ ├── HelloDelayedStart.java
│ │ │ │ ├── HelloDetachedCancellationScope.java
│ │ │ │ ├── HelloDynamic.java
│ │ │ │ ├── HelloEagerWorkflowStart.java
│ │ │ │ ├── HelloException.java
│ │ │ │ ├── HelloLocalActivity.java
│ │ │ │ ├── HelloParallelActivity.java
│ │ │ │ ├── HelloPeriodic.java
│ │ │ │ ├── HelloPolymorphicActivity.java
│ │ │ │ ├── HelloQuery.java
│ │ │ │ ├── HelloSaga.java
│ │ │ │ ├── HelloSchedules.java
│ │ │ │ ├── HelloSearchAttributes.java
│ │ │ │ ├── HelloSideEffect.java
│ │ │ │ ├── HelloSignal.java
│ │ │ │ ├── HelloSignalWithStartAndWorkflowInit.java
│ │ │ │ ├── HelloSignalWithTimer.java
│ │ │ │ ├── HelloStandaloneActivity.java
│ │ │ │ ├── HelloTypedSearchAttributes.java
│ │ │ │ ├── HelloUpdate.java
│ │ │ │ ├── HelloWorkflowTimer.java
│ │ │ │ └── README.md
│ │ │ ├── keymanagementencryption/
│ │ │ │ └── awsencryptionsdk/
│ │ │ │ ├── EncryptedPayloads.java
│ │ │ │ ├── KeyringCodec.java
│ │ │ │ └── README.md
│ │ │ ├── listworkflows/
│ │ │ │ ├── Customer.java
│ │ │ │ ├── CustomerActivities.java
│ │ │ │ ├── CustomerActivitiesImpl.java
│ │ │ │ ├── CustomerWorkflow.java
│ │ │ │ ├── CustomerWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── Starter.java
│ │ │ ├── metrics/
│ │ │ │ ├── MetricsStarter.java
│ │ │ │ ├── MetricsUtils.java
│ │ │ │ ├── MetricsWorker.java
│ │ │ │ ├── README.md
│ │ │ │ ├── activities/
│ │ │ │ │ ├── MetricsActivities.java
│ │ │ │ │ └── MetricsActivitiesImpl.java
│ │ │ │ └── workflow/
│ │ │ │ ├── MetricsWorkflow.java
│ │ │ │ └── MetricsWorkflowImpl.java
│ │ │ ├── moneybatch/
│ │ │ │ ├── Account.java
│ │ │ │ ├── AccountActivityWorker.java
│ │ │ │ ├── AccountImpl.java
│ │ │ │ ├── AccountTransferWorker.java
│ │ │ │ ├── AccountTransferWorkflow.java
│ │ │ │ ├── AccountTransferWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── TransferRequester.java
│ │ │ ├── moneytransfer/
│ │ │ │ ├── Account.java
│ │ │ │ ├── AccountActivityWorker.java
│ │ │ │ ├── AccountImpl.java
│ │ │ │ ├── AccountTransferWorker.java
│ │ │ │ ├── AccountTransferWorkflow.java
│ │ │ │ ├── AccountTransferWorkflowImpl.java
│ │ │ │ ├── README.MD
│ │ │ │ └── TransferRequester.java
│ │ │ ├── nexus/
│ │ │ │ ├── README.MD
│ │ │ │ ├── caller/
│ │ │ │ │ ├── CallerStarter.java
│ │ │ │ │ ├── CallerWorker.java
│ │ │ │ │ ├── EchoCallerWorkflow.java
│ │ │ │ │ ├── EchoCallerWorkflowImpl.java
│ │ │ │ │ ├── HelloCallerWorkflow.java
│ │ │ │ │ └── HelloCallerWorkflowImpl.java
│ │ │ │ ├── handler/
│ │ │ │ │ ├── EchoClient.java
│ │ │ │ │ ├── EchoClientImpl.java
│ │ │ │ │ ├── HandlerWorker.java
│ │ │ │ │ ├── HelloHandlerWorkflow.java
│ │ │ │ │ ├── HelloHandlerWorkflowImpl.java
│ │ │ │ │ └── SampleNexusServiceImpl.java
│ │ │ │ ├── options/
│ │ │ │ │ └── ClientOptions.java
│ │ │ │ └── service/
│ │ │ │ ├── SampleNexusService.java
│ │ │ │ └── description.md
│ │ │ ├── nexuscancellation/
│ │ │ │ ├── README.MD
│ │ │ │ ├── caller/
│ │ │ │ │ ├── CallerStarter.java
│ │ │ │ │ ├── CallerWorker.java
│ │ │ │ │ ├── HelloCallerWorkflow.java
│ │ │ │ │ └── HelloCallerWorkflowImpl.java
│ │ │ │ └── handler/
│ │ │ │ ├── HandlerWorker.java
│ │ │ │ └── HelloHandlerWorkflowImpl.java
│ │ │ ├── nexuscontextpropagation/
│ │ │ │ ├── README.MD
│ │ │ │ ├── caller/
│ │ │ │ │ ├── CallerStarter.java
│ │ │ │ │ ├── CallerWorker.java
│ │ │ │ │ ├── EchoCallerWorkflowImpl.java
│ │ │ │ │ └── HelloCallerWorkflowImpl.java
│ │ │ │ ├── handler/
│ │ │ │ │ ├── HandlerWorker.java
│ │ │ │ │ ├── HelloHandlerWorkflowImpl.java
│ │ │ │ │ └── SampleNexusServiceImpl.java
│ │ │ │ └── propagation/
│ │ │ │ ├── MDCContextPropagator.java
│ │ │ │ └── NexusMDCContextInterceptor.java
│ │ │ ├── nexusmessaging/
│ │ │ │ ├── README.md
│ │ │ │ ├── callerpattern/
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── caller/
│ │ │ │ │ │ ├── CallerStarter.java
│ │ │ │ │ │ ├── CallerWorker.java
│ │ │ │ │ │ ├── CallerWorkflow.java
│ │ │ │ │ │ └── CallerWorkflowImpl.java
│ │ │ │ │ ├── handler/
│ │ │ │ │ │ ├── GreetingActivity.java
│ │ │ │ │ │ ├── GreetingActivityImpl.java
│ │ │ │ │ │ ├── GreetingWorkflow.java
│ │ │ │ │ │ ├── GreetingWorkflowImpl.java
│ │ │ │ │ │ ├── HandlerWorker.java
│ │ │ │ │ │ └── NexusGreetingServiceImpl.java
│ │ │ │ │ └── service/
│ │ │ │ │ ├── Language.java
│ │ │ │ │ └── NexusGreetingService.java
│ │ │ │ └── ondemandpattern/
│ │ │ │ ├── README.md
│ │ │ │ ├── caller/
│ │ │ │ │ ├── CallerRemoteStarter.java
│ │ │ │ │ ├── CallerRemoteWorker.java
│ │ │ │ │ ├── CallerRemoteWorkflow.java
│ │ │ │ │ └── CallerRemoteWorkflowImpl.java
│ │ │ │ ├── handler/
│ │ │ │ │ ├── GreetingActivity.java
│ │ │ │ │ ├── GreetingActivityImpl.java
│ │ │ │ │ ├── GreetingWorkflow.java
│ │ │ │ │ ├── GreetingWorkflowImpl.java
│ │ │ │ │ ├── HandlerWorker.java
│ │ │ │ │ └── NexusRemoteGreetingServiceImpl.java
│ │ │ │ └── service/
│ │ │ │ ├── Language.java
│ │ │ │ └── NexusRemoteGreetingService.java
│ │ │ ├── nexusmultipleargs/
│ │ │ │ ├── README.MD
│ │ │ │ ├── caller/
│ │ │ │ │ ├── CallerStarter.java
│ │ │ │ │ ├── CallerWorker.java
│ │ │ │ │ ├── EchoCallerWorkflow.java
│ │ │ │ │ ├── EchoCallerWorkflowImpl.java
│ │ │ │ │ ├── HelloCallerWorkflow.java
│ │ │ │ │ └── HelloCallerWorkflowImpl.java
│ │ │ │ └── handler/
│ │ │ │ ├── HandlerWorker.java
│ │ │ │ ├── HelloHandlerWorkflow.java
│ │ │ │ ├── HelloHandlerWorkflowImpl.java
│ │ │ │ └── SampleNexusServiceImpl.java
│ │ │ ├── packetdelivery/
│ │ │ │ ├── Packet.java
│ │ │ │ ├── PacketDelivery.java
│ │ │ │ ├── PacketDeliveryActivities.java
│ │ │ │ ├── PacketDeliveryActivitiesImpl.java
│ │ │ │ ├── PacketDeliveryWorkflow.java
│ │ │ │ ├── PacketDeliveryWorkflowImpl.java
│ │ │ │ ├── PacketUtils.java
│ │ │ │ ├── README.md
│ │ │ │ └── Starter.java
│ │ │ ├── payloadconverter/
│ │ │ │ ├── cloudevents/
│ │ │ │ │ ├── CEWorkflow.java
│ │ │ │ │ ├── CEWorkflowImpl.java
│ │ │ │ │ ├── CloudEventsPayloadConverter.java
│ │ │ │ │ ├── README.md
│ │ │ │ │ └── Starter.java
│ │ │ │ └── crypto/
│ │ │ │ ├── CryptoWorkflow.java
│ │ │ │ ├── CryptoWorkflowImpl.java
│ │ │ │ ├── MyCustomer.java
│ │ │ │ ├── README.md
│ │ │ │ └── Starter.java
│ │ │ ├── peractivityoptions/
│ │ │ │ ├── FailingActivities.java
│ │ │ │ ├── FailingActivitiesImpl.java
│ │ │ │ ├── PerActivityOptionsWorkflow.java
│ │ │ │ ├── PerActivityOptionsWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── Starter.java
│ │ │ ├── polling/
│ │ │ │ ├── PollingActivities.java
│ │ │ │ ├── PollingWorkflow.java
│ │ │ │ ├── README.md
│ │ │ │ ├── TestService.java
│ │ │ │ ├── frequent/
│ │ │ │ │ ├── FrequentPollingActivityImpl.java
│ │ │ │ │ ├── FrequentPollingStarter.java
│ │ │ │ │ ├── FrequentPollingWorkflowImpl.java
│ │ │ │ │ └── README.md
│ │ │ │ ├── infrequent/
│ │ │ │ │ ├── InfrequentPollingActivityImpl.java
│ │ │ │ │ ├── InfrequentPollingStarter.java
│ │ │ │ │ ├── InfrequentPollingWorkflowImpl.java
│ │ │ │ │ └── README.md
│ │ │ │ ├── infrequentwithretryafter/
│ │ │ │ │ ├── InfrequentPollingWithRetryAfterActivityImpl.java
│ │ │ │ │ ├── InfrequentPollingWithRetryAfterStarter.java
│ │ │ │ │ ├── InfrequentPollingWithRetryAfterWorkflowImpl.java
│ │ │ │ │ └── README.md
│ │ │ │ └── periodicsequence/
│ │ │ │ ├── PeriodicPollingActivityImpl.java
│ │ │ │ ├── PeriodicPollingChildWorkflowImpl.java
│ │ │ │ ├── PeriodicPollingStarter.java
│ │ │ │ ├── PeriodicPollingWorkflowImpl.java
│ │ │ │ ├── PollingChildWorkflow.java
│ │ │ │ └── README.md
│ │ │ ├── retryonsignalinterceptor/
│ │ │ │ ├── FailureRequester.java
│ │ │ │ ├── MyActivity.java
│ │ │ │ ├── MyActivityImpl.java
│ │ │ │ ├── MyWorkflow.java
│ │ │ │ ├── MyWorkflowImpl.java
│ │ │ │ ├── MyWorkflowWorker.java
│ │ │ │ ├── QueryRequester.java
│ │ │ │ ├── README.MD
│ │ │ │ ├── RetryOnSignalInterceptorListener.java
│ │ │ │ ├── RetryOnSignalWorkerInterceptor.java
│ │ │ │ ├── RetryOnSignalWorkflowInboundCallsInterceptor.java
│ │ │ │ ├── RetryOnSignalWorkflowOutboundCallsInterceptor.java
│ │ │ │ └── RetryRequester.java
│ │ │ ├── safemessagepassing/
│ │ │ │ ├── ClusterManagerActivities.java
│ │ │ │ ├── ClusterManagerActivitiesImpl.java
│ │ │ │ ├── ClusterManagerWorkflow.java
│ │ │ │ ├── ClusterManagerWorkflowImpl.java
│ │ │ │ ├── ClusterManagerWorkflowStarter.java
│ │ │ │ ├── ClusterManagerWorkflowWorker.java
│ │ │ │ └── README.md
│ │ │ ├── sleepfordays/
│ │ │ │ ├── README.md
│ │ │ │ ├── SendEmailActivity.java
│ │ │ │ ├── SendEmailActivityImpl.java
│ │ │ │ ├── SleepForDaysImpl.java
│ │ │ │ ├── SleepForDaysWorkflow.java
│ │ │ │ ├── Starter.java
│ │ │ │ └── Worker.java
│ │ │ ├── ssl/
│ │ │ │ ├── MyWorkflow.java
│ │ │ │ ├── MyWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ ├── SslEnabledWorkerCustomCA.java
│ │ │ │ └── Starter.java
│ │ │ ├── standaloneactivities/
│ │ │ │ ├── CountActivities.java
│ │ │ │ ├── ExecuteActivity.java
│ │ │ │ ├── GreetingActivities.java
│ │ │ │ ├── GreetingActivitiesImpl.java
│ │ │ │ ├── ListActivities.java
│ │ │ │ ├── README.md
│ │ │ │ ├── StandaloneActivityWorker.java
│ │ │ │ └── StartActivity.java
│ │ │ ├── terminateworkflow/
│ │ │ │ ├── MyWorkflow.java
│ │ │ │ ├── MyWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── Starter.java
│ │ │ ├── tracing/
│ │ │ │ ├── JaegerUtils.java
│ │ │ │ ├── README.md
│ │ │ │ ├── Starter.java
│ │ │ │ ├── TracingWorker.java
│ │ │ │ └── workflow/
│ │ │ │ ├── TracingActivities.java
│ │ │ │ ├── TracingActivitiesImpl.java
│ │ │ │ ├── TracingChildWorkflow.java
│ │ │ │ ├── TracingChildWorkflowImpl.java
│ │ │ │ ├── TracingWorkflow.java
│ │ │ │ └── TracingWorkflowImpl.java
│ │ │ ├── updatabletimer/
│ │ │ │ ├── DynamicSleepWorkflow.java
│ │ │ │ ├── DynamicSleepWorkflowImpl.java
│ │ │ │ ├── DynamicSleepWorkflowStarter.java
│ │ │ │ ├── DynamicSleepWorkflowWorker.java
│ │ │ │ ├── README.md
│ │ │ │ ├── UpdatableTimer.java
│ │ │ │ └── WakeUpTimeUpdater.java
│ │ │ └── workerversioning/
│ │ │ ├── Activities.java
│ │ │ ├── ActivitiesImpl.java
│ │ │ ├── AutoUpgradingWorkflow.java
│ │ │ ├── AutoUpgradingWorkflowV1Impl.java
│ │ │ ├── AutoUpgradingWorkflowV1bImpl.java
│ │ │ ├── PinnedWorkflow.java
│ │ │ ├── PinnedWorkflowV1Impl.java
│ │ │ ├── PinnedWorkflowV2Impl.java
│ │ │ ├── README.md
│ │ │ ├── Starter.java
│ │ │ ├── WorkerV1.java
│ │ │ ├── WorkerV1_1.java
│ │ │ └── WorkerV2.java
│ │ └── resources/
│ │ ├── config.toml
│ │ ├── dsl/
│ │ │ └── sampleflow.json
│ │ └── logback.xml
│ └── test/
│ ├── java/
│ │ └── io/
│ │ └── temporal/
│ │ └── samples/
│ │ ├── asyncchild/
│ │ │ └── AsyncChildTest.java
│ │ ├── asyncuntypedchild/
│ │ │ └── AsyncUntypedChildTest.java
│ │ ├── batch/
│ │ │ ├── heartbeatingactivity/
│ │ │ │ └── HeartbeatingActivityBatchWorkflowTest.java
│ │ │ ├── iterator/
│ │ │ │ └── IteratorIteratorBatchWorkflowTest.java
│ │ │ └── slidingwindow/
│ │ │ └── SlidingWindowBatchWorkflowTest.java
│ │ ├── bookingsaga/
│ │ │ └── TripBookingWorkflowTest.java
│ │ ├── bookingsyncsaga/
│ │ │ └── TripBookingWorkflowTest.java
│ │ ├── countinterceptor/
│ │ │ ├── ClientCountInterceptorTest.java
│ │ │ └── WorkerCountInterceptorTest.java
│ │ ├── dsl/
│ │ │ └── DslWorkflowTest.java
│ │ ├── earlyreturn/
│ │ │ └── TransactionWorkflowTest.java
│ │ ├── encodefailures/
│ │ │ └── EncodeFailuresTest.java
│ │ ├── excludefrominterceptor/
│ │ │ └── ExcludeFromInterceptorTest.java
│ │ ├── fileprocessing/
│ │ │ └── FileProcessingTest.java
│ │ ├── getresultsasync/
│ │ │ └── GetResultsAsyncTest.java
│ │ ├── hello/
│ │ │ ├── HelloAccumulatorTest.java
│ │ │ ├── HelloActivityExclusiveChoiceJUnit5Test.java
│ │ │ ├── HelloActivityExclusiveChoiceTest.java
│ │ │ ├── HelloActivityJUnit5Test.java
│ │ │ ├── HelloActivityReplayTest.java
│ │ │ ├── HelloActivityRetryTest.java
│ │ │ ├── HelloActivityTest.java
│ │ │ ├── HelloAsyncActivityCompletionTest.java
│ │ │ ├── HelloAsyncLambdaTest.java
│ │ │ ├── HelloAsyncTest.java
│ │ │ ├── HelloAwaitTest.java
│ │ │ ├── HelloCancellationScopeTest.java
│ │ │ ├── HelloCancellationScopeWithTimerTest.java
│ │ │ ├── HelloChildJUnit5Test.java
│ │ │ ├── HelloChildTest.java
│ │ │ ├── HelloCronTest.java
│ │ │ ├── HelloDelayedStartTest.java
│ │ │ ├── HelloDetachedCancellationScopeTest.java
│ │ │ ├── HelloDynamicActivityJUnit5Test.java
│ │ │ ├── HelloDynamicTest.java
│ │ │ ├── HelloEagerWorkflowStartTest.java
│ │ │ ├── HelloExceptionTest.java
│ │ │ ├── HelloLocalActivityTest.java
│ │ │ ├── HelloParallelActivityTest.java
│ │ │ ├── HelloPeriodicTest.java
│ │ │ ├── HelloPolymorphicActivityTest.java
│ │ │ ├── HelloQueryTest.java
│ │ │ ├── HelloSearchAttributesTest.java
│ │ │ ├── HelloSideEffectTest.java
│ │ │ ├── HelloSignalTest.java
│ │ │ ├── HelloSignalWithStartAndWorkflowInitTest.java
│ │ │ ├── HelloSignalWithTimerTest.java
│ │ │ ├── HelloStandaloneActivityTest.java
│ │ │ ├── HelloUpdateAndCancellationTest.java
│ │ │ ├── HelloUpdateTest.java
│ │ │ └── HelloWorkflowTimerTest.java
│ │ ├── interceptorreplaytest/
│ │ │ └── InterceptorReplayTest.java
│ │ ├── listworkflows/
│ │ │ └── ListWorkflowsTest.java
│ │ ├── metrics/
│ │ │ └── MetricsTest.java
│ │ ├── moneybatch/
│ │ │ └── TransferWorkflowTest.java
│ │ ├── moneytransfer/
│ │ │ └── TransferWorkflowTest.java
│ │ ├── nexus/
│ │ │ └── caller/
│ │ │ ├── CallerWorkflowJunit5MockTest.java
│ │ │ ├── CallerWorkflowJunit5Test.java
│ │ │ ├── CallerWorkflowMockTest.java
│ │ │ ├── CallerWorkflowTest.java
│ │ │ ├── NexusServiceJunit5Test.java
│ │ │ └── NexusServiceMockTest.java
│ │ ├── payloadconverter/
│ │ │ ├── CloudEventsPayloadConverterTest.java
│ │ │ └── CryptoPayloadConverterTest.java
│ │ ├── peractivityoptions/
│ │ │ └── PerActivityOptionsTest.java
│ │ ├── polling/
│ │ │ ├── FrequentPollingTest.java
│ │ │ ├── InfrequentPollingTest.java
│ │ │ └── PeriodicPollingTest.java
│ │ ├── retryonsignalinterceptor/
│ │ │ └── RetryOnSignalInterceptorTest.java
│ │ ├── safemessagepassing/
│ │ │ └── ClusterManagerWorkflowWorkerTest.java
│ │ ├── sleepfordays/
│ │ │ ├── SleepForDaysJUnit5Test.java
│ │ │ └── SleepForDaysTest.java
│ │ ├── standaloneactivities/
│ │ │ └── StandaloneActivitiesTest.java
│ │ ├── terminateworkflow/
│ │ │ └── TerminateWorkflowTest.java
│ │ └── tracing/
│ │ └── TracingTest.java
│ └── resources/
│ └── dsl/
│ └── sampleflow.json
├── docker/
│ └── github/
│ ├── Dockerfile
│ ├── README.md
│ └── docker-compose.yaml
├── gradle/
│ ├── springai.gradle
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
├── springai/
│ ├── basic/
│ │ ├── build.gradle
│ │ └── src/
│ │ └── main/
│ │ ├── java/
│ │ │ └── io/
│ │ │ └── temporal/
│ │ │ └── samples/
│ │ │ └── springai/
│ │ │ └── chat/
│ │ │ ├── ChatExampleApplication.java
│ │ │ ├── ChatWorkflow.java
│ │ │ ├── ChatWorkflowImpl.java
│ │ │ ├── StringTools.java
│ │ │ ├── TimestampTools.java
│ │ │ ├── WeatherActivity.java
│ │ │ └── WeatherActivityImpl.java
│ │ └── resources/
│ │ └── application.yaml
│ ├── mcp/
│ │ ├── build.gradle
│ │ └── src/
│ │ └── main/
│ │ ├── java/
│ │ │ └── io/
│ │ │ └── temporal/
│ │ │ └── samples/
│ │ │ └── springai/
│ │ │ └── mcp/
│ │ │ ├── McpApplication.java
│ │ │ ├── McpWorkflow.java
│ │ │ └── McpWorkflowImpl.java
│ │ └── resources/
│ │ └── application.yaml
│ ├── multimodel/
│ │ ├── build.gradle
│ │ └── src/
│ │ └── main/
│ │ ├── java/
│ │ │ └── io/
│ │ │ └── temporal/
│ │ │ └── samples/
│ │ │ └── springai/
│ │ │ └── multimodel/
│ │ │ ├── ChatModelConfig.java
│ │ │ ├── MultiModelApplication.java
│ │ │ ├── MultiModelWorkflow.java
│ │ │ └── MultiModelWorkflowImpl.java
│ │ └── resources/
│ │ └── application.yaml
│ └── rag/
│ ├── build.gradle
│ └── src/
│ └── main/
│ ├── java/
│ │ └── io/
│ │ └── temporal/
│ │ └── samples/
│ │ └── springai/
│ │ └── rag/
│ │ ├── RagApplication.java
│ │ ├── RagWorkflow.java
│ │ ├── RagWorkflowImpl.java
│ │ └── VectorStoreConfig.java
│ └── resources/
│ └── application.yaml
├── springboot/
│ ├── build.gradle
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── io/
│ │ │ └── temporal/
│ │ │ └── samples/
│ │ │ └── springboot/
│ │ │ ├── SamplesController.java
│ │ │ ├── TemporalSpringbootSamplesApplication.java
│ │ │ ├── actuator/
│ │ │ │ ├── README.md
│ │ │ │ └── WorkerActuatorEndpoint.java
│ │ │ ├── camel/
│ │ │ │ ├── CamelConfig.java
│ │ │ │ ├── CamelResource.java
│ │ │ │ ├── CamelRoutes.java
│ │ │ │ ├── OfficeOrder.java
│ │ │ │ ├── OrderActivity.java
│ │ │ │ ├── OrderActivityImpl.java
│ │ │ │ ├── OrderRepository.java
│ │ │ │ ├── OrderWorkflow.java
│ │ │ │ ├── OrderWorkflowImpl.java
│ │ │ │ └── README.md
│ │ │ ├── customize/
│ │ │ │ ├── CustomizeActivity.java
│ │ │ │ ├── CustomizeActivityImpl.java
│ │ │ │ ├── CustomizeWorkflow.java
│ │ │ │ ├── CustomizeWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── TemporalOptionsConfig.java
│ │ │ ├── hello/
│ │ │ │ ├── HelloActivity.java
│ │ │ │ ├── HelloActivityImpl.java
│ │ │ │ ├── HelloWorkflow.java
│ │ │ │ ├── HelloWorkflowImpl.java
│ │ │ │ ├── README.md
│ │ │ │ └── model/
│ │ │ │ └── Person.java
│ │ │ ├── kafka/
│ │ │ │ ├── KafkaActivity.java
│ │ │ │ ├── KafkaActivityImpl.java
│ │ │ │ ├── KafkaConfig.java
│ │ │ │ ├── MessageController.java
│ │ │ │ ├── MessageWorkflow.java
│ │ │ │ ├── MessageWorkflowImpl.java
│ │ │ │ └── README.md
│ │ │ ├── metrics/
│ │ │ │ └── README.md
│ │ │ └── update/
│ │ │ ├── ProductNotAvailableForAmountException.java
│ │ │ ├── PurchaseActivities.java
│ │ │ ├── PurchaseActivitiesImpl.java
│ │ │ ├── PurchaseWorkflow.java
│ │ │ ├── PurchaseWorkflowImpl.java
│ │ │ ├── README.md
│ │ │ ├── ResourceNotFoundException.java
│ │ │ └── model/
│ │ │ ├── Product.java
│ │ │ ├── ProductRepository.java
│ │ │ └── Purchase.java
│ │ └── resources/
│ │ ├── application-tc.yaml
│ │ ├── application.yaml
│ │ ├── data.sql
│ │ ├── static/
│ │ │ └── js/
│ │ │ ├── jquery.sse.js
│ │ │ └── samplessse.js
│ │ └── templates/
│ │ ├── actuator.html
│ │ ├── camel.html
│ │ ├── customize.html
│ │ ├── fragments.html
│ │ ├── hello.html
│ │ ├── index.html
│ │ ├── kafka.html
│ │ ├── metrics.html
│ │ └── update.html
│ └── test/
│ ├── java/
│ │ └── io/
│ │ └── temporal/
│ │ └── samples/
│ │ └── springboot/
│ │ ├── CamelSampleTest.java
│ │ ├── CustomizeSampleTest.java
│ │ ├── HelloSampleTest.java
│ │ ├── HelloSampleTestMockedActivity.java
│ │ ├── KafkaConsumerTestHelper.java
│ │ ├── KafkaSampleTest.java
│ │ └── UpdateSampleTest.java
│ └── resources/
│ ├── application.yaml
│ └── data.sql
└── springboot-basic/
├── build.gradle
└── src/
├── main/
│ ├── java/
│ │ └── io/
│ │ └── temporal/
│ │ └── samples/
│ │ └── springboot/
│ │ ├── SamplesController.java
│ │ ├── TemporalSpringbootSamplesApplication.java
│ │ └── hello/
│ │ ├── HelloActivity.java
│ │ ├── HelloActivityImpl.java
│ │ ├── HelloWorkflow.java
│ │ ├── HelloWorkflowImpl.java
│ │ ├── README.md
│ │ └── model/
│ │ └── Person.java
│ └── resources/
│ ├── application-tc.yaml
│ ├── application.yaml
│ ├── static/
│ │ └── js/
│ │ ├── jquery.sse.js
│ │ └── samplessse.js
│ └── templates/
│ ├── fragments.html
│ ├── hello.html
│ └── index.html
└── test/
├── java/
│ └── io/
│ └── temporal/
│ └── samples/
│ └── springboot/
│ └── HelloSampleTest.java
└── resources/
└── application.yaml
SYMBOL INDEX (2233 symbols across 518 files)
FILE: core/src/main/java/io/temporal/samples/apikey/ApiKeyWorker.java
class ApiKeyWorker (line 12) | public class ApiKeyWorker {
method main (line 15) | public static void main(String[] args) throws Exception {
FILE: core/src/main/java/io/temporal/samples/apikey/MyWorkflow.java
type MyWorkflow (line 6) | @WorkflowInterface
method execute (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/apikey/MyWorkflowImpl.java
class MyWorkflowImpl (line 3) | public class MyWorkflowImpl implements MyWorkflow {
method execute (line 4) | @Override
FILE: core/src/main/java/io/temporal/samples/apikey/Starter.java
class Starter (line 13) | public class Starter {
method main (line 18) | public static void main(String[] args) throws Exception {
FILE: core/src/main/java/io/temporal/samples/asyncchild/ChildWorkflow.java
type ChildWorkflow (line 6) | @WorkflowInterface
method executeChild (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/asyncchild/ChildWorkflowImpl.java
class ChildWorkflowImpl (line 6) | public class ChildWorkflowImpl implements ChildWorkflow {
method executeChild (line 7) | @Override
FILE: core/src/main/java/io/temporal/samples/asyncchild/ParentWorkflow.java
type ParentWorkflow (line 7) | @WorkflowInterface
method executeParent (line 9) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/asyncchild/ParentWorkflowImpl.java
class ParentWorkflowImpl (line 10) | public class ParentWorkflowImpl implements ParentWorkflow {
method executeParent (line 11) | @Override
FILE: core/src/main/java/io/temporal/samples/asyncchild/Starter.java
class Starter (line 16) | public class Starter {
method main (line 20) | public static void main(String[] args) {
method createWorker (line 61) | private static void createWorker(WorkerFactory factory) {
method getStatusAsString (line 68) | private static String getStatusAsString(
method sleep (line 83) | private static void sleep(int seconds) {
FILE: core/src/main/java/io/temporal/samples/asyncuntypedchild/ChildWorkflow.java
type ChildWorkflow (line 12) | @WorkflowInterface
method composeGreeting (line 19) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/asyncuntypedchild/ChildWorkflowImpl.java
class ChildWorkflowImpl (line 11) | public class ChildWorkflowImpl implements ChildWorkflow {
method composeGreeting (line 13) | @Override
FILE: core/src/main/java/io/temporal/samples/asyncuntypedchild/ParentWorkflow.java
type ParentWorkflow (line 12) | @WorkflowInterface
method getGreeting (line 19) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/asyncuntypedchild/ParentWorkflowImpl.java
class ParentWorkflowImpl (line 10) | public class ParentWorkflowImpl implements ParentWorkflow {
method getGreeting (line 12) | @Override
FILE: core/src/main/java/io/temporal/samples/asyncuntypedchild/Starter.java
class Starter (line 16) | public class Starter {
method main (line 26) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/autoheartbeat/AutoHeartbeatUtil.java
class AutoHeartbeatUtil (line 31) | public class AutoHeartbeatUtil {
method AutoHeartbeatUtil (line 41) | public AutoHeartbeatUtil(
method start (line 56) | public ScheduledFuture<?> start() {
method stop (line 74) | public void stop() {
method printShortCurrentTime (line 82) | private String printShortCurrentTime() {
FILE: core/src/main/java/io/temporal/samples/autoheartbeat/Starter.java
class Starter (line 37) | public class Starter {
method main (line 41) | public static void main(String[] args) {
method firstRun (line 83) | @SuppressWarnings("unused")
method secondRun (line 102) | @SuppressWarnings("unused")
method thirdRun (line 124) | @SuppressWarnings("unused")
method fourthRun (line 150) | @SuppressWarnings("unused")
method doSleeps (line 171) | private static void doSleeps(int seconds) {
FILE: core/src/main/java/io/temporal/samples/autoheartbeat/activities/AutoActivities.java
type AutoActivities (line 24) | @ActivityInterface
method runActivityOne (line 26) | String runActivityOne(String input);
method runActivityTwo (line 28) | String runActivityTwo(String input);
FILE: core/src/main/java/io/temporal/samples/autoheartbeat/activities/AutoActivitiesImpl.java
class AutoActivitiesImpl (line 24) | public class AutoActivitiesImpl implements AutoActivities {
method runActivityOne (line 26) | @Override
method runActivityTwo (line 31) | @Override
method runActivity (line 36) | @SuppressWarnings("FutureReturnValueIgnored")
method sleep (line 44) | private void sleep(int seconds) {
FILE: core/src/main/java/io/temporal/samples/autoheartbeat/interceptor/AutoHeartbeatActivityInboundCallsInterceptor.java
class AutoHeartbeatActivityInboundCallsInterceptor (line 34) | public class AutoHeartbeatActivityInboundCallsInterceptor
method AutoHeartbeatActivityInboundCallsInterceptor (line 41) | public AutoHeartbeatActivityInboundCallsInterceptor(ActivityInboundCal...
method init (line 45) | @Override
method execute (line 52) | @Override
type AutoHeartbeaterCancellationCallback (line 105) | public interface AutoHeartbeaterCancellationCallback {
method handle (line 106) | void handle(Exception e);
FILE: core/src/main/java/io/temporal/samples/autoheartbeat/interceptor/AutoHeartbeatWorkerInterceptor.java
class AutoHeartbeatWorkerInterceptor (line 25) | public class AutoHeartbeatWorkerInterceptor extends WorkerInterceptorBase {
method interceptActivity (line 26) | @Override
FILE: core/src/main/java/io/temporal/samples/autoheartbeat/workflows/AutoWorkflow.java
type AutoWorkflow (line 26) | @WorkflowInterface
method exec (line 28) | @WorkflowMethod
method cancelActivity (line 31) | @SignalMethod
FILE: core/src/main/java/io/temporal/samples/autoheartbeat/workflows/AutoWorkflowImpl.java
class AutoWorkflowImpl (line 33) | public class AutoWorkflowImpl implements AutoWorkflow {
method exec (line 36) | @Override
method cancelActivity (line 84) | @Override
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/HeartbeatingActivityBatchStarter.java
class HeartbeatingActivityBatchStarter (line 13) | public class HeartbeatingActivityBatchStarter {
method main (line 15) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/HeartbeatingActivityBatchWorker.java
class HeartbeatingActivityBatchWorker (line 14) | public final class HeartbeatingActivityBatchWorker {
method main (line 18) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/HeartbeatingActivityBatchWorkflow.java
type HeartbeatingActivityBatchWorkflow (line 6) | @WorkflowInterface
method processBatch (line 14) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/HeartbeatingActivityBatchWorkflowImpl.java
class HeartbeatingActivityBatchWorkflowImpl (line 16) | public final class HeartbeatingActivityBatchWorkflowImpl
method processBatch (line 33) | @Override
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordLoader.java
type RecordLoader (line 12) | public interface RecordLoader {
method getRecord (line 20) | Optional<SingleRecord> getRecord(int offset);
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordLoaderImpl.java
class RecordLoaderImpl (line 6) | public final class RecordLoaderImpl implements RecordLoader {
method getRecord (line 10) | @Override
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordProcessor.java
type RecordProcessor (line 4) | public interface RecordProcessor {
method processRecord (line 11) | void processRecord(SingleRecord record);
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordProcessorActivity.java
type RecordProcessorActivity (line 5) | @ActivityInterface
method processRecords (line 9) | int processRecords();
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordProcessorActivityImpl.java
class RecordProcessorActivityImpl (line 26) | public class RecordProcessorActivityImpl implements RecordProcessorActiv...
method RecordProcessorActivityImpl (line 34) | public RecordProcessorActivityImpl(RecordLoader recordLoader, RecordPr...
method processRecords (line 39) | @Override
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordProcessorImpl.java
class RecordProcessorImpl (line 7) | public final class RecordProcessorImpl implements RecordProcessor {
method processRecord (line 11) | @Override
FILE: core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/SingleRecord.java
class SingleRecord (line 4) | public class SingleRecord {
method SingleRecord (line 7) | public SingleRecord(int id) {
method SingleRecord (line 12) | public SingleRecord() {}
method getId (line 14) | public int getId() {
method toString (line 18) | @Override
FILE: core/src/main/java/io/temporal/samples/batch/iterator/IteratorBatchStarter.java
class IteratorBatchStarter (line 13) | public class IteratorBatchStarter {
method main (line 15) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/batch/iterator/IteratorBatchWorker.java
class IteratorBatchWorker (line 14) | public final class IteratorBatchWorker {
method main (line 18) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/batch/iterator/IteratorBatchWorkflow.java
type IteratorBatchWorkflow (line 6) | @WorkflowInterface
method processBatch (line 16) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/batch/iterator/IteratorBatchWorkflowImpl.java
class IteratorBatchWorkflowImpl (line 22) | public final class IteratorBatchWorkflowImpl implements IteratorBatchWor...
method processBatch (line 33) | @Override
FILE: core/src/main/java/io/temporal/samples/batch/iterator/RecordLoader.java
type RecordLoader (line 13) | @ActivityInterface
method getRecords (line 23) | List<SingleRecord> getRecords(int pageSize, int offset);
FILE: core/src/main/java/io/temporal/samples/batch/iterator/RecordLoaderImpl.java
class RecordLoaderImpl (line 7) | public final class RecordLoaderImpl implements RecordLoader {
method getRecords (line 13) | @Override
FILE: core/src/main/java/io/temporal/samples/batch/iterator/RecordProcessorWorkflow.java
type RecordProcessorWorkflow (line 7) | @WorkflowInterface
method processRecord (line 11) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/batch/iterator/RecordProcessorWorkflowImpl.java
class RecordProcessorWorkflowImpl (line 9) | public class RecordProcessorWorkflowImpl implements RecordProcessorWorkf...
method processRecord (line 13) | @Override
FILE: core/src/main/java/io/temporal/samples/batch/iterator/SingleRecord.java
class SingleRecord (line 4) | public class SingleRecord {
method SingleRecord (line 7) | public SingleRecord(int id) {
method SingleRecord (line 12) | public SingleRecord() {}
method getId (line 14) | public int getId() {
method toString (line 18) | @Override
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/BatchProgress.java
class BatchProgress (line 6) | public final class BatchProgress {
method BatchProgress (line 12) | public BatchProgress(int progress, Set<Integer> currentRecords) {
method getProgress (line 18) | public int getProgress() {
method getCurrentRecords (line 23) | public Set<Integer> getCurrentRecords() {
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/BatchWorkflow.java
type BatchWorkflow (line 6) | @WorkflowInterface
method processBatch (line 21) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/BatchWorkflowImpl.java
class BatchWorkflowImpl (line 13) | public class BatchWorkflowImpl implements BatchWorkflow {
method processBatch (line 20) | @Override
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/ProcessBatchInput.java
class ProcessBatchInput (line 7) | public final class ProcessBatchInput {
method setPageSize (line 20) | public void setPageSize(int pageSize) {
method setSlidingWindowSize (line 25) | public void setSlidingWindowSize(int slidingWindowSize) {
method setOffset (line 30) | public void setOffset(int offset) {
method setMaximumOffset (line 35) | public void setMaximumOffset(int maximumOffset) {
method setProgress (line 40) | public void setProgress(int progress) {
method setCurrentRecords (line 51) | public void setCurrentRecords(Set<Integer> currentRecords) {
method getPageSize (line 55) | public int getPageSize() {
method getSlidingWindowSize (line 59) | public int getSlidingWindowSize() {
method getOffset (line 63) | public int getOffset() {
method getMaximumOffset (line 67) | public int getMaximumOffset() {
method getProgress (line 71) | public int getProgress() {
method getCurrentRecords (line 75) | public Set<Integer> getCurrentRecords() {
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/RecordIterable.java
class RecordIterable (line 13) | public class RecordIterable implements Iterable<SingleRecord> {
class RecordIterator (line 21) | private class RecordIterator implements Iterator<SingleRecord> {
method RecordIterator (line 35) | RecordIterator() {
method hasNext (line 45) | @Override
method next (line 50) | @Override
method RecordIterable (line 82) | public RecordIterable(int pageSize, int initialOffset, int maximumOffs...
method iterator (line 88) | @NotNull
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/RecordLoader.java
type RecordLoader (line 6) | @ActivityInterface
method getRecords (line 16) | List<SingleRecord> getRecords(int pageSize, int offset);
method getRecordCount (line 24) | int getRecordCount();
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/RecordLoaderImpl.java
class RecordLoaderImpl (line 7) | public final class RecordLoaderImpl implements RecordLoader {
method getRecords (line 11) | @Override
method getRecordCount (line 22) | @Override
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/RecordProcessorWorkflow.java
type RecordProcessorWorkflow (line 7) | @WorkflowInterface
method processRecord (line 14) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/RecordProcessorWorkflowImpl.java
class RecordProcessorWorkflowImpl (line 10) | public final class RecordProcessorWorkflowImpl implements RecordProcesso...
method processRecord (line 14) | @Override
method processRecordImpl (line 30) | private void processRecordImpl(SingleRecord r) {
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/SingleRecord.java
class SingleRecord (line 4) | public class SingleRecord {
method SingleRecord (line 7) | public SingleRecord(int id) {
method SingleRecord (line 12) | public SingleRecord() {}
method getId (line 14) | public int getId() {
method toString (line 18) | @Override
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/SlidingWindowBatchStarter.java
class SlidingWindowBatchStarter (line 11) | public class SlidingWindowBatchStarter {
method main (line 13) | @SuppressWarnings("CatchAndPrintStackTrace")
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/SlidingWindowBatchWorker.java
class SlidingWindowBatchWorker (line 11) | public final class SlidingWindowBatchWorker {
method main (line 15) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/SlidingWindowBatchWorkflow.java
type SlidingWindowBatchWorkflow (line 8) | @WorkflowInterface
method processBatch (line 16) | @WorkflowMethod
method reportCompletion (line 19) | @SignalMethod
method getProgress (line 22) | @QueryMethod
FILE: core/src/main/java/io/temporal/samples/batch/slidingwindow/SlidingWindowBatchWorkflowImpl.java
class SlidingWindowBatchWorkflowImpl (line 17) | public final class SlidingWindowBatchWorkflowImpl implements SlidingWind...
method processBatch (line 38) | @Override
method reportCompletion (line 108) | @Override
method getProgress (line 121) | @Override
FILE: core/src/main/java/io/temporal/samples/bookingsaga/Booking.java
class Booking (line 3) | public final class Booking {
method Booking (line 9) | public Booking() {}
method Booking (line 11) | public Booking(String carReservationID, String hotelReservationID, Str...
method getCarReservationID (line 17) | public String getCarReservationID() {
method getHotelReservationID (line 21) | public String getHotelReservationID() {
method getFlightReservationID (line 25) | public String getFlightReservationID() {
method toString (line 29) | @Override
FILE: core/src/main/java/io/temporal/samples/bookingsaga/TripBookingActivities.java
type TripBookingActivities (line 5) | @ActivityInterface
method reserveCar (line 15) | String reserveCar(String requestId, String name);
method bookFlight (line 24) | String bookFlight(String requestId, String name);
method bookHotel (line 33) | String bookHotel(String requestId, String name);
method cancelFlight (line 42) | String cancelFlight(String requestId, String name);
method cancelHotel (line 51) | String cancelHotel(String requestId, String name);
method cancelCar (line 60) | String cancelCar(String requestId, String name);
FILE: core/src/main/java/io/temporal/samples/bookingsaga/TripBookingActivitiesImpl.java
class TripBookingActivitiesImpl (line 6) | public class TripBookingActivitiesImpl implements TripBookingActivities {
method reserveCar (line 7) | @Override
method bookFlight (line 13) | @Override
method bookHotel (line 21) | @Override
method cancelFlight (line 27) | @Override
method cancelHotel (line 33) | @Override
method cancelCar (line 39) | @Override
FILE: core/src/main/java/io/temporal/samples/bookingsaga/TripBookingClient.java
class TripBookingClient (line 10) | public class TripBookingClient {
method main (line 14) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/bookingsaga/TripBookingWorker.java
class TripBookingWorker (line 10) | public class TripBookingWorker {
method main (line 12) | @SuppressWarnings("CatchAndPrintStackTrace")
FILE: core/src/main/java/io/temporal/samples/bookingsaga/TripBookingWorkflow.java
type TripBookingWorkflow (line 6) | @WorkflowInterface
method bookTrip (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/bookingsaga/TripBookingWorkflowImpl.java
class TripBookingWorkflowImpl (line 9) | public class TripBookingWorkflowImpl implements TripBookingWorkflow {
method bookTrip (line 16) | @Override
FILE: core/src/main/java/io/temporal/samples/bookingsyncsaga/Booking.java
class Booking (line 3) | public final class Booking {
method Booking (line 8) | public Booking(String carReservationID, String hotelReservationID, Str...
method getCarReservationID (line 14) | public String getCarReservationID() {
method getHotelReservationID (line 18) | public String getHotelReservationID() {
method getFlightReservationID (line 22) | public String getFlightReservationID() {
method toString (line 26) | @Override
FILE: core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingActivities.java
type TripBookingActivities (line 5) | @ActivityInterface
method reserveCar (line 15) | String reserveCar(String requestId, String name);
method bookFlight (line 24) | String bookFlight(String requestId, String name);
method bookHotel (line 33) | String bookHotel(String requestId, String name);
method cancelFlight (line 42) | String cancelFlight(String requestId, String name);
method cancelHotel (line 51) | String cancelHotel(String requestId, String name);
method cancelCar (line 60) | String cancelCar(String requestId, String name);
FILE: core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingActivitiesImpl.java
class TripBookingActivitiesImpl (line 6) | public class TripBookingActivitiesImpl implements TripBookingActivities {
method reserveCar (line 7) | @Override
method bookFlight (line 13) | @Override
method bookHotel (line 21) | @Override
method cancelFlight (line 27) | @Override
method cancelHotel (line 34) | @Override
method cancelCar (line 41) | @Override
method sleep (line 48) | private static void sleep(long milliseconds) {
FILE: core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingClient.java
class TripBookingClient (line 10) | public class TripBookingClient {
method main (line 14) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingWorker.java
class TripBookingWorker (line 10) | public class TripBookingWorker {
method main (line 12) | @SuppressWarnings("CatchAndPrintStackTrace")
FILE: core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingWorkflow.java
type TripBookingWorkflow (line 7) | @WorkflowInterface
method bookTrip (line 9) | @WorkflowMethod
method waitForBooking (line 18) | @UpdateMethod
FILE: core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingWorkflowImpl.java
class TripBookingWorkflowImpl (line 12) | public class TripBookingWorkflowImpl implements TripBookingWorkflow {
method bookTrip (line 42) | @Override
method waitForBooking (line 75) | @Override
FILE: core/src/main/java/io/temporal/samples/common/QueryWorkflowExecution.java
class QueryWorkflowExecution (line 17) | public class QueryWorkflowExecution {
method main (line 19) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/countinterceptor/ClientCounter.java
class ClientCounter (line 11) | public class ClientCounter {
method getInfo (line 19) | public String getInfo() {
method add (line 34) | private void add(String workflowId, String type) {
method getNumOfWorkflowExecutions (line 48) | public int getNumOfWorkflowExecutions(String workflowId) {
method getNumOfGetResults (line 52) | public int getNumOfGetResults(String workflowId) {
method getNumOfSignals (line 56) | public int getNumOfSignals(String workflowId) {
method getNumOfQueries (line 60) | public int getNumOfQueries(String workflowId) {
method getDefaultInfoMap (line 69) | private Map<String, Integer> getDefaultInfoMap() {
method addStartInvocation (line 78) | public void addStartInvocation(String workflowId) {
method addSignalInvocation (line 82) | public void addSignalInvocation(String workflowId) {
method addGetResultInvocation (line 86) | public void addGetResultInvocation(String workflowId) {
method addQueryInvocation (line 90) | public void addQueryInvocation(String workflowId) {
FILE: core/src/main/java/io/temporal/samples/countinterceptor/InterceptorStarter.java
class InterceptorStarter (line 21) | public class InterceptorStarter {
method main (line 29) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/countinterceptor/SimpleClientCallsInterceptor.java
class SimpleClientCallsInterceptor (line 7) | public class SimpleClientCallsInterceptor extends WorkflowClientCallsInt...
method SimpleClientCallsInterceptor (line 10) | public SimpleClientCallsInterceptor(
method start (line 16) | @Override
method signal (line 22) | @Override
method getResult (line 28) | @Override
method query (line 34) | @Override
FILE: core/src/main/java/io/temporal/samples/countinterceptor/SimpleClientInterceptor.java
class SimpleClientInterceptor (line 6) | public class SimpleClientInterceptor extends WorkflowClientInterceptorBa...
method SimpleClientInterceptor (line 10) | public SimpleClientInterceptor(ClientCounter clientCounter) {
method workflowClientCallsInterceptor (line 14) | @Override
FILE: core/src/main/java/io/temporal/samples/countinterceptor/SimpleCountActivityInboundCallsInterceptor.java
class SimpleCountActivityInboundCallsInterceptor (line 7) | public class SimpleCountActivityInboundCallsInterceptor
method SimpleCountActivityInboundCallsInterceptor (line 12) | public SimpleCountActivityInboundCallsInterceptor(ActivityInboundCalls...
method init (line 16) | @Override
method execute (line 22) | @Override
FILE: core/src/main/java/io/temporal/samples/countinterceptor/SimpleCountWorkerInterceptor.java
class SimpleCountWorkerInterceptor (line 5) | public class SimpleCountWorkerInterceptor extends WorkerInterceptorBase {
method interceptWorkflow (line 7) | @Override
method interceptActivity (line 12) | @Override
FILE: core/src/main/java/io/temporal/samples/countinterceptor/SimpleCountWorkflowInboundCallsInterceptor.java
class SimpleCountWorkflowInboundCallsInterceptor (line 9) | public class SimpleCountWorkflowInboundCallsInterceptor
method SimpleCountWorkflowInboundCallsInterceptor (line 14) | public SimpleCountWorkflowInboundCallsInterceptor(WorkflowInboundCalls...
method init (line 18) | @Override
method execute (line 24) | @Override
method handleSignal (line 30) | @Override
method handleQuery (line 36) | @Override
FILE: core/src/main/java/io/temporal/samples/countinterceptor/SimpleCountWorkflowOutboundCallsInterceptor.java
class SimpleCountWorkflowOutboundCallsInterceptor (line 7) | public class SimpleCountWorkflowOutboundCallsInterceptor
method SimpleCountWorkflowOutboundCallsInterceptor (line 10) | public SimpleCountWorkflowOutboundCallsInterceptor(WorkflowOutboundCal...
method executeChildWorkflow (line 14) | @Override
FILE: core/src/main/java/io/temporal/samples/countinterceptor/WorkerCounter.java
class WorkerCounter (line 14) | public class WorkerCounter {
method add (line 24) | public static void add(String workflowId, String type) {
method getNumOfWorkflowExecutions (line 38) | public static int getNumOfWorkflowExecutions(String workflowId) {
method getNumOfChildWorkflowExecutions (line 42) | public static int getNumOfChildWorkflowExecutions(String workflowId) {
method getNumOfActivityExecutions (line 46) | public static int getNumOfActivityExecutions(String workflowId) {
method getNumOfSignals (line 50) | public static int getNumOfSignals(String workflowId) {
method getNumOfQueries (line 54) | public static int getNumOfQueries(String workflowId) {
method getInfo (line 58) | public static String getInfo() {
method getDefaultInfoMap (line 81) | private static Map<String, Integer> getDefaultInfoMap() {
FILE: core/src/main/java/io/temporal/samples/countinterceptor/activities/MyActivities.java
type MyActivities (line 5) | @ActivityInterface
method sayHello (line 7) | String sayHello(String name, String title);
method sayGoodBye (line 9) | String sayGoodBye(String name, String title);
FILE: core/src/main/java/io/temporal/samples/countinterceptor/activities/MyActivitiesImpl.java
class MyActivitiesImpl (line 3) | public class MyActivitiesImpl implements MyActivities {
method sayHello (line 4) | @Override
method sayGoodBye (line 9) | @Override
FILE: core/src/main/java/io/temporal/samples/countinterceptor/workflow/MyChildWorkflow.java
type MyChildWorkflow (line 6) | @WorkflowInterface
method execChild (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/countinterceptor/workflow/MyChildWorkflowImpl.java
class MyChildWorkflowImpl (line 8) | public class MyChildWorkflowImpl implements MyChildWorkflow {
method execChild (line 9) | @Override
FILE: core/src/main/java/io/temporal/samples/countinterceptor/workflow/MyWorkflow.java
type MyWorkflow (line 8) | @WorkflowInterface
method exec (line 10) | @WorkflowMethod
method signalNameAndTitle (line 13) | @SignalMethod
method exit (line 16) | @SignalMethod
method queryName (line 19) | @QueryMethod
method queryTitle (line 22) | @QueryMethod
FILE: core/src/main/java/io/temporal/samples/countinterceptor/workflow/MyWorkflowImpl.java
class MyWorkflowImpl (line 7) | public class MyWorkflowImpl implements MyWorkflow {
method exec (line 13) | @Override
method signalNameAndTitle (line 32) | @Override
method queryName (line 38) | @Override
method queryTitle (line 43) | @Override
method exit (line 48) | @Override
FILE: core/src/main/java/io/temporal/samples/customannotation/BenignExceptionTypesAnnotationInterceptor.java
class BenignExceptionTypesAnnotationInterceptor (line 40) | public class BenignExceptionTypesAnnotationInterceptor extends WorkerInt...
method interceptActivity (line 42) | @Override
class ActivityInboundCallsInterceptorAnnotation (line 47) | public static class ActivityInboundCallsInterceptorAnnotation
method ActivityInboundCallsInterceptorAnnotation (line 52) | public ActivityInboundCallsInterceptorAnnotation(ActivityInboundCall...
method init (line 57) | @Override
method execute (line 88) | @Override
FILE: core/src/main/java/io/temporal/samples/customannotation/CustomAnnotation.java
class CustomAnnotation (line 38) | public class CustomAnnotation {
type GreetingWorkflow (line 56) | @WorkflowInterface
method getGreeting (line 63) | @WorkflowMethod
type GreetingActivities (line 77) | @ActivityInterface
method composeGreeting (line 81) | String composeGreeting(String greeting, String name);
class GreetingWorkflowImpl (line 85) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreeting (line 98) | @Override
class GreetingActivitiesImpl (line 109) | static class GreetingActivitiesImpl implements GreetingActivities {
method composeGreeting (line 116) | @Override
method main (line 134) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/customchangeversion/CustomChangeVersionActivities.java
type CustomChangeVersionActivities (line 5) | @ActivityInterface
method customOne (line 7) | String customOne(String input);
method customTwo (line 9) | String customTwo(String input);
method customThree (line 11) | String customThree(String input);
FILE: core/src/main/java/io/temporal/samples/customchangeversion/CustomChangeVersionActivitiesImpl.java
class CustomChangeVersionActivitiesImpl (line 3) | public class CustomChangeVersionActivitiesImpl implements CustomChangeVe...
method customOne (line 4) | @Override
method customTwo (line 9) | @Override
method customThree (line 14) | @Override
FILE: core/src/main/java/io/temporal/samples/customchangeversion/CustomChangeVersionStarter.java
class CustomChangeVersionStarter (line 20) | public class CustomChangeVersionStarter {
method main (line 26) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/customchangeversion/CustomChangeVersionWorkflow.java
type CustomChangeVersionWorkflow (line 6) | @WorkflowInterface
method run (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/customchangeversion/CustomChangeVersionWorkflowImpl.java
class CustomChangeVersionWorkflowImpl (line 15) | public class CustomChangeVersionWorkflowImpl implements CustomChangeVers...
method run (line 23) | @Override
FILE: core/src/main/java/io/temporal/samples/dsl/DslActivities.java
type DslActivities (line 5) | @ActivityInterface
method one (line 7) | String one();
method two (line 9) | String two();
method three (line 11) | String three();
method four (line 13) | String four();
FILE: core/src/main/java/io/temporal/samples/dsl/DslActivitiesImpl.java
class DslActivitiesImpl (line 5) | public class DslActivitiesImpl implements DslActivities {
method one (line 6) | @Override
method two (line 12) | @Override
method three (line 18) | @Override
method four (line 24) | @Override
method sleep (line 30) | private void sleep(int seconds) {
FILE: core/src/main/java/io/temporal/samples/dsl/DslWorkflow.java
type DslWorkflow (line 7) | @WorkflowInterface
method run (line 9) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/dsl/DslWorkflowImpl.java
class DslWorkflowImpl (line 15) | public class DslWorkflowImpl implements DslWorkflow {
method run (line 16) | @Override
method runActions (line 31) | private String runActions(Flow flow, String input) {
FILE: core/src/main/java/io/temporal/samples/dsl/Starter.java
class Starter (line 13) | public class Starter {
method main (line 15) | public static void main(String[] args) {
method getFlowFromResource (line 50) | private static Flow getFlowFromResource() {
FILE: core/src/main/java/io/temporal/samples/dsl/model/Flow.java
class Flow (line 5) | public class Flow {
method Flow (line 11) | public Flow() {}
method Flow (line 13) | public Flow(String id, String name, String description, List<FlowActio...
method getId (line 20) | public String getId() {
method setId (line 24) | public void setId(String id) {
method getName (line 28) | public String getName() {
method setName (line 32) | public void setName(String name) {
method getDescription (line 36) | public String getDescription() {
method setDescription (line 40) | public void setDescription(String description) {
method getActions (line 44) | public List<FlowAction> getActions() {
method setActions (line 48) | public void setActions(List<FlowAction> actions) {
FILE: core/src/main/java/io/temporal/samples/dsl/model/FlowAction.java
class FlowAction (line 3) | public class FlowAction {
method FlowAction (line 10) | public FlowAction() {}
method FlowAction (line 12) | public FlowAction(
method getAction (line 21) | public String getAction() {
method setAction (line 25) | public void setAction(String action) {
method getCompensateBy (line 29) | public String getCompensateBy() {
method setCompensateBy (line 33) | public void setCompensateBy(String compensateBy) {
method getRetries (line 37) | public int getRetries() {
method setRetries (line 41) | public void setRetries(int retries) {
method getStartToCloseSec (line 45) | public int getStartToCloseSec() {
method setStartToCloseSec (line 49) | public void setStartToCloseSec(int startToCloseSec) {
method getNext (line 53) | public int getNext() {
method setNext (line 57) | public void setNext(int next) {
FILE: core/src/main/java/io/temporal/samples/earlyreturn/EarlyReturnClient.java
class EarlyReturnClient (line 9) | public class EarlyReturnClient {
method main (line 13) | public static void main(String[] args) {
method setupWorkflowClient (line 19) | public static WorkflowClient setupWorkflowClient() {
method runWorkflowWithUpdateWithStart (line 34) | private static void runWorkflowWithUpdateWithStart(WorkflowClient clie...
method buildWorkflowOptions (line 73) | private static WorkflowOptions buildWorkflowOptions() {
FILE: core/src/main/java/io/temporal/samples/earlyreturn/EarlyReturnWorker.java
class EarlyReturnWorker (line 7) | public class EarlyReturnWorker {
method main (line 10) | public static void main(String[] args) {
method startWorker (line 15) | private static void startWorker(WorkflowClient client) {
FILE: core/src/main/java/io/temporal/samples/earlyreturn/Transaction.java
class Transaction (line 6) | public final class Transaction {
method Transaction (line 12) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getId (line 24) | @JsonProperty("id")
method getSourceAccount (line 29) | @JsonProperty("sourceAccount")
method getTargetAccount (line 34) | @JsonProperty("targetAccount")
method getAmount (line 39) | @JsonProperty("amount")
method toString (line 44) | @Override
FILE: core/src/main/java/io/temporal/samples/earlyreturn/TransactionActivities.java
type TransactionActivities (line 6) | @ActivityInterface
method mintTransactionId (line 8) | @ActivityMethod
method initTransaction (line 11) | @ActivityMethod
method cancelTransaction (line 14) | @ActivityMethod
method completeTransaction (line 17) | @ActivityMethod
FILE: core/src/main/java/io/temporal/samples/earlyreturn/TransactionActivitiesImpl.java
class TransactionActivitiesImpl (line 5) | public class TransactionActivitiesImpl implements TransactionActivities {
method mintTransactionId (line 7) | @Override
method initTransaction (line 18) | @Override
method cancelTransaction (line 32) | @Override
method completeTransaction (line 39) | @Override
method sleep (line 52) | private void sleep(long millis) {
FILE: core/src/main/java/io/temporal/samples/earlyreturn/TransactionRequest.java
class TransactionRequest (line 6) | public final class TransactionRequest {
method TransactionRequest (line 11) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getSourceAccount (line 21) | @JsonProperty("sourceAccount")
method getTargetAccount (line 26) | @JsonProperty("targetAccount")
method getAmount (line 31) | @JsonProperty("amount")
method toString (line 36) | @Override
FILE: core/src/main/java/io/temporal/samples/earlyreturn/TransactionWorkflow.java
type TransactionWorkflow (line 7) | @WorkflowInterface
method processTransaction (line 9) | @WorkflowMethod
method returnInitResult (line 12) | @UpdateMethod(name = "early-return")
FILE: core/src/main/java/io/temporal/samples/earlyreturn/TransactionWorkflowImpl.java
class TransactionWorkflowImpl (line 9) | public class TransactionWorkflowImpl implements TransactionWorkflow {
method processTransaction (line 20) | @Override
method returnInitResult (line 42) | @Override
FILE: core/src/main/java/io/temporal/samples/earlyreturn/TxResult.java
class TxResult (line 6) | public class TxResult {
method TxResult (line 11) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getTransactionId (line 18) | @JsonProperty("transactionId")
method getStatus (line 23) | @JsonProperty("status")
method toString (line 28) | @Override
FILE: core/src/main/java/io/temporal/samples/encodefailures/CustomerAgeCheck.java
type CustomerAgeCheck (line 6) | @WorkflowInterface
method validateCustomer (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/encodefailures/CustomerAgeCheckImpl.java
class CustomerAgeCheckImpl (line 5) | public class CustomerAgeCheckImpl implements CustomerAgeCheck {
method validateCustomer (line 6) | @Override
FILE: core/src/main/java/io/temporal/samples/encodefailures/InvalidCustomerException.java
class InvalidCustomerException (line 3) | public class InvalidCustomerException extends Exception {
method InvalidCustomerException (line 4) | public InvalidCustomerException(String errorMessage) {
FILE: core/src/main/java/io/temporal/samples/encodefailures/MyCustomer.java
class MyCustomer (line 3) | public class MyCustomer {
method MyCustomer (line 8) | public MyCustomer() {}
method MyCustomer (line 10) | public MyCustomer(String name, int age) {
method getName (line 15) | public String getName() {
method setName (line 19) | public void setName(String name) {
method getAge (line 23) | public int getAge() {
method setAge (line 27) | public void setAge(int age) {
method isApproved (line 31) | public boolean isApproved() {
method setApproved (line 35) | public void setApproved(boolean approved) {
FILE: core/src/main/java/io/temporal/samples/encodefailures/SimplePrefixPayloadCodec.java
class SimplePrefixPayloadCodec (line 15) | public class SimplePrefixPayloadCodec implements PayloadCodec {
method encode (line 19) | @NotNull
method encode (line 25) | private Payload encode(Payload decodedPayload) {
method decode (line 30) | @NotNull
method decode (line 36) | private Payload decode(Payload encodedPayload) {
FILE: core/src/main/java/io/temporal/samples/encodefailures/Starter.java
class Starter (line 19) | public class Starter {
method main (line 23) | public static void main(String[] args) {
method isEncoded (line 88) | private static boolean isEncoded(Payload payload) {
method createWorker (line 92) | private static void createWorker(WorkflowClient client) {
FILE: core/src/main/java/io/temporal/samples/encryptedpayloads/CryptCodec.java
class CryptCodec (line 21) | class CryptCodec implements PayloadCodec {
method encode (line 37) | @NotNull
method decode (line 43) | @NotNull
method encodePayload (line 49) | private Payload encodePayload(Payload payload) {
method decodePayload (line 68) | private Payload decodePayload(Payload payload) {
method getKeyId (line 94) | private String getKeyId() {
method getKey (line 103) | private SecretKey getKey(String keyId) {
method getNonce (line 109) | private static byte[] getNonce(int size) {
method encrypt (line 115) | private byte[] encrypt(byte[] plainData, SecretKey key) throws Excepti...
method decrypt (line 128) | private byte[] decrypt(byte[] encryptedDataWithNonce, SecretKey key) t...
FILE: core/src/main/java/io/temporal/samples/encryptedpayloads/EncryptedPayloadsActivity.java
class EncryptedPayloadsActivity (line 26) | public class EncryptedPayloadsActivity {
type GreetingWorkflow (line 31) | @WorkflowInterface
method getGreeting (line 33) | @WorkflowMethod
type GreetingActivities (line 38) | @ActivityInterface
method composeGreeting (line 40) | @ActivityMethod
class GreetingWorkflowImpl (line 45) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreeting (line 57) | @Override
class GreetingActivitiesImpl (line 64) | static class GreetingActivitiesImpl implements GreetingActivities {
method composeGreeting (line 65) | @Override
method main (line 71) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/envconfig/LoadFromFile.java
class LoadFromFile (line 17) | public class LoadFromFile {
method main (line 21) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/envconfig/LoadProfile.java
class LoadProfile (line 18) | public class LoadProfile {
method main (line 22) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/excludefrominterceptor/RunMyWorkflows.java
class RunMyWorkflows (line 19) | public class RunMyWorkflows {
method main (line 20) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/excludefrominterceptor/activities/ForInterceptorActivities.java
type ForInterceptorActivities (line 5) | @ActivityInterface
method forInterceptorActivityOne (line 7) | void forInterceptorActivityOne(Object output);
method forInterceptorActivityTwo (line 9) | void forInterceptorActivityTwo(Object output);
FILE: core/src/main/java/io/temporal/samples/excludefrominterceptor/activities/ForInterceptorActivitiesImpl.java
class ForInterceptorActivitiesImpl (line 3) | public class ForInterceptorActivitiesImpl implements ForInterceptorActiv...
method forInterceptorActivityOne (line 4) | @Override
method forInterceptorActivityTwo (line 7) | @Override
FILE: core/src/main/java/io/temporal/samples/excludefrominterceptor/activities/MyActivities.java
type MyActivities (line 5) | @ActivityInterface
method activityOne (line 7) | void activityOne(String input);
method activityTwo (line 9) | void activityTwo(String input);
FILE: core/src/main/java/io/temporal/samples/excludefrominterceptor/activities/MyActivitiesImpl.java
class MyActivitiesImpl (line 3) | public class MyActivitiesImpl implements MyActivities {
method activityOne (line 4) | @Override
method activityTwo (line 7) | @Override
FILE: core/src/main/java/io/temporal/samples/excludefrominterceptor/interceptor/MyActivityInboundCallsInterceptor.java
class MyActivityInboundCallsInterceptor (line 9) | public class MyActivityInboundCallsInterceptor extends ActivityInboundCa...
method MyActivityInboundCallsInterceptor (line 14) | public MyActivityInboundCallsInterceptor(ActivityInboundCallsIntercept...
method MyActivityInboundCallsInterceptor (line 18) | public MyActivityInboundCallsInterceptor(
method init (line 24) | @Override
method execute (line 30) | @Override
FILE: core/src/main/java/io/temporal/samples/excludefrominterceptor/interceptor/MyWorkerInterceptor.java
class MyWorkerInterceptor (line 7) | public class MyWorkerInterceptor extends WorkerInterceptorBase {
method MyWorkerInterceptor (line 11) | public MyWorkerInterceptor() {}
method MyWorkerInterceptor (line 13) | public MyWorkerInterceptor(List<String> excludeWorkflowTypes) {
method MyWorkerInterceptor (line 17) | public MyWorkerInterceptor(List<String> excludeWorkflowTypes, List<Str...
method interceptWorkflow (line 22) | @Override
method interceptActivity (line 27) | @Override
FILE: core/src/main/java/io/temporal/samples/excludefrominterceptor/interceptor/MyWorkflowInboundCallsInterceptor.java
class MyWorkflowInboundCallsInterceptor (line 14) | public class MyWorkflowInboundCallsInterceptor extends WorkflowInboundCa...
method MyWorkflowInboundCallsInterceptor (line 22) | public MyWorkflowInboundCallsInterceptor(WorkflowInboundCallsIntercept...
method MyWorkflowInboundCallsInterceptor (line 26) | public MyWorkflowInboundCallsInterceptor(
method init (line 32) | @Override
method execute (line 38) | @Override
FILE: core/src/main/java/io/temporal/samples/excludefrominterceptor/interceptor/MyWorkflowOutboundCallsInterceptor.java
class MyWorkflowOutboundCallsInterceptor (line 12) | public class MyWorkflowOutboundCallsInterceptor extends WorkflowOutbound...
method MyWorkflowOutboundCallsInterceptor (line 19) | public MyWorkflowOutboundCallsInterceptor(WorkflowOutboundCallsInterce...
method MyWorkflowOutboundCallsInterceptor (line 23) | public MyWorkflowOutboundCallsInterceptor(
method executeActivity (line 29) | @Override
FILE: core/src/main/java/io/temporal/samples/excludefrominterceptor/workflows/MyWorkflow.java
type MyWorkflow (line 5) | public interface MyWorkflow {
method execute (line 6) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/excludefrominterceptor/workflows/MyWorkflowOne.java
type MyWorkflowOne (line 5) | @WorkflowInterface
FILE: core/src/main/java/io/temporal/samples/excludefrominterceptor/workflows/MyWorkflowOneImpl.java
class MyWorkflowOneImpl (line 8) | public class MyWorkflowOneImpl implements MyWorkflowOne {
method execute (line 14) | @Override
FILE: core/src/main/java/io/temporal/samples/excludefrominterceptor/workflows/MyWorkflowTwo.java
type MyWorkflowTwo (line 5) | @WorkflowInterface
FILE: core/src/main/java/io/temporal/samples/excludefrominterceptor/workflows/MyWorkflowTwoImpl.java
class MyWorkflowTwoImpl (line 8) | public class MyWorkflowTwoImpl implements MyWorkflowTwo {
method execute (line 14) | @Override
FILE: core/src/main/java/io/temporal/samples/fileprocessing/FileProcessingStarter.java
class FileProcessingStarter (line 13) | public class FileProcessingStarter {
method main (line 15) | public static void main(String[] args) throws Exception {
FILE: core/src/main/java/io/temporal/samples/fileprocessing/FileProcessingWorker.java
class FileProcessingWorker (line 18) | public class FileProcessingWorker {
method main (line 22) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/fileprocessing/FileProcessingWorkflow.java
type FileProcessingWorkflow (line 8) | @WorkflowInterface
method processFile (line 10) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/fileprocessing/FileProcessingWorkflowImpl.java
class FileProcessingWorkflowImpl (line 18) | public class FileProcessingWorkflowImpl implements FileProcessingWorkflow {
method FileProcessingWorkflowImpl (line 23) | public FileProcessingWorkflowImpl() {
method processFile (line 38) | @Override
method processFileImpl (line 46) | private void processFileImpl(URL source, URL destination) {
FILE: core/src/main/java/io/temporal/samples/fileprocessing/StoreActivities.java
type StoreActivities (line 6) | @ActivityInterface
class TaskQueueFileNamePair (line 9) | final class TaskQueueFileNamePair {
method TaskQueueFileNamePair (line 13) | public TaskQueueFileNamePair(String hostTaskQueue, String fileName) {
method TaskQueueFileNamePair (line 19) | public TaskQueueFileNamePair() {}
method getHostTaskQueue (line 21) | public String getHostTaskQueue() {
method getFileName (line 25) | public String getFileName() {
method upload (line 36) | void upload(String localFileName, URL url);
method process (line 43) | String process(String inputFileName);
method download (line 51) | TaskQueueFileNamePair download(URL url);
FILE: core/src/main/java/io/temporal/samples/fileprocessing/StoreActivitiesImpl.java
class StoreActivitiesImpl (line 11) | public class StoreActivitiesImpl implements StoreActivities {
method StoreActivitiesImpl (line 15) | public StoreActivitiesImpl(String taskQueue) {
method download (line 19) | @Override
method process (line 34) | @Override
method processFileImpl (line 46) | @SuppressWarnings("deprecation")
method upload (line 56) | @Override
FILE: core/src/main/java/io/temporal/samples/getresultsasync/MyWorkflow.java
type MyWorkflow (line 6) | @WorkflowInterface
method justSleep (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/getresultsasync/MyWorkflowImpl.java
class MyWorkflowImpl (line 6) | public class MyWorkflowImpl implements MyWorkflow {
method justSleep (line 7) | @Override
FILE: core/src/main/java/io/temporal/samples/getresultsasync/Starter.java
class Starter (line 8) | public class Starter {
method main (line 14) | @SuppressWarnings("FutureReturnValueIgnored")
method sleep (line 57) | private static void sleep(int seconds) {
FILE: core/src/main/java/io/temporal/samples/getresultsasync/Worker.java
class Worker (line 9) | public class Worker {
method main (line 30) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloAccumulator.java
class HelloAccumulator (line 50) | public class HelloAccumulator {
class Greeting (line 58) | public static class Greeting implements Serializable {
method getGreetingText (line 63) | public String getGreetingText() {
method setGreetingText (line 67) | public void setGreetingText(String greetingText) {
method getBucket (line 71) | public String getBucket() {
method setBucket (line 75) | public void setBucket(String bucket) {
method getGreetingKey (line 79) | public String getGreetingKey() {
method setGreetingKey (line 83) | public void setGreetingKey(String greetingKey) {
method Greeting (line 87) | public Greeting(String greetingText, String bucket, String greetingK...
method Greeting (line 93) | public Greeting() {}
method toString (line 95) | @Override
type AccumulatorWorkflow (line 117) | @WorkflowInterface
method accumulateGreetings (line 123) | @WorkflowMethod
method sendGreeting (line 129) | @SignalMethod
method exit (line 134) | @SignalMethod
type GreetingActivities (line 148) | @ActivityInterface
method composeGreeting (line 150) | String composeGreeting(Deque<Greeting> greetings);
class GreetingActivitiesImpl (line 154) | static class GreetingActivitiesImpl implements GreetingActivities {
method composeGreeting (line 157) | @Override
class AccumulatorWorkflowImpl (line 166) | public static class AccumulatorWorkflowImpl implements AccumulatorWork...
method accumulateGreetings (line 180) | @Override
method processGreeting (line 243) | public void processGreeting(Greeting greeting) {
method processGreetings (line 267) | private String processGreetings(Deque<Greeting> greetings) {
method sendGreeting (line 274) | @Override
method exit (line 285) | @Override
method main (line 296) | public static void main(String[] args) throws Exception {
method printWorkflowStatus (line 579) | private static void printWorkflowStatus(WorkflowClient client, String ...
method getWorkflowStatus (line 600) | private static String getWorkflowStatus(WorkflowClient client, String ...
FILE: core/src/main/java/io/temporal/samples/hello/HelloActivity.java
class HelloActivity (line 21) | public class HelloActivity {
type GreetingWorkflow (line 39) | @WorkflowInterface
method getGreeting (line 46) | @WorkflowMethod
type GreetingActivities (line 60) | @ActivityInterface
method composeGreeting (line 64) | @ActivityMethod(name = "greet")
class GreetingWorkflowImpl (line 69) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreeting (line 86) | @Override
class GreetingActivitiesImpl (line 94) | public static class GreetingActivitiesImpl implements GreetingActiviti...
method composeGreeting (line 97) | @Override
method main (line 108) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloActivityExclusiveChoice.java
class HelloActivityExclusiveChoice (line 23) | public class HelloActivityExclusiveChoice {
type Fruits (line 32) | enum Fruits {
class ShoppingList (line 40) | public static class ShoppingList {
method addFruitOrder (line 43) | public void addFruitOrder(Fruits fruit, int amount) {
method getList (line 47) | public Map<Fruits, Integer> getList() {
type PurchaseFruitsWorkflow (line 59) | @WorkflowInterface
method orderFruit (line 66) | @WorkflowMethod
type OrderFruitsActivities (line 77) | @ActivityInterface
method orderApples (line 81) | String orderApples(int amount);
method orderBananas (line 83) | String orderBananas(int amount);
method orderCherries (line 85) | String orderCherries(int amount);
method orderOranges (line 87) | String orderOranges(int amount);
class PurchaseFruitsWorkflowImpl (line 91) | public static class PurchaseFruitsWorkflowImpl implements PurchaseFrui...
method orderFruit (line 106) | @Override
class OrderFruitsActivitiesImpl (line 139) | static class OrderFruitsActivitiesImpl implements OrderFruitsActivities {
method orderApples (line 140) | @Override
method orderBananas (line 145) | @Override
method orderCherries (line 150) | @Override
method orderOranges (line 155) | @Override
method main (line 165) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloActivityRetry.java
class HelloActivityRetry (line 19) | public class HelloActivityRetry {
type GreetingWorkflow (line 37) | @WorkflowInterface
method getGreeting (line 44) | @WorkflowMethod
type GreetingActivities (line 58) | @ActivityInterface
method composeGreeting (line 62) | String composeGreeting(String greeting, String name);
class GreetingWorkflowImpl (line 66) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreeting (line 97) | @Override
class GreetingActivitiesImpl (line 108) | static class GreetingActivitiesImpl implements GreetingActivities {
method composeGreeting (line 116) | @Override
method main (line 143) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloAsync.java
class HelloAsync (line 20) | public class HelloAsync {
type GreetingWorkflow (line 38) | @WorkflowInterface
method getGreeting (line 45) | @WorkflowMethod
type GreetingActivities (line 59) | @ActivityInterface
method composeGreeting (line 63) | String composeGreeting(String greeting, String name);
class GreetingWorkflowImpl (line 67) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreeting (line 84) | @Override
class GreetingActivitiesImpl (line 102) | static class GreetingActivitiesImpl implements GreetingActivities {
method composeGreeting (line 103) | @Override
method main (line 113) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloAsyncActivityCompletion.java
class HelloAsyncActivityCompletion (line 21) | public class HelloAsyncActivityCompletion {
type GreetingWorkflow (line 39) | @WorkflowInterface
method getGreeting (line 46) | @WorkflowMethod
type GreetingActivities (line 60) | @ActivityInterface
method composeGreeting (line 64) | String composeGreeting(String greeting, String name);
class GreetingWorkflowImpl (line 68) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreeting (line 85) | @Override
class GreetingActivitiesImpl (line 96) | static class GreetingActivitiesImpl implements GreetingActivities {
method GreetingActivitiesImpl (line 107) | GreetingActivitiesImpl(ActivityCompletionClient completionClient) {
method composeGreeting (line 111) | @Override
method composeGreetingAsync (line 134) | private void composeGreetingAsync(byte[] taskToken, String greeting,...
method main (line 146) | public static void main(String[] args) throws ExecutionException, Inte...
FILE: core/src/main/java/io/temporal/samples/hello/HelloAsyncLambda.java
class HelloAsyncLambda (line 20) | public class HelloAsyncLambda {
type GreetingWorkflow (line 38) | @WorkflowInterface
method getGreeting (line 45) | @WorkflowMethod
type GreetingActivities (line 59) | @ActivityInterface
method getGreeting (line 61) | String getGreeting();
method composeGreeting (line 63) | String composeGreeting(String greeting, String name);
class GreetingWorkflowImpl (line 67) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreeting (line 84) | @Override
class GreetingActivitiesImpl (line 114) | static class GreetingActivitiesImpl implements GreetingActivities {
method getGreeting (line 116) | @Override
method composeGreeting (line 121) | @Override
method main (line 131) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloAwait.java
class HelloAwait (line 22) | public class HelloAwait {
type GreetingWorkflow (line 40) | @WorkflowInterface
method getGreeting (line 46) | @WorkflowMethod
method waitForName (line 51) | @SignalMethod
class GreetingWorkflowImpl (line 56) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreeting (line 60) | @Override
method waitForName (line 73) | @Override
method main (line 83) | public static void main(String[] args) throws Exception {
FILE: core/src/main/java/io/temporal/samples/hello/HelloCancellationScope.java
class HelloCancellationScope (line 36) | public class HelloCancellationScope {
type GreetingWorkflow (line 54) | @WorkflowInterface
method getGreeting (line 61) | @WorkflowMethod
type GreetingActivities (line 75) | @ActivityInterface
method composeGreeting (line 77) | String composeGreeting(String greeting, String name);
class GreetingWorkflowImpl (line 81) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreeting (line 119) | @Override
class GreetingActivitiesImpl (line 172) | static class GreetingActivitiesImpl implements GreetingActivities {
method composeGreeting (line 174) | @Override
method sleep (line 221) | private void sleep(int seconds) {
method main (line 234) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloCancellationScopeWithTimer.java
class HelloCancellationScopeWithTimer (line 18) | public class HelloCancellationScopeWithTimer {
type CancellationWithTimerWorkflow (line 35) | @WorkflowInterface
method execute (line 42) | @WorkflowMethod
type UpdateInfoActivities (line 56) | @ActivityInterface
method updateInfo (line 58) | String updateInfo(String input);
class CancellationWithTimerWorkflowImpl (line 62) | public static class CancellationWithTimerWorkflowImpl implements Cance...
method execute (line 76) | @Override
class UpdateInfoActivitiesImpl (line 121) | static class UpdateInfoActivitiesImpl implements UpdateInfoActivities {
method updateInfo (line 123) | @Override
method sleep (line 142) | private void sleep(int seconds) {
method main (line 155) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloChild.java
class HelloChild (line 21) | public class HelloChild {
type GreetingWorkflow (line 35) | @WorkflowInterface
method getGreeting (line 42) | @WorkflowMethod
type GreetingChild (line 52) | @WorkflowInterface
method composeGreeting (line 59) | @WorkflowMethod
class GreetingWorkflowImpl (line 64) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreeting (line 66) | @Override
class GreetingChildImpl (line 96) | public static class GreetingChildImpl implements GreetingChild {
method composeGreeting (line 98) | @Override
method main (line 108) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloCron.java
class HelloCron (line 25) | public class HelloCron {
type GreetingWorkflow (line 43) | @WorkflowInterface
method greet (line 50) | @WorkflowMethod
type GreetingActivities (line 64) | @ActivityInterface
method greet (line 68) | void greet(String greeting);
class GreetingWorkflowImpl (line 72) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method greet (line 89) | @Override
class GreetingActivitiesImpl (line 99) | static class GreetingActivitiesImpl implements GreetingActivities {
method greet (line 100) | @Override
method main (line 111) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloDelayedStart.java
class HelloDelayedStart (line 17) | public class HelloDelayedStart {
type DelayedStartWorkflow (line 34) | @WorkflowInterface
method start (line 41) | @WorkflowMethod
class DelayedStartWorkflowImpl (line 46) | public static class DelayedStartWorkflowImpl implements DelayedStartWo...
method start (line 47) | @Override
method main (line 54) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloDetachedCancellationScope.java
class HelloDetachedCancellationScope (line 26) | public class HelloDetachedCancellationScope {
type GreetingWorkflow (line 44) | @WorkflowInterface
method getGreeting (line 51) | @WorkflowMethod
method queryGreeting (line 55) | @QueryMethod
type GreetingActivities (line 69) | @ActivityInterface
method sayHello (line 71) | String sayHello(String name);
method sayGoodBye (line 73) | String sayGoodBye(String name);
class GreetingActivitiesImpl (line 77) | static class GreetingActivitiesImpl implements GreetingActivities {
method sayHello (line 78) | @Override
method sayGoodBye (line 94) | @Override
class GreetingWorkflowImpl (line 101) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreeting (line 113) | @Override
method queryGreeting (line 128) | @Override
method main (line 134) | public static void main(String[] args) throws InterruptedException {
FILE: core/src/main/java/io/temporal/samples/hello/HelloDynamic.java
class HelloDynamic (line 21) | public class HelloDynamic {
class DynamicGreetingWorkflowImpl (line 29) | public static class DynamicGreetingWorkflowImpl implements DynamicWork...
method execute (line 32) | @Override
class DynamicGreetingActivityImpl (line 56) | public static class DynamicGreetingActivityImpl implements DynamicActi...
method execute (line 57) | @Override
method main (line 74) | public static void main(String[] arg) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloEagerWorkflowStart.java
class HelloEagerWorkflowStart (line 26) | public class HelloEagerWorkflowStart {
type GreetingWorkflow (line 44) | @WorkflowInterface
method getGreeting (line 51) | @WorkflowMethod
type GreetingActivities (line 65) | @ActivityInterface
method composeGreeting (line 69) | @ActivityMethod(name = "greet")
class GreetingWorkflowImpl (line 74) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreeting (line 91) | @Override
class GreetingLocalActivitiesImpl (line 99) | static class GreetingLocalActivitiesImpl implements GreetingActivities {
method composeGreeting (line 102) | @Override
method main (line 113) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloException.java
class HelloException (line 25) | public class HelloException {
type GreetingWorkflow (line 39) | @WorkflowInterface
method getGreeting (line 46) | @WorkflowMethod
type GreetingChild (line 56) | @WorkflowInterface
method composeGreeting (line 63) | @WorkflowMethod
type GreetingActivities (line 77) | @ActivityInterface
method composeGreeting (line 80) | String composeGreeting(String greeting, String name);
class GreetingWorkflowImpl (line 84) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreeting (line 86) | @Override
class GreetingChildImpl (line 97) | public static class GreetingChildImpl implements GreetingChild {
method composeGreeting (line 122) | @Override
class GreetingActivitiesImpl (line 132) | static class GreetingActivitiesImpl implements GreetingActivities {
method composeGreeting (line 133) | @Override
method main (line 155) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloLocalActivity.java
class HelloLocalActivity (line 38) | public class HelloLocalActivity {
type GreetingWorkflow (line 52) | @WorkflowInterface
method getGreeting (line 54) | @WorkflowMethod
type GreetingActivities (line 59) | @ActivityInterface
method composeGreeting (line 61) | @ActivityMethod
class GreetingWorkflowImpl (line 66) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreeting (line 80) | @Override
class GreetingLocalActivityImpl (line 87) | static class GreetingLocalActivityImpl implements GreetingActivities {
method composeGreeting (line 88) | @Override
method main (line 94) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloParallelActivity.java
class HelloParallelActivity (line 19) | public class HelloParallelActivity {
type MultiGreetingWorkflow (line 37) | @WorkflowInterface
method getGreetings (line 44) | @WorkflowMethod
type GreetingActivities (line 58) | @ActivityInterface
method composeGreeting (line 62) | String composeGreeting(String greeting, String name);
class GreetingActivitiesImpl (line 66) | static class GreetingActivitiesImpl implements GreetingActivities {
method composeGreeting (line 67) | @Override
class MultiGreetingWorkflowImpl (line 74) | public static class MultiGreetingWorkflowImpl implements MultiGreeting...
method getGreetings (line 91) | @Override
method main (line 119) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloPeriodic.java
class HelloPeriodic (line 27) | public class HelloPeriodic {
type GreetingWorkflow (line 45) | @WorkflowInterface
method greetPeriodically (line 52) | @WorkflowMethod
method requestExit (line 56) | @SignalMethod
type GreetingActivities (line 70) | @ActivityInterface
method greet (line 74) | void greet(String greeting);
class GreetingWorkflowImpl (line 78) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method requestExit (line 121) | @Override
method greetPeriodically (line 126) | @Override
class GreetingActivitiesImpl (line 172) | static class GreetingActivitiesImpl implements GreetingActivities {
method greet (line 173) | @Override
method main (line 184) | @SuppressWarnings(
FILE: core/src/main/java/io/temporal/samples/hello/HelloPolymorphicActivity.java
class HelloPolymorphicActivity (line 21) | public class HelloPolymorphicActivity {
type GreetingWorkflow (line 39) | @WorkflowInterface
method getGreeting (line 46) | @WorkflowMethod
type GreetingActivity (line 52) | public interface GreetingActivity {
method composeGreeting (line 53) | String composeGreeting(String name);
type HelloActivity (line 67) | @ActivityInterface(namePrefix = "Hello_")
method composeGreeting (line 69) | @Override
type ByeActivity (line 84) | @ActivityInterface(namePrefix = "Bye_")
method composeGreeting (line 86) | @Override
class GreetingWorkflowImpl (line 91) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreeting (line 114) | @Override
class HelloActivityImpl (line 134) | static class HelloActivityImpl implements HelloActivity {
method composeGreeting (line 135) | @Override
class ByeActivityImpl (line 142) | static class ByeActivityImpl implements ByeActivity {
method composeGreeting (line 143) | @Override
method main (line 153) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloQuery.java
class HelloQuery (line 17) | public class HelloQuery {
type GreetingWorkflow (line 35) | @WorkflowInterface
method createGreeting (line 38) | @WorkflowMethod
method queryGreeting (line 42) | @QueryMethod
class GreetingWorkflowImpl (line 48) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method createGreeting (line 52) | @Override
method queryGreeting (line 71) | @Override
method main (line 81) | public static void main(String[] args) throws InterruptedException {
FILE: core/src/main/java/io/temporal/samples/hello/HelloSaga.java
class HelloSaga (line 30) | public class HelloSaga {
type ChildWorkflowOperation (line 44) | @WorkflowInterface
method execute (line 51) | @WorkflowMethod
class ChildWorkflowOperationImpl (line 56) | public static class ChildWorkflowOperationImpl implements ChildWorkflo...
method execute (line 73) | @Override
type ChildWorkflowCompensation (line 86) | @WorkflowInterface
method compensate (line 94) | @WorkflowMethod
class ChildWorkflowCompensationImpl (line 100) | public static class ChildWorkflowCompensationImpl implements ChildWork...
method compensate (line 117) | @Override
type ActivityOperation (line 133) | @ActivityInterface
method execute (line 135) | @ActivityMethod
method compensate (line 138) | @ActivityMethod
class ActivityOperationImpl (line 146) | public static class ActivityOperationImpl implements ActivityOperation {
method execute (line 148) | @Override
method compensate (line 153) | @Override
type SagaWorkflow (line 165) | @WorkflowInterface
method execute (line 172) | @WorkflowMethod
class SagaWorkflowImpl (line 177) | public static class SagaWorkflowImpl implements SagaWorkflow {
method execute (line 193) | @Override
method main (line 261) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloSchedules.java
class HelloSchedules (line 29) | public class HelloSchedules {
type GreetingWorkflow (line 50) | @WorkflowInterface
method greet (line 57) | @WorkflowMethod
type GreetingActivities (line 71) | @ActivityInterface
method greet (line 75) | void greet(String greeting);
class GreetingWorkflowImpl (line 79) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method greet (line 96) | @Override
class GreetingActivitiesImpl (line 121) | static class GreetingActivitiesImpl implements GreetingActivities {
method greet (line 122) | @Override
method main (line 133) | public static void main(String[] args) throws InterruptedException {
FILE: core/src/main/java/io/temporal/samples/hello/HelloSearchAttributes.java
class HelloSearchAttributes (line 33) | public class HelloSearchAttributes {
type GreetingWorkflow (line 51) | @WorkflowInterface
method getGreeting (line 58) | @WorkflowMethod
type GreetingActivities (line 72) | @ActivityInterface
method composeGreeting (line 74) | @ActivityMethod
class GreetingWorkflowImpl (line 79) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreeting (line 94) | @Override
class GreetingActivitiesImpl (line 105) | static class GreetingActivitiesImpl implements GreetingActivities {
method composeGreeting (line 106) | @Override
method main (line 116) | public static void main(String[] args) {
method generateSearchAttributes (line 211) | private static Map<String, Object> generateSearchAttributes() {
method generateDateTimeFieldValue (line 227) | private static String generateDateTimeFieldValue() {
method getKeywordFromSearchAttribute (line 233) | static String getKeywordFromSearchAttribute(SearchAttributes searchAtt...
FILE: core/src/main/java/io/temporal/samples/hello/HelloSideEffect.java
class HelloSideEffect (line 33) | public class HelloSideEffect {
type SideEffectWorkflow (line 51) | @WorkflowInterface
method execute (line 58) | @WorkflowMethod
method getResult (line 61) | @QueryMethod
type SideEffectActivities (line 75) | @ActivityInterface
method sayHello (line 79) | String sayHello(String greeting);
method sayGoodBye (line 81) | String sayGoodBye(String greeting);
class SideEffectWorkflowImpl (line 85) | public static class SideEffectWorkflowImpl implements SideEffectWorkfl...
method execute (line 105) | @Override
method getResult (line 139) | @Override
class SideEffectActivitiesImpl (line 146) | static class SideEffectActivitiesImpl implements SideEffectActivities {
method sayHello (line 147) | @Override
method sayGoodBye (line 152) | @Override
method main (line 162) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloSignal.java
class HelloSignal (line 21) | public class HelloSignal {
type GreetingWorkflow (line 39) | @WorkflowInterface
method getGreetings (line 45) | @WorkflowMethod
method waitForName (line 50) | @SignalMethod
method exit (line 55) | @SignalMethod
class GreetingWorkflowImpl (line 60) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreetings (line 66) | @Override
method waitForName (line 82) | @Override
method exit (line 87) | @Override
method main (line 97) | public static void main(String[] args) throws Exception {
FILE: core/src/main/java/io/temporal/samples/hello/HelloSignalWithStartAndWorkflowInit.java
class HelloSignalWithStartAndWorkflowInit (line 25) | public class HelloSignalWithStartAndWorkflowInit {
type MyWorkflow (line 28) | public interface MyWorkflow {
method greet (line 29) | @WorkflowMethod
method addGreeting (line 32) | @SignalMethod
type MyWorkflowWithInit (line 36) | @WorkflowInterface
type MyWorkflowNoInit (line 39) | @WorkflowInterface
class WithInitMyWorkflowImpl (line 42) | public static class WithInitMyWorkflowImpl implements MyWorkflowWithIn...
method WithInitMyWorkflowImpl (line 50) | @WorkflowInit
method greet (line 55) | @Override
method addGreeting (line 68) | @Override
class WithoutInitMyWorkflowImpl (line 74) | public static class WithoutInitMyWorkflowImpl implements MyWorkflowNoI...
method greet (line 82) | @Override
method addGreeting (line 95) | @Override
type MyGreetingActivities (line 101) | @ActivityInterface
method greet (line 103) | public String greet(Person person);
class MyGreetingActivitiesImpl (line 106) | public static class MyGreetingActivitiesImpl implements MyGreetingActi...
method greet (line 107) | @Override
class Person (line 113) | public static class Person {
method Person (line 118) | public Person() {}
method Person (line 120) | public Person(String firstName, String lastName, int age) {
method getFirstName (line 126) | public String getFirstName() {
method setFirstName (line 130) | public void setFirstName(String firstName) {
method getLastName (line 134) | public String getLastName() {
method setLastName (line 138) | public void setLastName(String lastName) {
method getAge (line 142) | public int getAge() {
method setAge (line 146) | public void setAge(int age) {
method main (line 151) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloSignalWithTimer.java
class HelloSignalWithTimer (line 22) | public class HelloSignalWithTimer {
type SignalWithTimerWorkflow (line 26) | @WorkflowInterface
method execute (line 28) | @WorkflowMethod
method newValue (line 31) | @SignalMethod
method exit (line 34) | @SignalMethod
type ValueProcessingActivities (line 38) | @ActivityInterface
method processValue (line 40) | void processValue(String value);
class SignalWithTimerWorkflowImpl (line 43) | public static class SignalWithTimerWorkflowImpl implements SignalWithT...
method execute (line 55) | @Override
method newValue (line 91) | @Override
method exit (line 102) | @Override
class ValueProcessingActivitiesImpl (line 111) | static class ValueProcessingActivitiesImpl implements ValueProcessingA...
method processValue (line 112) | @Override
method main (line 120) | public static void main(String[] args) {
method sleep (line 166) | private static void sleep(int seconds) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloStandaloneActivity.java
class HelloStandaloneActivity (line 27) | public class HelloStandaloneActivity {
type GreetingActivities (line 39) | @ActivityInterface
method composeGreeting (line 43) | @ActivityMethod
class GreetingActivitiesImpl (line 48) | public static class GreetingActivitiesImpl implements GreetingActiviti...
method composeGreeting (line 52) | @Override
method main (line 59) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/hello/HelloTypedSearchAttributes.java
class HelloTypedSearchAttributes (line 39) | public class HelloTypedSearchAttributes {
type GreetingWorkflow (line 73) | @WorkflowInterface
method getGreeting (line 80) | @WorkflowMethod
type GreetingActivities (line 94) | @ActivityInterface
method composeGreeting (line 96) | @ActivityMethod
class GreetingWorkflowImpl (line 101) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreeting (line 116) | @Override
class GreetingActivitiesImpl (line 136) | static class GreetingActivitiesImpl implements GreetingActivities {
method composeGreeting (line 137) | @Override
method main (line 152) | public static void main(String[] args) {
method generateTypedSearchAttributes (line 221) | private static io.temporal.common.SearchAttributes generateTypedSearch...
FILE: core/src/main/java/io/temporal/samples/hello/HelloUpdate.java
class HelloUpdate (line 35) | public class HelloUpdate {
type GreetingWorkflow (line 53) | @WorkflowInterface
method getGreetings (line 59) | @WorkflowMethod
method addGreeting (line 66) | @UpdateMethod
method addGreetingValidator (line 75) | @UpdateValidatorMethod(updateName = "addGreeting")
method exit (line 80) | @SignalMethod
class GreetingWorkflowImpl (line 85) | public static class GreetingWorkflowImpl implements GreetingWorkflow {
method getGreetings (line 97) | @Override
method addGreeting (line 117) | @Override
method addGreetingValidator (line 135) | @Override
method exit (line 150) | @Override
method main (line 160) | public static void main(String[] args) throws Exception {
FILE: core/src/main/java/io/temporal/samples/hello/HelloWorkflowTimer.java
class HelloWorkflowTimer (line 20) | public class HelloWorkflowTimer {
type WorkflowWithTimer (line 27) | @WorkflowInterface
method execute (line 29) | @WorkflowMethod
class WorkflowWithTimerImpl (line 33) | public static class WorkflowWithTimerImpl implements WorkflowWithTimer {
method execute (line 42) | @Override
type WorkflowWithTimerActivities (line 139) | @ActivityInterface
method sayHello (line 141) | String sayHello(String input);
class WorkflowWithTimerActivitiesImpl (line 144) | public static class WorkflowWithTimerActivitiesImpl implements Workflo...
method sayHello (line 145) | @Override
method sleep (line 161) | private void sleep(int seconds) {
type WorkflowWithTimerChildWorkflow (line 171) | @WorkflowInterface
method executeChild (line 173) | @WorkflowMethod
class WorkflowWithTimerChildWorkflowImpl (line 177) | public static class WorkflowWithTimerChildWorkflowImpl implements Work...
method executeChild (line 178) | @Override
method main (line 194) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/keymanagementencryption/awsencryptionsdk/EncryptedPayloads.java
class EncryptedPayloads (line 20) | public class EncryptedPayloads {
method main (line 24) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/keymanagementencryption/awsencryptionsdk/KeyringCodec.java
class KeyringCodec (line 28) | class KeyringCodec implements PayloadCodec {
method KeyringCodec (line 44) | public KeyringCodec(IKeyring kmsKeyring) {
method KeyringCodec (line 59) | public KeyringCodec(AwsCrypto crypto, IKeyring kmsKeyring, boolean use...
method KeyringCodec (line 66) | private KeyringCodec(
method encode (line 74) | @NotNull
method decode (line 83) | @NotNull
method withContext (line 92) | @NotNull
method getEncryptionContext (line 101) | private Map<String, String> getEncryptionContext() {
method encodePayload (line 119) | private Payload encodePayload(Payload payload) {
method decodePayload (line 129) | private Payload decodePayload(Payload payload) {
FILE: core/src/main/java/io/temporal/samples/listworkflows/Customer.java
class Customer (line 3) | public class Customer {
method Customer (line 9) | public Customer() {}
method Customer (line 11) | public Customer(String accountNum, String name, String email, String c...
method getAccountNum (line 18) | public String getAccountNum() {
method setAccountNum (line 22) | public void setAccountNum(String accountNum) {
method getName (line 26) | public String getName() {
method setName (line 30) | public void setName(String name) {
method getEmail (line 34) | public String getEmail() {
method setEmail (line 38) | public void setEmail(String email) {
method getCustomerType (line 42) | public String getCustomerType() {
method setCustomerType (line 46) | public void setCustomerType(String customerType) {
FILE: core/src/main/java/io/temporal/samples/listworkflows/CustomerActivities.java
type CustomerActivities (line 5) | @ActivityInterface
method getCustomerAccount (line 7) | void getCustomerAccount(Customer customer);
method updateCustomerAccount (line 9) | void updateCustomerAccount(Customer customer, String message);
method sendUpdateEmail (line 11) | void sendUpdateEmail(Customer customer);
FILE: core/src/main/java/io/temporal/samples/listworkflows/CustomerActivitiesImpl.java
class CustomerActivitiesImpl (line 7) | public class CustomerActivitiesImpl implements CustomerActivities {
method getCustomerAccount (line 11) | @Override
method updateCustomerAccount (line 17) | @Override
method sendUpdateEmail (line 23) | @Override
method sleepSeconds (line 29) | private void sleepSeconds(int seconds) {
FILE: core/src/main/java/io/temporal/samples/listworkflows/CustomerWorkflow.java
type CustomerWorkflow (line 7) | @WorkflowInterface
method updateAccountMessage (line 9) | @WorkflowMethod
method exit (line 12) | @SignalMethod
FILE: core/src/main/java/io/temporal/samples/listworkflows/CustomerWorkflowImpl.java
class CustomerWorkflowImpl (line 9) | public class CustomerWorkflowImpl implements CustomerWorkflow {
method updateAccountMessage (line 19) | @Override
method exit (line 34) | @Override
FILE: core/src/main/java/io/temporal/samples/listworkflows/Starter.java
class Starter (line 20) | public class Starter {
method main (line 26) | public static void main(String[] args) {
method getExecutionsResponse (line 97) | private static ListWorkflowExecutionsResponse getExecutionsResponse(St...
method createWorker (line 108) | private static void createWorker() {
method generateSearchAttributesFor (line 116) | private static Map<String, Object> generateSearchAttributesFor(Custome...
method startWorkflows (line 123) | private static void startWorkflows(List<Customer> customers) {
method stopWorkflows (line 141) | private static void stopWorkflows(List<Customer> customers) {
method sleep (line 150) | private static void sleep(int seconds) {
FILE: core/src/main/java/io/temporal/samples/metrics/MetricsStarter.java
class MetricsStarter (line 18) | public class MetricsStarter {
method main (line 19) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/metrics/MetricsUtils.java
class MetricsUtils (line 11) | public class MetricsUtils {
method startPrometheusScrapeEndpoint (line 17) | public static HttpServer startPrometheusScrapeEndpoint(
FILE: core/src/main/java/io/temporal/samples/metrics/MetricsWorker.java
class MetricsWorker (line 20) | public class MetricsWorker {
method main (line 25) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/metrics/activities/MetricsActivities.java
type MetricsActivities (line 5) | @ActivityInterface
method performA (line 7) | String performA(String input);
method performB (line 9) | String performB(String input);
FILE: core/src/main/java/io/temporal/samples/metrics/activities/MetricsActivitiesImpl.java
class MetricsActivitiesImpl (line 6) | public class MetricsActivitiesImpl implements MetricsActivities {
method performA (line 8) | @Override
method performB (line 18) | @Override
method incRetriesCustomMetric (line 28) | private void incRetriesCustomMetric(ActivityExecutionContext context) {
FILE: core/src/main/java/io/temporal/samples/metrics/workflow/MetricsWorkflow.java
type MetricsWorkflow (line 6) | @WorkflowInterface
method exec (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/metrics/workflow/MetricsWorkflowImpl.java
class MetricsWorkflowImpl (line 10) | public class MetricsWorkflowImpl implements MetricsWorkflow {
method exec (line 17) | @Override
FILE: core/src/main/java/io/temporal/samples/moneybatch/Account.java
type Account (line 5) | @ActivityInterface
method deposit (line 8) | void deposit(String accountId, String referenceId, int amountCents);
method withdraw (line 10) | void withdraw(String accountId, String referenceId, int amountCents);
FILE: core/src/main/java/io/temporal/samples/moneybatch/AccountActivityWorker.java
class AccountActivityWorker (line 10) | public class AccountActivityWorker {
method main (line 14) | @SuppressWarnings("CatchAndPrintStackTrace")
FILE: core/src/main/java/io/temporal/samples/moneybatch/AccountImpl.java
class AccountImpl (line 3) | public class AccountImpl implements Account {
method deposit (line 4) | @Override
method withdraw (line 12) | @Override
FILE: core/src/main/java/io/temporal/samples/moneybatch/AccountTransferWorker.java
class AccountTransferWorker (line 10) | public class AccountTransferWorker {
method main (line 12) | @SuppressWarnings("CatchAndPrintStackTrace")
FILE: core/src/main/java/io/temporal/samples/moneybatch/AccountTransferWorkflow.java
type AccountTransferWorkflow (line 8) | @WorkflowInterface
method deposit (line 11) | @WorkflowMethod
method withdraw (line 14) | @SignalMethod
method getBalance (line 17) | @QueryMethod
method getCount (line 20) | @QueryMethod
FILE: core/src/main/java/io/temporal/samples/moneybatch/AccountTransferWorkflowImpl.java
class AccountTransferWorkflowImpl (line 10) | public class AccountTransferWorkflowImpl implements AccountTransferWorkf...
method deposit (line 28) | @Override
method withdraw (line 35) | @Override
method getBalance (line 45) | @Override
method getCount (line 50) | @Override
FILE: core/src/main/java/io/temporal/samples/moneybatch/TransferRequester.java
class TransferRequester (line 12) | public class TransferRequester {
method main (line 17) | @SuppressWarnings("CatchAndPrintStackTrace")
FILE: core/src/main/java/io/temporal/samples/moneytransfer/Account.java
type Account (line 5) | @ActivityInterface
method deposit (line 8) | void deposit(String accountId, String referenceId, int amountCents);
method withdraw (line 10) | void withdraw(String accountId, String referenceId, int amountCents);
FILE: core/src/main/java/io/temporal/samples/moneytransfer/AccountActivityWorker.java
class AccountActivityWorker (line 10) | public class AccountActivityWorker {
method main (line 14) | @SuppressWarnings("CatchAndPrintStackTrace")
FILE: core/src/main/java/io/temporal/samples/moneytransfer/AccountImpl.java
class AccountImpl (line 3) | public class AccountImpl implements Account {
method withdraw (line 5) | @Override
method deposit (line 12) | @Override
FILE: core/src/main/java/io/temporal/samples/moneytransfer/AccountTransferWorker.java
class AccountTransferWorker (line 12) | public class AccountTransferWorker {
method main (line 14) | @SuppressWarnings("CatchAndPrintStackTrace")
FILE: core/src/main/java/io/temporal/samples/moneytransfer/AccountTransferWorkflow.java
type AccountTransferWorkflow (line 6) | @WorkflowInterface
method transfer (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/moneytransfer/AccountTransferWorkflowImpl.java
class AccountTransferWorkflowImpl (line 7) | public class AccountTransferWorkflowImpl implements AccountTransferWorkf...
method transfer (line 13) | @Override
FILE: core/src/main/java/io/temporal/samples/moneytransfer/TransferRequester.java
class TransferRequester (line 13) | public class TransferRequester {
method main (line 15) | @SuppressWarnings("CatchAndPrintStackTrace")
FILE: core/src/main/java/io/temporal/samples/nexus/caller/CallerStarter.java
class CallerStarter (line 11) | public class CallerStarter {
method main (line 14) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/nexus/caller/CallerWorker.java
class CallerWorker (line 11) | public class CallerWorker {
method main (line 14) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/nexus/caller/EchoCallerWorkflow.java
type EchoCallerWorkflow (line 6) | @WorkflowInterface
method echo (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/nexus/caller/EchoCallerWorkflowImpl.java
class EchoCallerWorkflowImpl (line 9) | public class EchoCallerWorkflowImpl implements EchoCallerWorkflow {
method echo (line 20) | @Override
FILE: core/src/main/java/io/temporal/samples/nexus/caller/HelloCallerWorkflow.java
type HelloCallerWorkflow (line 7) | @WorkflowInterface
method hello (line 9) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/nexus/caller/HelloCallerWorkflowImpl.java
class HelloCallerWorkflowImpl (line 10) | public class HelloCallerWorkflowImpl implements HelloCallerWorkflow {
method hello (line 21) | @Override
FILE: core/src/main/java/io/temporal/samples/nexus/handler/EchoClient.java
type EchoClient (line 5) | public interface EchoClient {
method echo (line 6) | SampleNexusService.EchoOutput echo(SampleNexusService.EchoInput input);
FILE: core/src/main/java/io/temporal/samples/nexus/handler/EchoClientImpl.java
class EchoClientImpl (line 7) | public class EchoClientImpl implements EchoClient {
method echo (line 8) | @Override
FILE: core/src/main/java/io/temporal/samples/nexus/handler/HandlerWorker.java
class HandlerWorker (line 8) | public class HandlerWorker {
method main (line 11) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/nexus/handler/HelloHandlerWorkflow.java
type HelloHandlerWorkflow (line 7) | @WorkflowInterface
method hello (line 9) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/nexus/handler/HelloHandlerWorkflowImpl.java
class HelloHandlerWorkflowImpl (line 6) | public class HelloHandlerWorkflowImpl implements HelloHandlerWorkflow {
method hello (line 7) | @Override
FILE: core/src/main/java/io/temporal/samples/nexus/handler/SampleNexusServiceImpl.java
class SampleNexusServiceImpl (line 14) | @ServiceImpl(service = SampleNexusService.class)
method SampleNexusServiceImpl (line 22) | public SampleNexusServiceImpl() {
method SampleNexusServiceImpl (line 26) | public SampleNexusServiceImpl(EchoClient echoClient) {
method echo (line 33) | @OperationImpl
method hello (line 44) | @OperationImpl
FILE: core/src/main/java/io/temporal/samples/nexus/options/ClientOptions.java
class ClientOptions (line 15) | public class ClientOptions {
method getWorkflowClient (line 17) | public static WorkflowClient getWorkflowClient(String[] args) {
method getWorkflowClient (line 21) | public static WorkflowClient getWorkflowClient(
FILE: core/src/main/java/io/temporal/samples/nexus/service/SampleNexusService.java
type SampleNexusService (line 8) | @Service
type Language (line 10) | enum Language {
class HelloInput (line 18) | class HelloInput {
method HelloInput (line 22) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getName (line 29) | @JsonProperty("name")
method getLanguage (line 34) | @JsonProperty("language")
class HelloOutput (line 40) | class HelloOutput {
method HelloOutput (line 43) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getMessage (line 48) | @JsonProperty("message")
class EchoInput (line 54) | class EchoInput {
method EchoInput (line 57) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getMessage (line 62) | @JsonProperty("message")
class EchoOutput (line 68) | class EchoOutput {
method EchoOutput (line 71) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getMessage (line 76) | @JsonProperty("message")
method hello (line 82) | @Operation
method echo (line 85) | @Operation
FILE: core/src/main/java/io/temporal/samples/nexuscancellation/caller/CallerStarter.java
class CallerStarter (line 10) | public class CallerStarter {
method main (line 13) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/nexuscancellation/caller/CallerWorker.java
class CallerWorker (line 12) | public class CallerWorker {
method main (line 15) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/nexuscancellation/caller/HelloCallerWorkflow.java
type HelloCallerWorkflow (line 6) | @WorkflowInterface
method hello (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/nexuscancellation/caller/HelloCallerWorkflowImpl.java
class HelloCallerWorkflowImpl (line 14) | public class HelloCallerWorkflowImpl implements HelloCallerWorkflow {
method hello (line 34) | @Override
FILE: core/src/main/java/io/temporal/samples/nexuscancellation/handler/HandlerWorker.java
class HandlerWorker (line 9) | public class HandlerWorker {
method main (line 12) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/nexuscancellation/handler/HelloHandlerWorkflowImpl.java
class HelloHandlerWorkflowImpl (line 11) | public class HelloHandlerWorkflowImpl implements HelloHandlerWorkflow {
method hello (line 14) | @Override
FILE: core/src/main/java/io/temporal/samples/nexuscontextpropagation/caller/CallerStarter.java
class CallerStarter (line 16) | public class CallerStarter {
method main (line 19) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/nexuscontextpropagation/caller/CallerWorker.java
class CallerWorker (line 13) | public class CallerWorker {
method main (line 16) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/nexuscontextpropagation/caller/EchoCallerWorkflowImpl.java
class EchoCallerWorkflowImpl (line 11) | public class EchoCallerWorkflowImpl implements EchoCallerWorkflow {
method echo (line 22) | @Override
FILE: core/src/main/java/io/temporal/samples/nexuscontextpropagation/caller/HelloCallerWorkflowImpl.java
class HelloCallerWorkflowImpl (line 12) | public class HelloCallerWorkflowImpl implements HelloCallerWorkflow {
method hello (line 23) | @Override
FILE: core/src/main/java/io/temporal/samples/nexuscontextpropagation/handler/HandlerWorker.java
class HandlerWorker (line 13) | public class HandlerWorker {
method main (line 16) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/nexuscontextpropagation/handler/HelloHandlerWorkflowImpl.java
class HelloHandlerWorkflowImpl (line 10) | public class HelloHandlerWorkflowImpl implements HelloHandlerWorkflow {
method hello (line 13) | @Override
FILE: core/src/main/java/io/temporal/samples/nexuscontextpropagation/handler/SampleNexusServiceImpl.java
class SampleNexusServiceImpl (line 18) | @ServiceImpl(service = SampleNexusService.class)
method echo (line 22) | @OperationImpl
method hello (line 40) | @OperationImpl
FILE: core/src/main/java/io/temporal/samples/nexuscontextpropagation/propagation/MDCContextPropagator.java
class MDCContextPropagator (line 10) | public class MDCContextPropagator implements ContextPropagator {
method getName (line 12) | @Override
method getCurrentContext (line 17) | @Override
method setCurrentContext (line 31) | @Override
method serializeContext (line 39) | @Override
method deserializeContext (line 50) | @Override
FILE: core/src/main/java/io/temporal/samples/nexuscontextpropagation/propagation/NexusMDCContextInterceptor.java
class NexusMDCContextInterceptor (line 16) | public class NexusMDCContextInterceptor extends WorkerInterceptorBase {
method interceptWorkflow (line 19) | @Override
class WorkflowInboundCallsInterceptorNexusMDC (line 24) | public static class WorkflowInboundCallsInterceptorNexusMDC
method WorkflowInboundCallsInterceptorNexusMDC (line 28) | public WorkflowInboundCallsInterceptorNexusMDC(WorkflowInboundCallsI...
method init (line 33) | @Override
class WorkflowOutboundCallsInterceptorNexusMDC (line 39) | public static class WorkflowOutboundCallsInterceptorNexusMDC
method WorkflowOutboundCallsInterceptorNexusMDC (line 43) | public WorkflowOutboundCallsInterceptorNexusMDC(WorkflowOutboundCall...
method executeNexusOperation (line 48) | @Override
method interceptNexusOperation (line 65) | @Override
class NexusOperationInboundCallsInterceptorNexusMDC (line 71) | private static class NexusOperationInboundCallsInterceptorNexusMDC
method NexusOperationInboundCallsInterceptorNexusMDC (line 75) | public NexusOperationInboundCallsInterceptorNexusMDC(
method startOperation (line 81) | @Override
method cancelOperation (line 96) | @Override
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/callerpattern/caller/CallerStarter.java
class CallerStarter (line 12) | public class CallerStarter {
method main (line 14) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/callerpattern/caller/CallerWorker.java
class CallerWorker (line 16) | public class CallerWorker {
method main (line 23) | public static void main(String[] args) throws InterruptedException {
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/callerpattern/caller/CallerWorkflow.java
type CallerWorkflow (line 7) | @WorkflowInterface
method run (line 9) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/callerpattern/caller/CallerWorkflowImpl.java
class CallerWorkflowImpl (line 14) | public class CallerWorkflowImpl implements CallerWorkflow {
method run (line 30) | @Override
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/callerpattern/handler/GreetingActivity.java
type GreetingActivity (line 7) | @ActivityInterface
method callGreetingService (line 10) | @ActivityMethod
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/callerpattern/handler/GreetingActivityImpl.java
class GreetingActivityImpl (line 7) | public class GreetingActivityImpl implements GreetingActivity {
method callGreetingService (line 21) | @Override
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/callerpattern/handler/GreetingWorkflow.java
type GreetingWorkflow (line 17) | @WorkflowInterface
method run (line 20) | @WorkflowMethod
method getLanguages (line 24) | @QueryMethod
method getLanguage (line 29) | @QueryMethod
method approve (line 33) | @SignalMethod
method setLanguage (line 38) | @UpdateMethod
method validateSetLanguage (line 41) | @UpdateValidatorMethod(updateName = "setLanguage")
method setLanguageUsingActivity (line 45) | @UpdateMethod
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/callerpattern/handler/GreetingWorkflowImpl.java
class GreetingWorkflowImpl (line 17) | public class GreetingWorkflowImpl implements GreetingWorkflow {
method GreetingWorkflowImpl (line 30) | public GreetingWorkflowImpl() {
method run (line 35) | @Override
method getLanguages (line 42) | @Override
method getLanguage (line 55) | @Override
method approve (line 60) | @Override
method setLanguage (line 68) | @Override
method validateSetLanguage (line 78) | @Override
method setLanguageUsingActivity (line 88) | @Override
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/callerpattern/handler/HandlerWorker.java
class HandlerWorker (line 15) | public class HandlerWorker {
method main (line 22) | public static void main(String[] args) throws InterruptedException {
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/callerpattern/handler/NexusGreetingServiceImpl.java
class NexusGreetingServiceImpl (line 17) | @ServiceImpl(service = NexusGreetingService.class)
method getWorkflowId (line 28) | public static String getWorkflowId(String userId) {
method getWorkflowStub (line 32) | private GreetingWorkflow getWorkflowStub(String userId) {
method getLanguages (line 38) | @OperationImpl
method getLanguage (line 49) | @OperationImpl
method setLanguage (line 60) | @OperationImpl
method approve (line 69) | @OperationImpl
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/callerpattern/service/Language.java
type Language (line 3) | public enum Language {
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/callerpattern/service/NexusGreetingService.java
type NexusGreetingService (line 14) | @Service
class GetLanguagesInput (line 17) | class GetLanguagesInput {
method GetLanguagesInput (line 21) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method isIncludeUnsupported (line 29) | @JsonProperty("includeUnsupported")
method getUserId (line 34) | @JsonProperty("userId")
class GetLanguagesOutput (line 40) | class GetLanguagesOutput {
method GetLanguagesOutput (line 43) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getLanguages (line 48) | @JsonProperty("languages")
class GetLanguageInput (line 54) | class GetLanguageInput {
method GetLanguageInput (line 57) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getUserId (line 62) | @JsonProperty("userId")
class ApproveInput (line 68) | class ApproveInput {
method ApproveInput (line 72) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getName (line 78) | @JsonProperty("name")
method getUserId (line 83) | @JsonProperty("userId")
class ApproveOutput (line 89) | @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
method ApproveOutput (line 91) | @JsonCreator
class SetLanguageInput (line 95) | class SetLanguageInput {
method SetLanguageInput (line 99) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getLanguage (line 106) | @JsonProperty("language")
method getUserId (line 111) | @JsonProperty("userId")
method getLanguages (line 118) | @Operation
method getLanguage (line 122) | @Operation
method setLanguage (line 126) | @Operation
method approve (line 130) | @Operation
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/ondemandpattern/caller/CallerRemoteStarter.java
class CallerRemoteStarter (line 12) | public class CallerRemoteStarter {
method main (line 14) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/ondemandpattern/caller/CallerRemoteWorker.java
class CallerRemoteWorker (line 16) | public class CallerRemoteWorker {
method main (line 23) | public static void main(String[] args) throws InterruptedException {
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/ondemandpattern/caller/CallerRemoteWorkflow.java
type CallerRemoteWorkflow (line 7) | @WorkflowInterface
method run (line 9) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/ondemandpattern/caller/CallerRemoteWorkflowImpl.java
class CallerRemoteWorkflowImpl (line 14) | public class CallerRemoteWorkflowImpl implements CallerRemoteWorkflow {
method run (line 43) | @Override
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/ondemandpattern/handler/GreetingActivity.java
type GreetingActivity (line 7) | @ActivityInterface
method callGreetingService (line 10) | @ActivityMethod
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/ondemandpattern/handler/GreetingActivityImpl.java
class GreetingActivityImpl (line 7) | public class GreetingActivityImpl implements GreetingActivity {
method callGreetingService (line 21) | @Override
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/ondemandpattern/handler/GreetingWorkflow.java
type GreetingWorkflow (line 19) | @WorkflowInterface
class ApproveInput (line 22) | class ApproveInput {
method ApproveInput (line 25) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getName (line 30) | @JsonProperty("name")
class GetLanguagesInput (line 36) | class GetLanguagesInput {
method GetLanguagesInput (line 39) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method isIncludeUnsupported (line 44) | @JsonProperty("includeUnsupported")
class SetLanguageInput (line 50) | class SetLanguageInput {
method SetLanguageInput (line 53) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getLanguage (line 58) | @JsonProperty("language")
method run (line 64) | @WorkflowMethod
method getLanguages (line 68) | @QueryMethod
method getLanguage (line 72) | @QueryMethod
method approve (line 76) | @SignalMethod
method setLanguage (line 81) | @UpdateMethod
method validateSetLanguage (line 84) | @UpdateValidatorMethod(updateName = "setLanguage")
method setLanguageUsingActivity (line 88) | @UpdateMethod
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/ondemandpattern/handler/GreetingWorkflowImpl.java
class GreetingWorkflowImpl (line 17) | public class GreetingWorkflowImpl implements GreetingWorkflow {
method GreetingWorkflowImpl (line 29) | public GreetingWorkflowImpl() {
method run (line 34) | @Override
method getLanguages (line 41) | @Override
method getLanguage (line 54) | @Override
method approve (line 59) | @Override
method setLanguage (line 65) | @Override
method validateSetLanguage (line 73) | @Override
method setLanguageUsingActivity (line 81) | @Override
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/ondemandpattern/handler/HandlerWorker.java
class HandlerWorker (line 13) | public class HandlerWorker {
method main (line 19) | public static void main(String[] args) throws InterruptedException {
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/ondemandpattern/handler/NexusRemoteGreetingServiceImpl.java
class NexusRemoteGreetingServiceImpl (line 19) | @ServiceImpl(service = NexusRemoteGreetingService.class)
method getWorkflowId (line 31) | public static String getWorkflowId(String userId) {
method getWorkflowStub (line 35) | private GreetingWorkflow getWorkflowStub(String userId) {
method runFromRemote (line 43) | @OperationImpl
method getLanguages (line 61) | @OperationImpl
method getLanguage (line 74) | @OperationImpl
method setLanguage (line 84) | @OperationImpl
method approve (line 94) | @OperationImpl
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/ondemandpattern/service/Language.java
type Language (line 3) | public enum Language {
FILE: core/src/main/java/io/temporal/samples/nexusmessaging/ondemandpattern/service/NexusRemoteGreetingService.java
type NexusRemoteGreetingService (line 16) | @Service
class RunFromRemoteInput (line 19) | class RunFromRemoteInput {
method RunFromRemoteInput (line 22) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getUserId (line 27) | @JsonProperty("userId")
class GetLanguagesInput (line 33) | class GetLanguagesInput {
method GetLanguagesInput (line 37) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method isIncludeUnsupported (line 45) | @JsonProperty("includeUnsupported")
method getUserId (line 50) | @JsonProperty("userId")
class GetLanguageInput (line 56) | @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
method GetLanguageInput (line 60) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getUserId (line 65) | @JsonProperty("userId")
class SetLanguageInput (line 71) | class SetLanguageInput {
method SetLanguageInput (line 75) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getLanguage (line 82) | @JsonProperty("language")
method getUserId (line 87) | @JsonProperty("userId")
class ApproveInput (line 93) | class ApproveInput {
method ApproveInput (line 97) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getName (line 103) | @JsonProperty("name")
method getUserId (line 108) | @JsonProperty("userId")
class GetLanguagesOutput (line 114) | class GetLanguagesOutput {
method GetLanguagesOutput (line 117) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getLanguages (line 122) | @JsonProperty("languages")
class ApproveOutput (line 128) | @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
method ApproveOutput (line 130) | @JsonCreator
method runFromRemote (line 136) | @Operation
method getLanguages (line 140) | @Operation
method getLanguage (line 144) | @Operation
method setLanguage (line 148) | @Operation
method approve (line 152) | @Operation
FILE: core/src/main/java/io/temporal/samples/nexusmultipleargs/caller/CallerStarter.java
class CallerStarter (line 14) | public class CallerStarter {
method main (line 17) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/nexusmultipleargs/caller/CallerWorker.java
class CallerWorker (line 11) | public class CallerWorker {
method main (line 14) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/nexusmultipleargs/caller/EchoCallerWorkflow.java
type EchoCallerWorkflow (line 6) | @WorkflowInterface
method echo (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/nexusmultipleargs/caller/EchoCallerWorkflowImpl.java
class EchoCallerWorkflowImpl (line 10) | public class EchoCallerWorkflowImpl implements EchoCallerWorkflow {
method echo (line 21) | @Override
FILE: core/src/main/java/io/temporal/samples/nexusmultipleargs/caller/HelloCallerWorkflow.java
type HelloCallerWorkflow (line 7) | @WorkflowInterface
method hello (line 9) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/nexusmultipleargs/caller/HelloCallerWorkflowImpl.java
class HelloCallerWorkflowImpl (line 11) | public class HelloCallerWorkflowImpl implements HelloCallerWorkflow {
method hello (line 22) | @Override
FILE: core/src/main/java/io/temporal/samples/nexusmultipleargs/handler/HandlerWorker.java
class HandlerWorker (line 8) | public class HandlerWorker {
method main (line 11) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/nexusmultipleargs/handler/HelloHandlerWorkflow.java
type HelloHandlerWorkflow (line 7) | @WorkflowInterface
method hello (line 9) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/nexusmultipleargs/handler/HelloHandlerWorkflowImpl.java
class HelloHandlerWorkflowImpl (line 6) | public class HelloHandlerWorkflowImpl implements HelloHandlerWorkflow {
method hello (line 7) | @Override
FILE: core/src/main/java/io/temporal/samples/nexusmultipleargs/handler/SampleNexusServiceImpl.java
class SampleNexusServiceImpl (line 15) | @ServiceImpl(service = SampleNexusService.class)
method echo (line 17) | @OperationImpl
method hello (line 29) | @OperationImpl
FILE: core/src/main/java/io/temporal/samples/packetdelivery/Packet.java
class Packet (line 3) | public class Packet {
method Packet (line 7) | public Packet() {}
method Packet (line 9) | public Packet(int id, String content) {
method getId (line 14) | public int getId() {
method getContent (line 18) | public String getContent() {
FILE: core/src/main/java/io/temporal/samples/packetdelivery/PacketDelivery.java
class PacketDelivery (line 10) | public class PacketDelivery {
method PacketDelivery (line 32) | public PacketDelivery(Packet packet) {
method getDelivered (line 37) | public Promise<Void> getDelivered() {
method processDeliveryAsync (line 41) | public void processDeliveryAsync() {
method processDelivery (line 45) | public void processDelivery() {
method confirmDelivery (line 107) | public void confirmDelivery() {
method cancelDelivery (line 111) | public void cancelDelivery(String reason) {
method isNeedDeliveryConfirmation (line 117) | public boolean isNeedDeliveryConfirmation() {
method getPacket (line 121) | public Packet getPacket() {
FILE: core/src/main/java/io/temporal/samples/packetdelivery/PacketDeliveryActivities.java
type PacketDeliveryActivities (line 6) | @ActivityInterface
method generatePackets (line 8) | List<Packet> generatePackets();
method performDelivery (line 10) | void performDelivery(Packet packet);
method completeDelivery (line 12) | String completeDelivery(Packet packet);
method compensateDelivery (line 14) | String compensateDelivery(Packet packet);
FILE: core/src/main/java/io/temporal/samples/packetdelivery/PacketDeliveryActivitiesImpl.java
class PacketDeliveryActivitiesImpl (line 9) | public class PacketDeliveryActivitiesImpl implements PacketDeliveryActiv...
method PacketDeliveryActivitiesImpl (line 19) | public PacketDeliveryActivitiesImpl(WorkflowClient client) {
method generatePackets (line 23) | @Override
method performDelivery (line 28) | @Override
method completeDelivery (line 51) | @Override
method compensateDelivery (line 76) | @Override
method randomCompletionDeliveryResult (line 95) | private String randomCompletionDeliveryResult(Packet packet) {
method sleep (line 139) | private void sleep(int seconds) {
method determineCancelRules (line 151) | private int determineCancelRules(Packet packet) {
FILE: core/src/main/java/io/temporal/samples/packetdelivery/PacketDeliveryWorkflow.java
type PacketDeliveryWorkflow (line 9) | @WorkflowInterface
method execute (line 11) | @WorkflowMethod
method confirmDelivery (line 14) | @SignalMethod
method cancelDelivery (line 17) | @SignalMethod
method deliveryConfirmationPackets (line 20) | @QueryMethod
FILE: core/src/main/java/io/temporal/samples/packetdelivery/PacketDeliveryWorkflowImpl.java
class PacketDeliveryWorkflowImpl (line 13) | public class PacketDeliveryWorkflowImpl implements PacketDeliveryWorkflow {
method execute (line 25) | @Override
method confirmDelivery (line 42) | @Override
method cancelDelivery (line 49) | @Override
method deliveryConfirmationPackets (line 66) | @Override
FILE: core/src/main/java/io/temporal/samples/packetdelivery/PacketUtils.java
class PacketUtils (line 3) | public class PacketUtils {
FILE: core/src/main/java/io/temporal/samples/packetdelivery/Starter.java
class Starter (line 15) | public class Starter {
method main (line 16) | public static void main(String[] args) {
method sleep (line 74) | private static void sleep(int seconds) {
FILE: core/src/main/java/io/temporal/samples/payloadconverter/cloudevents/CEWorkflow.java
type CEWorkflow (line 9) | @WorkflowInterface
method exec (line 11) | @WorkflowMethod
method addEvent (line 14) | @SignalMethod
method getLastEvent (line 17) | @QueryMethod
FILE: core/src/main/java/io/temporal/samples/payloadconverter/cloudevents/CEWorkflowImpl.java
class CEWorkflowImpl (line 8) | public class CEWorkflowImpl implements CEWorkflow {
method exec (line 12) | @Override
method addEvent (line 20) | @Override
method getLastEvent (line 25) | @Override
FILE: core/src/main/java/io/temporal/samples/payloadconverter/cloudevents/CloudEventsPayloadConverter.java
class CloudEventsPayloadConverter (line 17) | public class CloudEventsPayloadConverter implements PayloadConverter {
method getEncodingType (line 22) | @Override
method toData (line 27) | @Override
method fromData (line 46) | @Override
FILE: core/src/main/java/io/temporal/samples/payloadconverter/cloudevents/Starter.java
class Starter (line 20) | public class Starter {
method main (line 24) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/payloadconverter/crypto/CryptoWorkflow.java
type CryptoWorkflow (line 6) | @WorkflowInterface
method exec (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/payloadconverter/crypto/CryptoWorkflowImpl.java
class CryptoWorkflowImpl (line 3) | public class CryptoWorkflowImpl implements CryptoWorkflow {
method exec (line 4) | @Override
FILE: core/src/main/java/io/temporal/samples/payloadconverter/crypto/MyCustomer.java
class MyCustomer (line 5) | public class MyCustomer {
method MyCustomer (line 10) | public MyCustomer() {}
method MyCustomer (line 12) | public MyCustomer(String name, int age) {
method getName (line 17) | @Encrypt
method setName (line 22) | public void setName(String name) {
method getAge (line 26) | @Encrypt
method setAge (line 31) | public void setAge(int age) {
method isApproved (line 35) | @Encrypt
method setApproved (line 40) | public void setApproved(boolean approved) {
FILE: core/src/main/java/io/temporal/samples/payloadconverter/crypto/Starter.java
class Starter (line 18) | public class Starter {
method main (line 22) | public static void main(String[] args) {
method getCryptoJacksonJsonPayloadConverter (line 64) | private static JacksonJsonPayloadConverter getCryptoJacksonJsonPayload...
method createWorker (line 80) | private static void createWorker(WorkflowClient client) {
FILE: core/src/main/java/io/temporal/samples/peractivityoptions/FailingActivities.java
type FailingActivities (line 5) | @ActivityInterface
method activityTypeA (line 7) | void activityTypeA();
method activityTypeB (line 9) | void activityTypeB();
FILE: core/src/main/java/io/temporal/samples/peractivityoptions/FailingActivitiesImpl.java
class FailingActivitiesImpl (line 5) | public class FailingActivitiesImpl implements FailingActivities {
method activityTypeA (line 6) | @Override
method activityTypeB (line 17) | @Override
FILE: core/src/main/java/io/temporal/samples/peractivityoptions/PerActivityOptionsWorkflow.java
type PerActivityOptionsWorkflow (line 6) | @WorkflowInterface
method execute (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/peractivityoptions/PerActivityOptionsWorkflowImpl.java
class PerActivityOptionsWorkflowImpl (line 8) | public class PerActivityOptionsWorkflowImpl implements PerActivityOption...
method execute (line 17) | @Override
FILE: core/src/main/java/io/temporal/samples/peractivityoptions/Starter.java
class Starter (line 16) | public class Starter {
method main (line 20) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/polling/PollingActivities.java
type PollingActivities (line 5) | @ActivityInterface
method doPoll (line 7) | String doPoll();
FILE: core/src/main/java/io/temporal/samples/polling/PollingWorkflow.java
type PollingWorkflow (line 6) | @WorkflowInterface
method exec (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/polling/TestService.java
class TestService (line 9) | public class TestService {
method TestService (line 16) | public TestService() {}
method TestService (line 18) | public TestService(int errorAttempts) {
method TestService (line 22) | public TestService(int errorAttempts, boolean doRetryAfter) {
method getServiceResult (line 27) | public String getServiceResult() throws TestServiceException {
class TestServiceException (line 42) | public static class TestServiceException extends Exception {
method TestServiceException (line 45) | public TestServiceException(String message) {
method TestServiceException (line 49) | public TestServiceException(String message, int retryAfterInMinutes) {
method getRetryAfterInMinutes (line 54) | public int getRetryAfterInMinutes() {
FILE: core/src/main/java/io/temporal/samples/polling/frequent/FrequentPollingActivityImpl.java
class FrequentPollingActivityImpl (line 10) | public class FrequentPollingActivityImpl implements PollingActivities {
method FrequentPollingActivityImpl (line 14) | public FrequentPollingActivityImpl(TestService service) {
method doPoll (line 18) | @Override
method sleep (line 41) | private void sleep(int seconds) {
FILE: core/src/main/java/io/temporal/samples/polling/frequent/FrequentPollingStarter.java
class FrequentPollingStarter (line 13) | public class FrequentPollingStarter {
method main (line 33) | public static void main(String[] args) {
method createWorker (line 47) | private static void createWorker() {
FILE: core/src/main/java/io/temporal/samples/polling/frequent/FrequentPollingWorkflowImpl.java
class FrequentPollingWorkflowImpl (line 9) | public class FrequentPollingWorkflowImpl implements PollingWorkflow {
method exec (line 10) | @Override
FILE: core/src/main/java/io/temporal/samples/polling/infrequent/InfrequentPollingActivityImpl.java
class InfrequentPollingActivityImpl (line 8) | public class InfrequentPollingActivityImpl implements PollingActivities {
method InfrequentPollingActivityImpl (line 11) | public InfrequentPollingActivityImpl(TestService service) {
method doPoll (line 15) | @Override
FILE: core/src/main/java/io/temporal/samples/polling/infrequent/InfrequentPollingStarter.java
class InfrequentPollingStarter (line 13) | public class InfrequentPollingStarter {
method main (line 33) | public static void main(String[] args) {
method createWorker (line 47) | private static void createWorker() {
FILE: core/src/main/java/io/temporal/samples/polling/infrequent/InfrequentPollingWorkflowImpl.java
class InfrequentPollingWorkflowImpl (line 10) | public class InfrequentPollingWorkflowImpl implements PollingWorkflow {
method exec (line 11) | @Override
FILE: core/src/main/java/io/temporal/samples/polling/infrequentwithretryafter/InfrequentPollingWithRetryAfterActivityImpl.java
class InfrequentPollingWithRetryAfterActivityImpl (line 13) | public class InfrequentPollingWithRetryAfterActivityImpl implements Poll...
method InfrequentPollingWithRetryAfterActivityImpl (line 17) | public InfrequentPollingWithRetryAfterActivityImpl(TestService service) {
method doPoll (line 21) | @Override
FILE: core/src/main/java/io/temporal/samples/polling/infrequentwithretryafter/InfrequentPollingWithRetryAfterStarter.java
class InfrequentPollingWithRetryAfterStarter (line 13) | public class InfrequentPollingWithRetryAfterStarter {
method main (line 33) | public static void main(String[] args) {
method createWorker (line 47) | private static void createWorker() {
FILE: core/src/main/java/io/temporal/samples/polling/infrequentwithretryafter/InfrequentPollingWithRetryAfterWorkflowImpl.java
class InfrequentPollingWithRetryAfterWorkflowImpl (line 10) | public class InfrequentPollingWithRetryAfterWorkflowImpl implements Poll...
method exec (line 11) | @Override
FILE: core/src/main/java/io/temporal/samples/polling/periodicsequence/PeriodicPollingActivityImpl.java
class PeriodicPollingActivityImpl (line 7) | public class PeriodicPollingActivityImpl implements PollingActivities {
method PeriodicPollingActivityImpl (line 11) | public PeriodicPollingActivityImpl(TestService service) {
method doPoll (line 15) | @Override
FILE: core/src/main/java/io/temporal/samples/polling/periodicsequence/PeriodicPollingChildWorkflowImpl.java
class PeriodicPollingChildWorkflowImpl (line 10) | public class PeriodicPollingChildWorkflowImpl implements PollingChildWor...
method exec (line 14) | @Override
FILE: core/src/main/java/io/temporal/samples/polling/periodicsequence/PeriodicPollingStarter.java
class PeriodicPollingStarter (line 13) | public class PeriodicPollingStarter {
method main (line 33) | public static void main(String[] args) {
method createWorker (line 47) | private static void createWorker() {
FILE: core/src/main/java/io/temporal/samples/polling/periodicsequence/PeriodicPollingWorkflowImpl.java
class PeriodicPollingWorkflowImpl (line 7) | public class PeriodicPollingWorkflowImpl implements PollingWorkflow {
method exec (line 12) | @Override
FILE: core/src/main/java/io/temporal/samples/polling/periodicsequence/PollingChildWorkflow.java
type PollingChildWorkflow (line 6) | @WorkflowInterface
method exec (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/retryonsignalinterceptor/FailureRequester.java
class FailureRequester (line 13) | public class FailureRequester {
method main (line 15) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/retryonsignalinterceptor/MyActivity.java
type MyActivity (line 5) | @ActivityInterface
method execute (line 7) | void execute();
FILE: core/src/main/java/io/temporal/samples/retryonsignalinterceptor/MyActivityImpl.java
class MyActivityImpl (line 6) | public class MyActivityImpl implements MyActivity {
method execute (line 15) | @Override
FILE: core/src/main/java/io/temporal/samples/retryonsignalinterceptor/MyWorkflow.java
type MyWorkflow (line 6) | @WorkflowInterface
method execute (line 9) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/retryonsignalinterceptor/MyWorkflowImpl.java
class MyWorkflowImpl (line 8) | public class MyWorkflowImpl implements MyWorkflow {
method execute (line 20) | @Override
FILE: core/src/main/java/io/temporal/samples/retryonsignalinterceptor/MyWorkflowWorker.java
class MyWorkflowWorker (line 12) | public class MyWorkflowWorker {
method main (line 17) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/retryonsignalinterceptor/QueryRequester.java
class QueryRequester (line 10) | public class QueryRequester {
method main (line 12) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/retryonsignalinterceptor/RetryOnSignalInterceptorListener.java
type RetryOnSignalInterceptorListener (line 7) | public interface RetryOnSignalInterceptorListener {
method retry (line 10) | @SignalMethod
method fail (line 14) | @SignalMethod
method getPendingActivitiesStatus (line 18) | @QueryMethod
FILE: core/src/main/java/io/temporal/samples/retryonsignalinterceptor/RetryOnSignalWorkerInterceptor.java
class RetryOnSignalWorkerInterceptor (line 6) | public class RetryOnSignalWorkerInterceptor extends WorkerInterceptorBase {
method interceptWorkflow (line 7) | @Override
method interceptActivity (line 12) | @Override
FILE: core/src/main/java/io/temporal/samples/retryonsignalinterceptor/RetryOnSignalWorkflowInboundCallsInterceptor.java
class RetryOnSignalWorkflowInboundCallsInterceptor (line 7) | public class RetryOnSignalWorkflowInboundCallsInterceptor
method RetryOnSignalWorkflowInboundCallsInterceptor (line 10) | public RetryOnSignalWorkflowInboundCallsInterceptor(WorkflowInboundCal...
method init (line 14) | @Override
FILE: core/src/main/java/io/temporal/samples/retryonsignalinterceptor/RetryOnSignalWorkflowOutboundCallsInterceptor.java
class RetryOnSignalWorkflowOutboundCallsInterceptor (line 14) | public class RetryOnSignalWorkflowOutboundCallsInterceptor
type Action (line 17) | private enum Action {
class ActivityRetryState (line 22) | private class ActivityRetryState<R> {
method ActivityRetryState (line 29) | private ActivityRetryState(ActivityInput<R> input) {
method execute (line 33) | ActivityOutput<R> execute() {
method executeWithAsyncRetry (line 38) | private ActivityOutput<R> executeWithAsyncRetry() {
method retry (line 71) | public void retry() {
method fail (line 78) | public void fail() {
method getStatus (line 85) | public String getStatus() {
method RetryOnSignalWorkflowOutboundCallsInterceptor (line 111) | public RetryOnSignalWorkflowOutboundCallsInterceptor(WorkflowOutboundC...
method executeActivity (line 145) | @Override
FILE: core/src/main/java/io/temporal/samples/retryonsignalinterceptor/RetryRequester.java
class RetryRequester (line 10) | public class RetryRequester {
method main (line 12) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/safemessagepassing/ClusterManagerActivities.java
type ClusterManagerActivities (line 10) | @ActivityInterface
class AssignNodesToJobInput (line 13) | class AssignNodesToJobInput {
method AssignNodesToJobInput (line 17) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getNodes (line 25) | @JsonProperty("nodes_to_assign")
method getJobName (line 30) | @JsonProperty("job_name")
method assignNodesToJob (line 36) | @ActivityMethod
class UnassignNodesForJobInput (line 39) | class UnassignNodesForJobInput {
method UnassignNodesForJobInput (line 43) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getNodes (line 50) | @JsonProperty("nodes")
method getJobName (line 55) | @JsonProperty("job_name")
method unassignNodesForJob (line 61) | @ActivityMethod
class FindBadNodesInput (line 64) | class FindBadNodesInput {
method FindBadNodesInput (line 67) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getNodesToCheck (line 72) | @JsonProperty("assigned_nodes")
method findBadNodes (line 78) | @ActivityMethod
method shutdown (line 81) | @ActivityMethod
FILE: core/src/main/java/io/temporal/samples/safemessagepassing/ClusterManagerActivitiesImpl.java
class ClusterManagerActivitiesImpl (line 8) | public class ClusterManagerActivitiesImpl implements ClusterManagerActiv...
method assignNodesToJob (line 11) | @Override
method unassignNodesForJob (line 23) | @Override
method findBadNodes (line 35) | @Override
method shutdown (line 54) | @Override
FILE: core/src/main/java/io/temporal/samples/safemessagepassing/ClusterManagerWorkflow.java
type ClusterManagerWorkflow (line 16) | @WorkflowInterface
type ClusterState (line 19) | enum ClusterState {
class ClusterManagerState (line 27) | class ClusterManagerState {
class ClusterManagerInput (line 33) | class ClusterManagerInput {
method ClusterManagerInput (line 37) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getState (line 45) | @JsonProperty("state")
method isTestContinueAsNew (line 50) | @JsonProperty("test_continue_as_new")
class ClusterManagerResult (line 56) | class ClusterManagerResult {
method ClusterManagerResult (line 60) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getNumCurrentlyAssignedNodes (line 68) | @JsonProperty("num_currently_assigned_nodes")
method getNumBadNodes (line 73) | @JsonProperty("num_bad_nodes")
class ClusterManagerAssignNodesToJobInput (line 81) | class ClusterManagerAssignNodesToJobInput {
method ClusterManagerAssignNodesToJobInput (line 86) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getTotalNumNodes (line 94) | @JsonProperty("total_num_nodes")
method getJobName (line 99) | @JsonProperty("job_name")
class ClusterManagerDeleteJobInput (line 105) | class ClusterManagerDeleteJobInput {
method ClusterManagerDeleteJobInput (line 108) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getJobName (line 113) | @JsonProperty("job_name")
class ClusterManagerAssignNodesToJobResult (line 119) | class ClusterManagerAssignNodesToJobResult {
method ClusterManagerAssignNodesToJobResult (line 122) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getNodesAssigned (line 128) | @JsonProperty("assigned_nodes")
method run (line 134) | @WorkflowMethod
method startCluster (line 137) | @SignalMethod
method stopCluster (line 140) | @UpdateMethod
method assignNodesToJobs (line 146) | @UpdateMethod
method deleteJob (line 151) | @UpdateMethod
FILE: core/src/main/java/io/temporal/samples/safemessagepassing/ClusterManagerWorkflowImpl.java
class ClusterManagerWorkflowImpl (line 17) | public class ClusterManagerWorkflowImpl implements ClusterManagerWorkflow {
method ClusterManagerWorkflowImpl (line 35) | @WorkflowInit
method run (line 52) | @Override
method startCluster (line 79) | @Override
method stopCluster (line 92) | @Override
method assignNodesToJobs (line 105) | @Override
method deleteJob (line 143) | @Override
method getAssignedNodes (line 170) | private Set<String> getAssignedNodes(String jobName) {
method getUnassignedNodes (line 184) | private Set<String> getUnassignedNodes() {
method getBadNodes (line 191) | private Set<String> getBadNodes() {
method performHealthChecks (line 198) | private void performHealthChecks() {
method shouldContinueAsNew (line 214) | private boolean shouldContinueAsNew() {
FILE: core/src/main/java/io/temporal/samples/safemessagepassing/ClusterManagerWorkflowStarter.java
class ClusterManagerWorkflowStarter (line 22) | public class ClusterManagerWorkflowStarter {
method main (line 26) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/safemessagepassing/ClusterManagerWorkflowWorker.java
class ClusterManagerWorkflowWorker (line 12) | public class ClusterManagerWorkflowWorker {
method main (line 17) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/sleepfordays/SendEmailActivity.java
type SendEmailActivity (line 5) | @ActivityInterface
method sendEmail (line 7) | void sendEmail(String email);
FILE: core/src/main/java/io/temporal/samples/sleepfordays/SendEmailActivityImpl.java
class SendEmailActivityImpl (line 3) | public class SendEmailActivityImpl implements SendEmailActivity {
method sendEmail (line 4) | @Override
FILE: core/src/main/java/io/temporal/samples/sleepfordays/SleepForDaysImpl.java
class SleepForDaysImpl (line 8) | public class SleepForDaysImpl implements SleepForDaysWorkflow {
method SleepForDaysImpl (line 13) | public SleepForDaysImpl() {
method sleepForDays (line 20) | @Override
method complete (line 31) | @Override
FILE: core/src/main/java/io/temporal/samples/sleepfordays/SleepForDaysWorkflow.java
type SleepForDaysWorkflow (line 7) | @WorkflowInterface
method sleepForDays (line 9) | @WorkflowMethod
method complete (line 12) | @SignalMethod
FILE: core/src/main/java/io/temporal/samples/sleepfordays/Starter.java
class Starter (line 10) | public class Starter {
method main (line 14) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/sleepfordays/Worker.java
class Worker (line 9) | public class Worker {
method main (line 12) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/ssl/MyWorkflow.java
type MyWorkflow (line 6) | @WorkflowInterface
method execute (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/ssl/MyWorkflowImpl.java
class MyWorkflowImpl (line 3) | public class MyWorkflowImpl implements MyWorkflow {
method execute (line 4) | @Override
FILE: core/src/main/java/io/temporal/samples/ssl/SslEnabledWorkerCustomCA.java
class SslEnabledWorkerCustomCA (line 16) | public class SslEnabledWorkerCustomCA {
method main (line 20) | public static void main(String[] args) throws Exception {
FILE: core/src/main/java/io/temporal/samples/ssl/Starter.java
class Starter (line 20) | public class Starter {
method main (line 25) | public static void main(String[] args) throws Exception {
FILE: core/src/main/java/io/temporal/samples/standaloneactivities/CountActivities.java
class CountActivities (line 13) | public class CountActivities {
method main (line 15) | public static void main(String[] args) throws IOException {
FILE: core/src/main/java/io/temporal/samples/standaloneactivities/ExecuteActivity.java
class ExecuteActivity (line 17) | public class ExecuteActivity {
method main (line 21) | public static void main(String[] args) throws IOException {
FILE: core/src/main/java/io/temporal/samples/standaloneactivities/GreetingActivities.java
type GreetingActivities (line 7) | @ActivityInterface
method composeGreeting (line 10) | @ActivityMethod
FILE: core/src/main/java/io/temporal/samples/standaloneactivities/GreetingActivitiesImpl.java
class GreetingActivitiesImpl (line 7) | public class GreetingActivitiesImpl implements GreetingActivities {
method composeGreeting (line 11) | @Override
FILE: core/src/main/java/io/temporal/samples/standaloneactivities/ListActivities.java
class ListActivities (line 14) | public class ListActivities {
method main (line 16) | public static void main(String[] args) throws IOException {
FILE: core/src/main/java/io/temporal/samples/standaloneactivities/StandaloneActivityWorker.java
class StandaloneActivityWorker (line 14) | public class StandaloneActivityWorker {
method main (line 18) | public static void main(String[] args) throws IOException {
FILE: core/src/main/java/io/temporal/samples/standaloneactivities/StartActivity.java
class StartActivity (line 18) | public class StartActivity {
method main (line 22) | public static void main(String[] args) throws IOException {
FILE: core/src/main/java/io/temporal/samples/terminateworkflow/MyWorkflow.java
type MyWorkflow (line 6) | @WorkflowInterface
method execute (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/terminateworkflow/MyWorkflowImpl.java
class MyWorkflowImpl (line 6) | public class MyWorkflowImpl implements MyWorkflow {
method execute (line 7) | @Override
FILE: core/src/main/java/io/temporal/samples/terminateworkflow/Starter.java
class Starter (line 17) | public class Starter {
method main (line 21) | public static void main(String[] args) {
method createWorker (line 65) | private static void createWorker(WorkerFactory factory) {
method sleepSeconds (line 77) | private static void sleepSeconds(int seconds) {
method getStatusAsString (line 93) | private static String getStatusAsString(
FILE: core/src/main/java/io/temporal/samples/tracing/JaegerUtils.java
class JaegerUtils (line 26) | public class JaegerUtils {
method getJaegerOptions (line 28) | public static OpenTracingOptions getJaegerOptions(String type) {
method getJaegerOpenTracingOptions (line 36) | private static OpenTracingOptions getJaegerOpenTracingOptions() {
method getJaegerOpenTelemetryOptions (line 56) | private static OpenTracingOptions getJaegerOpenTelemetryOptions() {
method getOpenTracingOptionsForTracer (line 86) | private static OpenTracingOptions getOpenTracingOptionsForTracer(Trace...
FILE: core/src/main/java/io/temporal/samples/tracing/Starter.java
class Starter (line 13) | public class Starter {
method main (line 16) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/tracing/TracingWorker.java
class TracingWorker (line 15) | public class TracingWorker {
method main (line 18) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/tracing/workflow/TracingActivities.java
type TracingActivities (line 5) | @ActivityInterface
method greet (line 7) | String greet(String name, String language);
FILE: core/src/main/java/io/temporal/samples/tracing/workflow/TracingActivitiesImpl.java
class TracingActivitiesImpl (line 3) | public class TracingActivitiesImpl implements TracingActivities {
method greet (line 4) | @Override
FILE: core/src/main/java/io/temporal/samples/tracing/workflow/TracingChildWorkflow.java
type TracingChildWorkflow (line 6) | @WorkflowInterface
method greet (line 8) | @WorkflowMethod
FILE: core/src/main/java/io/temporal/samples/tracing/workflow/TracingChildWorkflowImpl.java
class TracingChildWorkflowImpl (line 7) | public class TracingChildWorkflowImpl implements TracingChildWorkflow {
method greet (line 8) | @Override
FILE: core/src/main/java/io/temporal/samples/tracing/workflow/TracingWorkflow.java
type TracingWorkflow (line 8) | @WorkflowInterface
method greet (line 11) | @WorkflowMethod
method setLanguage (line 14) | @SignalMethod
method getLanguage (line 17) | @QueryMethod
FILE: core/src/main/java/io/temporal/samples/tracing/workflow/TracingWorkflowImpl.java
class TracingWorkflowImpl (line 6) | public class TracingWorkflowImpl implements TracingWorkflow {
method greet (line 10) | @Override
method setLanguage (line 22) | @Override
method getLanguage (line 27) | @Override
FILE: core/src/main/java/io/temporal/samples/updatabletimer/DynamicSleepWorkflow.java
type DynamicSleepWorkflow (line 8) | @WorkflowInterface
method execute (line 10) | @WorkflowMethod
method updateWakeUpTime (line 13) | @SignalMethod
method getWakeUpTime (line 16) | @QueryMethod
FILE: core/src/main/java/io/temporal/samples/updatabletimer/DynamicSleepWorkflowImpl.java
class DynamicSleepWorkflowImpl (line 3) | public class DynamicSleepWorkflowImpl implements DynamicSleepWorkflow {
method execute (line 7) | @Override
method updateWakeUpTime (line 12) | @Override
method getWakeUpTime (line 17) | @Override
FILE: core/src/main/java/io/temporal/samples/updatabletimer/DynamicSleepWorkflowStarter.java
class DynamicSleepWorkflowStarter (line 17) | public class DynamicSleepWorkflowStarter {
method main (line 21) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/updatabletimer/DynamicSleepWorkflowWorker.java
class DynamicSleepWorkflowWorker (line 12) | public class DynamicSleepWorkflowWorker {
method main (line 21) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/updatabletimer/UpdatableTimer.java
class UpdatableTimer (line 8) | public final class UpdatableTimer {
method sleepUntil (line 15) | public void sleepUntil(long wakeUpTime) {
method updateWakeUpTime (line 29) | public void updateWakeUpTime(long wakeUpTime) {
method getWakeUpTime (line 35) | public long getWakeUpTime() {
FILE: core/src/main/java/io/temporal/samples/updatabletimer/WakeUpTimeUpdater.java
class WakeUpTimeUpdater (line 12) | public class WakeUpTimeUpdater {
method main (line 16) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/workerversioning/Activities.java
type Activities (line 8) | @ActivityInterface
method someActivity (line 11) | @ActivityMethod
method someIncompatibleActivity (line 14) | @ActivityMethod
class IncompatibleActivityInput (line 17) | class IncompatibleActivityInput {
method IncompatibleActivityInput (line 21) | @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
method getCalledBy (line 28) | @JsonProperty("calledBy")
method getMoreData (line 33) | @JsonProperty("moreData")
FILE: core/src/main/java/io/temporal/samples/workerversioning/ActivitiesImpl.java
class ActivitiesImpl (line 6) | public class ActivitiesImpl implements Activities {
method someActivity (line 10) | @Override
method someIncompatibleActivity (line 16) | @Override
FILE: core/src/main/java/io/temporal/samples/workerversioning/AutoUpgradingWorkflow.java
type AutoUpgradingWorkflow (line 7) | @WorkflowInterface
method run (line 10) | @WorkflowMethod
method doNextSignal (line 13) | @SignalMethod
FILE: core/src/main/java/io/temporal/samples/workerversioning/AutoUpgradingWorkflowV1Impl.java
class AutoUpgradingWorkflowV1Impl (line 19) | public class AutoUpgradingWorkflowV1Impl implements AutoUpgradingWorkflow {
method run (line 29) | @Override
method doNextSignal (line 48) | @Override
FILE: core/src/main/java/io/temporal/samples/workerversioning/AutoUpgradingWorkflowV1bImpl.java
class AutoUpgradingWorkflowV1bImpl (line 23) | public class AutoUpgradingWorkflowV1bImpl implements AutoUpgradingWorkfl...
method run (line 33) | @Override
method doNextSignal (line 61) | @Override
FILE: core/src/main/java/io/temporal/samples/workerversioning/PinnedWorkflow.java
type PinnedWorkflow (line 7) | @WorkflowInterface
method run (line 10) | @WorkflowMethod
method doNextSignal (line 13) | @SignalMethod
FILE: core/src/main/java/io/temporal/samples/workerversioning/PinnedWorkflowV1Impl.java
class PinnedWorkflowV1Impl (line 19) | public class PinnedWorkflowV1Impl implements PinnedWorkflow {
method run (line 29) | @Override
method doNextSignal (line 45) | @Override
FILE: core/src/main/java/io/temporal/samples/workerversioning/PinnedWorkflowV2Impl.java
class PinnedWorkflowV2Impl (line 16) | public class PinnedWorkflowV2Impl implements PinnedWorkflow {
method run (line 26) | @Override
method doNextSignal (line 47) | @Override
FILE: core/src/main/java/io/temporal/samples/workerversioning/Starter.java
class Starter (line 17) | public class Starter {
method main (line 23) | public static void main(String[] args) throws Exception {
method advanceWorkflows (line 118) | private static void advanceWorkflows(
method waitForWorkerAndMakeCurrent (line 127) | private static void waitForWorkerAndMakeCurrent(
FILE: core/src/main/java/io/temporal/samples/workerversioning/WorkerV1.java
class WorkerV1 (line 15) | public class WorkerV1 {
method main (line 19) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/workerversioning/WorkerV1_1.java
class WorkerV1_1 (line 15) | public class WorkerV1_1 {
method main (line 19) | public static void main(String[] args) {
FILE: core/src/main/java/io/temporal/samples/workerversioning/WorkerV2.java
class WorkerV2 (line 15) | public class WorkerV2 {
method main (line 19) | public static void main(String[] args) {
FILE: core/src/test/java/io/temporal/samples/asyncchild/AsyncChildTest.java
class AsyncChildTest (line 11) | public class AsyncChildTest {
method testAsyncChildWorkflow (line 19) | @Test
FILE: core/src/test/java/io/temporal/samples/asyncuntypedchild/AsyncUntypedChildTest.java
class AsyncUntypedChildTest (line 19) | public class AsyncUntypedChildTest {
method testMockedChild (line 25) | @Test
method getChildWorkflowExecutionStatus (line 66) | @NotNull
FILE: core/src/test/java/io/temporal/samples/batch/heartbeatingactivity/HeartbeatingActivityBatchWorkflowTest.java
class HeartbeatingActivityBatchWorkflowTest (line 10) | public class HeartbeatingActivityBatchWorkflowTest {
class TestRecordProcessorImpl (line 13) | public static class TestRecordProcessorImpl implements RecordProcessor {
method processRecord (line 15) | @Override
method testBatchWorkflow (line 30) | @Test
FILE: core/src/test/java/io/temporal/samples/batch/iterator/IteratorIteratorBatchWorkflowTest.java
class IteratorIteratorBatchWorkflowTest (line 11) | public class IteratorIteratorBatchWorkflowTest {
class TestRecordProcessorWorkflowImpl (line 18) | public static class TestRecordProcessorWorkflowImpl implements RecordP...
method processRecord (line 20) | @Override
method testBatchWorkflow (line 34) | @Test
FILE: core/src/test/java/io/temporal/samples/batch/slidingwindow/SlidingWindowBatchWorkflowTest.java
class SlidingWindowBatchWorkflowTest (line 11) | public class SlidingWindowBatchWorkflowTest {
class TestRecordProcessorWorkflowImpl (line 16) | public static class TestRecordProcessorWorkflowImpl implements RecordP...
method processRecord (line 18) | @Override
method testSlidingWindowBatchWorkflow (line 49) | @Test
FILE: core/src/test/java/io/temporal/samples/bookingsaga/TripBookingWorkflowTest.java
class TripBookingWorkflowTest (line 19) | public class TripBookingWorkflowTest {
method testTripBookingFails (line 32) | @Test
method testSAGA (line 46) | @Test
FILE: core/src/test/java/io/temporal/samples/bookingsyncsaga/TripBookingWorkflowTest.java
class TripBookingWorkflowTest (line 20) | public class TripBookingWorkflowTest {
method testTripBookingFails (line 33) | @Test
method testSAGA (line 47) | @Test
FILE: core/src/test/java/io/temporal/samples/countinterceptor/ClientCountInterceptorTest.java
class ClientCountInterceptorTest (line 18) | public class ClientCountInterceptorTest {
method testInterceptor (line 35) | @Test
FILE: core/src/test/java/io/temporal/samples/countinterceptor/WorkerCountInterceptorTest.java
class WorkerCountInterceptorTest (line 17) | public class WorkerCountInterceptorTest {
method testInterceptor (line 33) | @Test
FILE: core/src/test/java/io/temporal/samples/dsl/DslWorkflowTest.java
class DslWorkflowTest (line 12) | public class DslWorkflowTest {
method testDslWorkflow (line 21) | @Test
method getFlowFromResource (line 41) | private static Flow getFlowFromResource() {
FILE: core/src/test/java/io/temporal/samples/earlyreturn/TransactionWorkflowTest.java
class TransactionWorkflowTest (line 16) | public class TransactionWorkflowTest {
method testUpdateWithStartValidAmount (line 31) | @Test
method testUpdateWithStartInvalidAmount (line 76) | @Test
FILE: core/src/test/java/io/temporal/samples/encodefailures/EncodeFailuresTest.java
class EncodeFailuresTest (line 19) | public class EncodeFailuresTest {
method testFailureMessageIsEncoded (line 39) | @Test
method isEncoded (line 68) | private boolean isEncoded(Payload payload) {
FILE: core/src/test/java/io/temporal/samples/excludefrominterceptor/ExcludeFromInterceptorTest.java
class ExcludeFromInterceptorTest (line 21) | public class ExcludeFromInterceptorTest {
method testExcludeFromInterceptor (line 46) | @Test
method getNumOfActivitiesForExec (line 85) | private int getNumOfActivitiesForExec(String workflowId) {
FILE: core/src/test/java/io/temporal/samples/fileprocessing/FileProcessingTest.java
class FileProcessingTest (line 14) | public class FileProcessingTest {
method setUp (line 45) | @Before
method testHappyPath (line 51) | @Test
method testHostFailover (line 88) | @Test(timeout = 30_000)
FILE: core/src/test/java/io/temporal/samples/getresultsasync/GetResultsAsyncTest.java
class GetResultsAsyncTest (line 13) | public class GetResultsAsyncTest {
method testGetResultsAsync (line 19) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloAccumulatorTest.java
class HelloAccumulatorTest (line 17) | public class HelloAccumulatorTest {
method testWorkflow (line 28) | @Test
method testJustExit (line 55) | @Test
method testNoExit (line 79) | @Test
method testMultipleGreetings (line 106) | @Test
method testDuplicateGreetings (line 133) | @Test
method testWrongBucketGreeting (line 160) | @Test
method testSignalWithStart (line 187) | @Test
method testWaitTooLongForFirstWorkflow (line 213) | @Test
method testWaitNotLongEnoughForNewWorkflow (line 265) | @Test
method testWaitExactlyMAX_TIME (line 314) | @Test
method testSignalAfterExit (line 363) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloActivityExclusiveChoiceJUnit5Test.java
class HelloActivityExclusiveChoiceJUnit5Test (line 10) | public class HelloActivityExclusiveChoiceJUnit5Test {
method testWorkflow (line 19) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloActivityExclusiveChoiceTest.java
class HelloActivityExclusiveChoiceTest (line 12) | public class HelloActivityExclusiveChoiceTest {
method testWorkflow (line 21) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloActivityJUnit5Test.java
class HelloActivityJUnit5Test (line 20) | public class HelloActivityJUnit5Test {
method testActivityImpl (line 29) | @Test
method testMockedActivity (line 40) | @Test
method testMockedActivityWithoutSettings (line 56) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloActivityReplayTest.java
class HelloActivityReplayTest (line 23) | public class HelloActivityReplayTest {
method replayWorkflowExecution (line 29) | @Test
method replayWorkflowExecutionNonDeterministic (line 38) | @Test
method executeWorkflow (line 60) | private String executeWorkflow(
class GreetingWorkflowImplTest (line 84) | public static class GreetingWorkflowImplTest implements HelloActivity....
method getGreeting (line 91) | @Override
FILE: core/src/test/java/io/temporal/samples/hello/HelloActivityRetryTest.java
class HelloActivityRetryTest (line 19) | public class HelloActivityRetryTest {
method failed (line 32) | @Override
method testActivityImpl (line 41) | @Test
method testMockedActivity (line 61) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloActivityTest.java
class HelloActivityTest (line 18) | public class HelloActivityTest {
method testActivityImpl (line 27) | @Test
method testMockedActivity (line 47) | @Test
method testMockedActivityWithoutSettings (line 71) | @Test(expected = IllegalArgumentException.class)
FILE: core/src/test/java/io/temporal/samples/hello/HelloAsyncActivityCompletionTest.java
class HelloAsyncActivityCompletionTest (line 18) | public class HelloAsyncActivityCompletionTest {
method testActivityImpl (line 27) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloAsyncLambdaTest.java
class HelloAsyncLambdaTest (line 18) | public class HelloAsyncLambdaTest {
method testActivityImpl (line 29) | @Test
method testMockedActivity (line 48) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloAsyncTest.java
class HelloAsyncTest (line 17) | public class HelloAsyncTest {
method testActivityImpl (line 26) | @Test
method testMockedActivity (line 44) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloAwaitTest.java
class HelloAwaitTest (line 18) | public class HelloAwaitTest {
method testAwaitSignal (line 26) | @Test
method testAwaitTimeout (line 54) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloCancellationScopeTest.java
class HelloCancellationScopeTest (line 14) | public class HelloCancellationScopeTest {
method testActivityImpl (line 23) | @Test(timeout = 240_000)
FILE: core/src/test/java/io/temporal/samples/hello/HelloCancellationScopeWithTimerTest.java
class HelloCancellationScopeWithTimerTest (line 10) | public class HelloCancellationScopeWithTimerTest {
method testActivityImpl (line 19) | @Test(timeout = 240_000)
FILE: core/src/test/java/io/temporal/samples/hello/HelloChildJUnit5Test.java
class HelloChildJUnit5Test (line 13) | public class HelloChildJUnit5Test {
method testChild (line 23) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloChildTest.java
class HelloChildTest (line 18) | public class HelloChildTest {
method testChild (line 24) | @Test
method testMockedChild (line 45) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloCronTest.java
class HelloCronTest (line 20) | public class HelloCronTest {
method testMockedActivity (line 29) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloDelayedStartTest.java
class HelloDelayedStartTest (line 12) | public class HelloDelayedStartTest {
method testDelayedStart (line 21) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloDetachedCancellationScopeTest.java
class HelloDetachedCancellationScopeTest (line 18) | public class HelloDetachedCancellationScopeTest {
method testDetachedWorkflowScope (line 27) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloDynamicActivityJUnit5Test.java
class HelloDynamicActivityJUnit5Test (line 14) | public class HelloDynamicActivityJUnit5Test {
method testDynamicActivity (line 26) | @Test
type MyStaticActivity (line 33) | @ActivityInterface(namePrefix = "MyStatic")
method response (line 35) | String response(String name, String greeting, String source);
FILE: core/src/test/java/io/temporal/samples/hello/HelloDynamicTest.java
class HelloDynamicTest (line 12) | public class HelloDynamicTest {
method testActivityImpl (line 21) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloEagerWorkflowStartTest.java
class HelloEagerWorkflowStartTest (line 18) | public class HelloEagerWorkflowStartTest {
method testActivityImpl (line 27) | @Test
method testMockedActivity (line 48) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloExceptionTest.java
class HelloExceptionTest (line 23) | public class HelloExceptionTest {
method testIOException (line 29) | @Test
method testActivityScheduleToStartTimeout (line 62) | @Test
method testChildWorkflowTimeout (line 97) | @Test(timeout = 100000)
FILE: core/src/test/java/io/temporal/samples/hello/HelloLocalActivityTest.java
class HelloLocalActivityTest (line 18) | public class HelloLocalActivityTest {
method testActivityImpl (line 27) | @Test
method testMockedActivity (line 46) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloParallelActivityTest.java
class HelloParallelActivityTest (line 13) | public class HelloParallelActivityTest {
method testParallelActivity (line 22) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloPeriodicTest.java
class HelloPeriodicTest (line 27) | public class HelloPeriodicTest {
method testPeriodicActivityInvocation (line 36) | @Test
method testMockedActivity (line 77) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloPolymorphicActivityTest.java
class HelloPolymorphicActivityTest (line 17) | public class HelloPolymorphicActivityTest {
method testActivityImpl (line 26) | @Test
method testMockedActivity (line 47) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloQueryTest.java
class HelloQueryTest (line 14) | public class HelloQueryTest {
method testQuery (line 20) | @Test(timeout = 5000)
FILE: core/src/test/java/io/temporal/samples/hello/HelloSearchAttributesTest.java
class HelloSearchAttributesTest (line 18) | public class HelloSearchAttributesTest {
method testStartWorkflowWithSearchAttribute (line 27) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloSideEffectTest.java
class HelloSideEffectTest (line 10) | public class HelloSideEffectTest {
method testSideffectsWorkflow (line 19) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloSignalTest.java
class HelloSignalTest (line 16) | public class HelloSignalTest {
method testSignal (line 24) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloSignalWithStartAndWorkflowInitTest.java
class HelloSignalWithStartAndWorkflowInitTest (line 16) | public class HelloSignalWithStartAndWorkflowInitTest {
method testWithInit (line 31) | @Test
method testWithoutInit (line 51) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloSignalWithTimerTest.java
class HelloSignalWithTimerTest (line 15) | public class HelloSignalWithTimerTest {
method testSignalWithTimer (line 25) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloStandaloneActivityTest.java
class HelloStandaloneActivityTest (line 29) | public class HelloStandaloneActivityTest {
type TestWorkflow (line 35) | @WorkflowInterface
method run (line 38) | @WorkflowMethod
class TestWorkflowImpl (line 42) | public static class TestWorkflowImpl implements TestWorkflow {
method run (line 49) | @Override
method testActivityImpl (line 62) | @Test
method testMockedActivity (line 79) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloUpdateAndCancellationTest.java
class HelloUpdateAndCancellationTest (line 16) | public class HelloUpdateAndCancellationTest {
method testUpdateAndWorkflowCancellation (line 24) | @Test
method testUpdateAndActivityCancellation (line 67) | @Test
type TestWorkflow (line 116) | @WorkflowInterface
method execute (line 118) | @WorkflowMethod
method mileStoneCompleted (line 121) | @UpdateMethod
method cancelActivity (line 124) | @SignalMethod
class TestWorkflowImpl (line 128) | public static class TestWorkflowImpl implements TestWorkflow {
method execute (line 140) | @Override
method mileStoneCompleted (line 167) | @Override
method cancelActivity (line 175) | @Override
type TestActivities (line 183) | @ActivityInterface
method runActivity (line 185) | void runActivity();
class TestActivitiesImpl (line 188) | public static class TestActivitiesImpl implements TestActivities {
method runActivity (line 190) | @Override
method sleep (line 204) | private static void sleep(int seconds) {
FILE: core/src/test/java/io/temporal/samples/hello/HelloUpdateTest.java
class HelloUpdateTest (line 17) | public class HelloUpdateTest {
method testUpdate (line 26) | @Test
FILE: core/src/test/java/io/temporal/samples/hello/HelloWorkflowTimerTest.java
class HelloWorkflowTimerTest (line 9) | public class HelloWorkflowTimerTest {
method testWorkflowTimer (line 19) | @Test
FILE: core/src/test/java/io/temporal/samples/interceptorreplaytest/InterceptorReplayTest.java
class InterceptorReplayTest (line 22) | public class InterceptorReplayTest {
method testReplayWithInterceptors (line 37) | @Test
type TestWorkflow (line 90) | @WorkflowInterface
method execute (line 92) | @WorkflowMethod
class TestWorkflowImpl (line 96) | public static class TestWorkflowImpl implements TestWorkflow {
method execute (line 103) | @Override
type TestActivities (line 109) | @ActivityInterface
method activityOne (line 111) | void activityOne();
method activityTwo (line 113) | void activityTwo();
method activityThree (line 115) | void activityThree();
class TestActivitiesImpl (line 118) | public static class TestActivitiesImpl implements TestActivities {
method activityOne (line 119) | @Override
method activityTwo (line 124) | @Override
method activityThree (line 129) | @Override
class TestWorkerInterceptor (line 136) | public static class TestWorkerInterceptor extends WorkerInterceptorBase {
method interceptWorkflow (line 137) | @Override
class TestWorkflowInboundCallsInterceptor (line 143) | public static class TestWorkflowInboundCallsInterceptor
method TestWorkflowInboundCallsInterceptor (line 150) | public TestWorkflowInboundCallsInterceptor(WorkflowInboundCallsInter...
method init (line 154) | @Override
method execute (line 159) | @Override
class TestWorkflowOutboundCallsInterceptor (line 168) | public static class TestWorkflowOutboundCallsInterceptor
method TestWorkflowOutboundCallsInterceptor (line 175) | public TestWorkflowOutboundCallsInterceptor(WorkflowOutboundCallsInt...
method executeActivity (line 179) | @Override
FILE: core/src/test/java/io/temporal/samples/listworkflows/ListWorkflowsTest.java
class ListWorkflowsTest (line 18) | public class ListWorkflowsTest {
method testActivityImpl (line 26) | @Test
method startWorkflows (line 46) | private void startWorkflows(List<Customer> customers) {
method generateSearchAttributesFor (line 66) | private Map<String, Object> generateSearchAttributesFor(Customer custo...
method getExecutionsResponse (line 73) | private List<WorkflowExecutionInfo> getExecutionsResponse() {
method stopWorkflows (line 88) | private void stopWorkflows(List<Customer> customers) {
FILE: core/src/test/java/io/temporal/samples/metrics/MetricsTest.java
class MetricsTest (line 34) | public class MetricsTest {
method replaceTags (line 61) | private static List<Tag> replaceTags(List<Tag> tags, String... nameVal...
method replaceTag (line 68) | private static List<Tag> replaceTag(List<Tag> tags, String name, Strin...
method setUp (line 75) | @Before
method tearDown (line 98) | @After
method testCountActivityRetriesMetric (line 104) | @Test
method countMetricActivityRetriesForActivity (line 122) | @NotNull
method assertIntCounter (line 138) | private void assertIntCounter(int expectedValue, Counter counter) {
FILE: core/src/test/java/io/temporal/samples/moneybatch/TransferWorkflowTest.java
class TransferWorkflowTest (line 17) | public class TransferWorkflowTest {
method testTransfer (line 26) | @Test
FILE: core/src/test/java/io/temporal/samples/moneytransfer/TransferWorkflowTest.java
class TransferWorkflowTest (line 12) | public class TransferWorkflowTest {
method testTransfer (line 21) | @Test
FILE: core/src/test/java/io/temporal/samples/nexus/caller/CallerWorkflowJunit5MockTest.java
class CallerWorkflowJunit5MockTest (line 20) | public class CallerWorkflowJunit5MockTest {
method testHelloWorkflow (line 45) | @Test
method testEchoWorkflow (line 66) | @Test
FILE: core/src/test/java/io/temporal/samples/nexus/caller/CallerWorkflowJunit5Test.java
class CallerWorkflowJunit5Test (line 17) | public class CallerWorkflowJunit5Test {
method testHelloWorkflow (line 43) | @Test
method testEchoWorkflow (line 51) | @Test
FILE: core/src/test/java/io/temporal/samples/nexus/caller/CallerWorkflowMockTest.java
class CallerWorkflowMockTest (line 21) | public class CallerWorkflowMockTest {
method testHelloWorkflow (line 47) | @Test
method testEchoWorkflow (line 75) | @Test
FILE: core/src/test/java/io/temporal/samples/nexus/caller/CallerWorkflowTest.java
class CallerWorkflowTest (line 19) | public class CallerWorkflowTest {
method testHelloWorkflow (line 42) | @Test
method testEchoWorkflow (line 58) | @Test
FILE: core/src/test/java/io/temporal/samples/nexus/caller/NexusServiceJunit5Test.java
class NexusServiceJunit5Test (line 23) | public class NexusServiceJunit5Test {
class TestNexusServiceImpl (line 32) | @ServiceImpl(service = SampleNexusService.class)
method echo (line 34) | @OperationImpl
method hello (line 40) | @OperationImpl
method testHelloWorkflow (line 77) | @Test
method testEchoWorkflow (line 90) | @Test
FILE: core/src/test/java/io/temporal/samples/nexus/caller/NexusServiceMockTest.java
class NexusServiceMockTest (line 22) | public class NexusServiceMockTest {
class TestNexusServiceImpl (line 31) | @ServiceImpl(service = SampleNexusService.class)
method echo (line 33) | @OperationImpl
method hello (line 39) | @OperationImpl
method testHelloCallerWithMockedService (line 59) | @Test
method testEchoCallerWithMockedService (line 83) | @Test
FILE: core/src/test/java/io/temporal/samples/payloadconverter/CloudEventsPayloadConverterTest.java
class CloudEventsPayloadConverterTest (line 24) | public class CloudEventsPayloadConverterTest {
method testActivityImpl (line 40) | @Test
FILE: core/src/test/java/io/temporal/samples/payloadconverter/CryptoPayloadConverterTest.java
class CryptoPayloadConverterTest (line 20) | public class CryptoPayloadConverterTest {
method testEncryptedWorkflowData (line 35) | @Test
method getCryptoJacksonJsonPayloadConverter (line 47) | private JacksonJsonPayloadConverter getCryptoJacksonJsonPayloadConvert...
FILE: core/src/test/java/io/temporal/samples/peractivityoptions/PerActivityOptionsTest.java
class PerActivityOptionsTest (line 20) | public class PerActivityOptionsTest {
method testPerActivityTypeWorkflow (line 46) | @Test
FILE: core/src/test/java/io/temporal/samples/polling/FrequentPollingTest.java
class FrequentPollingTest (line 12) | public class FrequentPollingTest {
method testInfrequentPoll (line 20) | @Test
FILE: core/src/test/java/io/temporal/samples/polling/InfrequentPollingTest.java
class InfrequentPollingTest (line 12) | public class InfrequentPollingTest {
method testInfrequentPoll (line 20) | @Test
FILE: core/src/test/java/io/temporal/samples/polling/PeriodicPollingTest.java
class PeriodicPollingTest (line 13) | public class PeriodicPollingTest {
method testInfrequentPoll (line 22) | @Test
FILE: core/src/test/java/io/temporal/samples/retryonsignalinterceptor/RetryOnSignalInterceptorTest.java
class RetryOnSignalInterceptorTest (line 18) | public class RetryOnSignalInterceptorTest {
class TestActivityImpl (line 20) | static class TestActivityImpl implements MyActivity {
method execute (line 24) | @Override
method testRetryThenFail (line 45) | @Test
method testRetryUntilSucceeds (line 80) | @Test
FILE: core/src/test/java/io/temporal/samples/safemessagepassing/ClusterManagerWorkflowWorkerTest.java
class ClusterManagerWorkflowWorkerTest (line 16) | public class ClusterManagerWorkflowWorkerTest {
method testSafeMessageHandler (line 25) | @Test
method testUpdateIdempotency (line 81) | @Test
method testUpdateFailure (line 105) | @Test
FILE: core/src/test/java/io/temporal/samples/sleepfordays/SleepForDaysJUnit5Test.java
class SleepForDaysJUnit5Test (line 15) | public class SleepForDaysJUnit5Test {
method testSleepForDays (line 24) | @Test
FILE: core/src/test/java/io/temporal/samples/sleepfordays/SleepForDaysTest.java
class SleepForDaysTest (line 16) | public class SleepForDaysTest {
method testSleepForDays (line 25) | @Test(timeout = 8000)
FILE: core/src/test/java/io/temporal/samples/standaloneactivities/StandaloneActivitiesTest.java
class StandaloneActivitiesTest (line 27) | public class StandaloneActivitiesTest {
type TestWorkflow (line 29) | @WorkflowInterface
method run (line 32) | @WorkflowMethod
class TestWorkflowImpl (line 36) | public static class TestWorkflowImpl implements TestWorkflow {
method run (line 43) | @Override
method testActivityImpl (line 56) | @Test
method testMockedActivity (line 73) | @Test
FILE: core/src/test/java/io/temporal/samples/terminateworkflow/TerminateWorkflowTest.java
class TerminateWorkflowTest (line 14) | public class TerminateWorkflowTest {
method testTerminateWorkflow (line 20) | @Test
FILE: core/src/test/java/io/temporal/samples/tracing/TracingTest.java
class TracingTest (line 30) | public class TracingTest {
method tearDown (line 57) | @After
method testReportSpans (line 64) | @Test
FILE: springai/basic/src/main/java/io/temporal/samples/springai/chat/ChatExampleApplication.java
class ChatExampleApplication (line 19) | @SpringBootApplication
method main (line 22) | public static void main(String[] args) {
class ChatRunner (line 27) | @Component
method ChatRunner (line 32) | ChatRunner(WorkflowClient workflowClient) {
method run (line 36) | @EventListener(ApplicationReadyEvent.class)
FILE: springai/basic/src/main/java/io/temporal/samples/springai/chat/ChatWorkflow.java
type ChatWorkflow (line 14) | @WorkflowInterface
method run (line 23) | @WorkflowMethod
method chat (line 32) | @UpdateMethod
method end (line 36) | @SignalMethod
FILE: springai/basic/src/main/java/io/temporal/samples/springai/chat/ChatWorkflowImpl.java
class ChatWorkflowImpl (line 41) | public class ChatWorkflowImpl implements ChatWorkflow {
method ChatWorkflowImpl (line 48) | @WorkflowInit
method run (line 92) | @Override
method chat (line 101) | @Override
method end (line 107) | @Override
FILE: springai/basic/src/main/java/io/temporal/samples/springai/chat/StringTools.java
class StringTools (line 13) | public class StringTools {
method reverse (line 15) | @Tool(description = "Reverse a string, returning the characters in opp...
method countWords (line 23) | @Tool(description = "Count the number of words in a text")
method toUpperCase (line 31) | @Tool(description = "Convert text to all uppercase letters")
method toLowerCase (line 39) | @Tool(description = "Convert text to all lowercase letters")
method isPalindrome (line 47) | @Tool(description = "Check if a string is a palindrome (reads the same...
FILE: springai/basic/src/main/java/io/temporal/samples/springai/chat/TimestampTools.java
class TimestampTools (line 43) | @SideEffectTool
method getCurrentDateTime (line 57) | @Tool(description = "Get the current date and time")
method getCurrentTimestamp (line 67) | @Tool(description = "Get the current Unix timestamp in milliseconds")
method generateUuid (line 77) | @Tool(description = "Generate a random UUID")
method getDateTimeInTimezone (line 88) | @Tool(description = "Get the current date and time in a specific timez...
FILE: springai/basic/src/main/java/io/temporal/samples/springai/chat/WeatherActivity.java
type WeatherActivity (line 19) | @ActivityInterface
method getWeather (line 31) | @Tool(
method getForecast (line 45) | @Tool(description = "Get the weather forecast for a city for the speci...
FILE: springai/basic/src/main/java/io/temporal/samples/springai/chat/WeatherActivityImpl.java
class WeatherActivityImpl (line 16) | @Component
method getWeather (line 30) | @Override
method getForecast (line 42) | @Override
FILE: springai/mcp/src/main/java/io/temporal/samples/springai/mcp/McpApplication.java
class McpApplication (line 53) | @SpringBootApplication
method main (line 60) | public static void main(String[] args) throws Exception {
method onReady (line 71) | @EventListener(ApplicationReadyEvent.class)
FILE: springai/mcp/src/main/java/io/temporal/samples/springai/mcp/McpWorkflow.java
type McpWorkflow (line 14) | @WorkflowInterface
method run (line 22) | @WorkflowMethod
method chat (line 30) | @SignalMethod
method getLastResponse (line 38) | @QueryMethod
method listTools (line 46) | @QueryMethod
method end (line 50) | @SignalMethod
FILE: springai/mcp/src/main/java/io/temporal/samples/springai/mcp/McpWorkflowImpl.java
class McpWorkflowImpl (line 39) | public class McpWorkflowImpl implements McpWorkflow {
method run (line 48) | @Override
method chat (line 88) | @Override
method getLastResponse (line 102) | @Override
method listTools (line 107) | @Override
method end (line 127) | @Override
FILE: springai/multimodel/src/main/java/io/temporal/samples/springai/multimodel/ChatModelConfig.java
class ChatModelConfig (line 34) | @Configuration
method openAiChatModel (line 47) | @Bean
method anthropicChatModel (line 57) | @Bean
method chatModelActivityOptions (line 84) | @Bean
FILE: springai/multimodel/src/main/java/io/temporal/samples/springai/multimodel/MultiModelApplication.java
class MultiModelApplication (line 39) | @SpringBootApplication
method main (line 46) | public static void main(String[] args) {
method run (line 50) | @Override
FILE: springai/multimodel/src/main/java/io/temporal/samples/springai/multimodel/MultiModelWorkflow.java
type MultiModelWorkflow (line 14) | @WorkflowInterface
method run (line 22) | @WorkflowMethod
method chat (line 31) | @SignalMethod
method getLastResponse (line 39) | @QueryMethod
method end (line 43) | @SignalMethod
FILE: springai/multimodel/src/main/java/io/temporal/samples/springai/multimodel/MultiModelWorkflowImpl.java
class MultiModelWorkflowImpl (line 45) | public class MultiModelWorkflowImpl implements MultiModelWorkflow {
method MultiModelWorkflowImpl (line 52) | @WorkflowInit
method run (line 118) | @Override
method chat (line 125) | @Override
method getLastResponse (line 138) | @Override
method end (line 143) | @Override
FILE: springai/rag/src/main/java/io/temporal/samples/springai/rag/RagApplication.java
class RagApplication (line 39) | @SpringBootApplication
method main (line 46) | public static void main(String[] args) {
method run (line 50) | @Override
method waitForResponse (line 150) | private void waitForResponse(RagWorkflow workflowStub, String previous...
FILE: springai/rag/src/main/java/io/temporal/samples/springai/rag/RagWorkflow.java
type RagWorkflow (line 14) | @WorkflowInterface
method run (line 22) | @WorkflowMethod
method addDocument (line 31) | @SignalMethod
method ask (line 39) | @SignalMethod
method search (line 48) | @SignalMethod
method getLastResponse (line 56) | @QueryMethod
method getDocumentCount (line 64) | @QueryMethod
method end (line 68) | @SignalMethod
FILE: springai/rag/src/main/java/io/temporal/samples/springai/rag/RagWorkflowImpl.java
class RagWorkflowImpl (line 30) | public class RagWorkflowImpl implements RagWorkflow {
method RagWorkflowImpl (line 39) | @WorkflowInit
method run (line 66) | @Override
method addDocument (line 72) | @Override
method ask (line 84) | @Override
method search (line 122) | @Override
method getLastResponse (line 146) | @Override
method getDocumentCount (line 151) | @Override
method end (line 156) | @Override
method truncate (line 161) | private String truncate(String text, int maxLength) {
FILE: springai/rag/src/main/java/io/temporal/samples/springai/rag/VectorStoreConfig.java
class VectorStoreConfig (line 16) | @Configuration
method vectorStore (line 28) | @Bean
FILE: springboot-basic/src/main/java/io/temporal/samples/springboot/SamplesController.java
class SamplesController (line 15) | @Controller
method hello (line 20) | @GetMapping("/hello")
method helloSample (line 26) | @PostMapping(
FILE: springboot-basic/src/main/java/io/temporal/samples/springboot/TemporalSpringbootSamplesApplication.java
class TemporalSpringbootSamplesApplication (line 6) | @SpringBootApplication
method main (line 8) | public static void main(String[] args) {
FILE: springboot-basic/src/main/java/io/temporal/samples/springboot/hello/HelloActivity.java
type HelloActivity (line 6) | @ActivityInterface
method hello (line 8) | String hello(Person person);
FILE: springboot-basic/src/main/java/io/temporal/samples/springboot/hello/HelloActivityImpl.java
class HelloActivityImpl (line 8) | @Component
method hello (line 14) | @Override
FILE: springboot-basic/src/main/java/io/temporal/samples/springboot/hello/HelloWorkflow.java
type HelloWorkflow (line 7) | @WorkflowInterface
method sayHello (line 9) | @WorkflowMethod
FILE: springboot-basic/src/main/java/io/temporal/samples/springboot/hello/HelloWorkflowImpl.java
class HelloWorkflowImpl (line 9) | @WorkflowImpl(taskQueues = "HelloSampleTaskQueue")
method sayHello (line 17) | @Override
FILE: springboot-basic/src/main/java/io/temporal/samples/springboot/hello/model/Person.java
class Person (line 3) | public class Person {
method Person (line 7) | public Person() {}
method Person (line 9) | public Person(String firstName, String lastName) {
method getFirstName (line 14) | public String getFirstName() {
method setFirstName (line 18) | public void setFirstName(String firstName) {
method getLastName (line 22) | public String getLastName() {
method setLastName (line 26) | public void setLastName(String lastName) {
FILE: springboot-basic/src/main/resources/static/js/jquery.sse.js
function createEventSource (line 77) | function createEventSource(me) {
function createAjax (line 100) | function createAjax(me) {
function runAjax (line 107) | function runAjax(me) {
FILE: springboot-basic/src/test/java/io/temporal/samples/springboot/HelloSampleTest.java
class HelloSampleTest (line 19) | @SpringBootTest(classes = HelloSampleTest.Configuration.class)
method setUp (line 31) | @BeforeEach
method testHello (line 36) | @Test
class Configuration (line 50) | @ComponentScan
FILE: springboot/src/main/java/io/temporal/samples/springboot/SamplesController.java
class SamplesController (line 23) | @Controller
method hello (line 30) | @GetMapping("/hello")
method helloSample (line 36) | @PostMapping(
method metrics (line 53) | @GetMapping("/metrics")
method update (line 59) | @GetMapping("/update")
method updateInventory (line 66) | @GetMapping("/update/inventory")
method purchase (line 72) | @PostMapping(
method kafka (line 110) | @GetMapping("/kafka")
method sendToKafka (line 116) | @PostMapping(
method customize (line 138) | @GetMapping("/customize")
method customizeSample (line 144) | @PostMapping(
method camel (line 161) | @GetMapping("/camel")
method customEndpoint (line 167) | @GetMapping("/customendpoint")
FILE: springboot/src/main/java/io/temporal/samples/springboot/TemporalSpringbootSamplesApplication.java
class TemporalSpringbootSamplesApplication (line 6) | @SpringBootApplication
method main (line 8) | public static void main(String[] args) {
FILE: springboot/src/main/java/io/temporal/samples/springboot/actuator/WorkerActuatorEndpoint.java
class WorkerActuatorEndpoint (line 14) | @Component
method workerInfo (line 21) | @ReadOperation
FILE: springboot/src/main/java/io/temporal/samples/springboot/camel/CamelConfig.java
class CamelConfig (line 13) | @Configuration()
method servletRegistrationBean (line 18) | @Bean
method producerTemplate (line 27) | @Bean
method consumerTemplate (line 32) | @Bean
FILE: springboot/src/main/java/io/temporal/samples/springboot/camel/CamelResource.java
class CamelResource (line 10) | @RestController
method getProductsByCategory (line 14) | @GetMapping("/orders")
FILE: springboot/src/main/java/io/temporal/samples/springboot/camel/CamelRoutes.java
class CamelRoutes (line 9) | @Component
method configure (line 15) | @Override
FILE: springboot/src/main/java/io/temporal/samples/springboot/camel/OfficeOrder.java
class OfficeOrder (line 5) | @Entity
method OfficeOrder (line 24) | public OfficeOrder() {}
method OfficeOrder (line 26) | public OfficeOrder(Integer id, String number, String desc, String date...
method getDesc (line 34) | public String getDesc() {
method setDesc (line 38) | public void setDesc(String desc) {
method getNumber (line 42) | public String getNumber() {
method getId (line 46) | public Integer getId() {
method setId (line 50) | public void setId(Integer id) {
method setNumber (line 54) | public void setNumber(String number) {
method getDate (line 58) | public String getDate() {
method setDate (line 62) | public void setDate(String date) {
method getPrice (line 66) | public double getPrice() {
method setPrice (line 70) | public void setPrice(double price) {
FILE: springboot/src/main/java/io/temporal/samples/springboot/camel/OrderActivity.java
type OrderActivity (line 6) | @ActivityInterface
method getOrders (line 8) | List<OfficeOrder> getOrders();
FILE: springboot/src/main/java/io/temporal/samples/springboot/camel/OrderActivityImpl.java
class OrderActivityImpl (line 9) | @Component
method getOrders (line 15) | @Override
FILE: springboot/src/main/java/io/temporal/samples/springboot/camel/OrderRepository.java
type OrderRepository (line 6) | @Repository
FILE: springboot/src/main/java/io/temporal/samples/springboot/camel/OrderWorkflow.java
type OrderWorkflow (line 7) | @WorkflowInterface
method start (line 9) | @WorkflowMethod
FILE: springboot/src/main/java/io/temporal/samples/springboot/camel/OrderWorkflowImpl.java
class OrderWorkflowImpl (line 9) | @WorkflowImpl(taskQueues = "CamelSampleTaskQueue")
method start (line 17) | @Override
FILE: springboot/src/main/java/io/temporal/samples/springboot/customize/CustomizeActivity.java
type CustomizeActivity (line 5) | @ActivityInterface
method run (line 7) | String run(String input);
FILE: springboot/src/main/java/io/temporal/samples/springboot/customize/CustomizeActivityImpl.java
class CustomizeActivityImpl (line 6) | @Component
method run (line 9) | @Override
FILE: springboot/src/main/java/io/temporal/samples/springboot/customize/CustomizeWorkflow.java
type CustomizeWorkflow (line 6) | @WorkflowInterface
method execute (line 8) | @WorkflowMethod
FILE: springboot/src/main/java/io/temporal/samples/springboot/customize/CustomizeWorkflowImpl.java
class CustomizeWorkflowImpl (line 20) | @WorkflowImpl(taskQueues = "CustomizeTaskQueue")
method execute (line 36) | @Override
FILE: springboot/src/main/java/io/temporal/samples/springboot/customize/TemporalOptionsConfig.java
class TemporalOptionsConfig (line 14) | @Configuration
method customWorkerOptions (line 18) | @Bean
method customServiceStubsOptions (line 39) | @Bean
method customClientOptions (line 55) | @Bean
method customWorkerFactoryOptions (line 70) | @Bean
method customWorkflowImplementationOptions (line 85) | @Bean
FILE: springboot/src/main/java/io/temporal/samples/springboot/hello/HelloActivity.java
type HelloActivity (line 6) | @ActivityInterface
method hello (line 8) | String hello(Person person);
FILE: springboot/src/main/java/io/temporal/samples/springboot/hello/HelloActivityImpl.java
class HelloActivityImpl (line 8) | @Component
method hello (line 14) | @Override
FILE: springboot/src/main/java/io/temporal/samples/springboot/hello/HelloWorkflow.java
type HelloWorkflow (line 7) | @WorkflowInterface
method sayHello (line 9) | @WorkflowMethod
FILE: springboot/src/main/java/io/temporal/samples/springboot/hello/HelloWorkflowImpl.java
class HelloWorkflowImpl (line 9) | @WorkflowImpl(taskQueues = "HelloSampleTaskQueue")
method sayHello (line 17) | @Override
FILE: springboot/src/main/java/io/temporal/samples/springboot/hello/model/Person.java
class Person (line 3) | public class Person {
method Person (line 7) | public Person() {}
method Person (line 9) | public Person(String firstName, String lastName) {
method getFirstName (line 14) | public String getFirstName() {
method setFirstName (line 18) | public void setFirstName(String firstName) {
method getLastName (line 22) | public String getLastName() {
method setLastName (line 26) | public void setLastName(String lastName) {
FILE: springboot/src/main/java/io/temporal/samples/springboot/kafka/KafkaActivity.java
type KafkaActivity (line 5) | @ActivityInterface
method sendMessage (line 7) | void sendMessage(String message);
FILE: springboot/src/main/java/io/temporal/samples/springboot/kafka/KafkaActivityImpl.java
class KafkaActivityImpl (line 10) | @Component
method sendMessage (line 22) | @Override
FILE: springboot/src/main/java/io/temporal/samples/springboot/kafka/KafkaConfig.java
class KafkaConfig (line 18) | @Configuration()
method broker (line 29) | @Bean
method kafkaAdmin (line 36) | @Bean
method samplesTopic (line 43) | @Bean
method kafkaListener (line 48) | @KafkaListener(id = "samples-topic", topics = "samples-topic")
FILE: springboot/src/main/java/io/temporal/samples/springboot/kafka/MessageController.java
class MessageController (line 9) | @RestController
method getKafkaMessages (line 13) | @GetMapping("/kafka-messages")
method getEmitters (line 26) | public List<SseEmitter> getEmitters() {
method getLatestEmitter (line 30) | public SseEmitter getLatestEmitter() {
FILE: springboot/src/main/java/io/temporal/samples/springboot/kafka/MessageWorkflow.java
type MessageWorkflow (line 7) | @WorkflowInterface
method start (line 10) | @WorkflowMethod
method update (line 13) | @SignalMethod
FILE: springboot/src/main/java/io/temporal/samples/springboot/kafka/MessageWorkflowImpl.java
class MessageWorkflowImpl (line 8) | @WorkflowImpl(taskQueues = "KafkaSampleTaskQueue")
method start (line 17) | @Override
method update (line 31) | @Override
FILE: springboot/src/main/java/io/temporal/samples/springboot/update/ProductNotAvailableForAmountException.java
class ProductNotAvailableForAmountException (line 3) | public class ProductNotAvailableForAmountException extends Exception {
method ProductNotAvailableForAmountException (line 4) | public ProductNotAvailableForAmountException(String message) {
FILE: springboot/src/main/java/io/temporal/samples/springboot/update/PurchaseActivities.java
type PurchaseActivities (line 6) | @ActivityInterface
method isProductInStockForPurchase (line 8) | boolean isProductInStockForPurchase(Purchase purchase);
method makePurchase (line 10) | boolean makePurchase(Purchase purchase);
FILE: springboot/src/main/java/io/temporal/samples/springboot/update/PurchaseActivitiesImpl.java
class PurchaseActivitiesImpl (line 11) | @Component
method isProductInStockForPurchase (line 16) | @Override
method makePurchase (line 22) | @Override
method getProductFor (line 33) | private Product getProductFor(Purchase purchase) {
FILE: springboot/src/main/java/io/temporal/samples/springboot/update/PurchaseWorkflow.java
type PurchaseWorkflow (line 6) | @WorkflowInterface
method start (line 8) | @WorkflowMethod
method makePurchase (line 11) | @UpdateMethod
method makePurchaseValidator (line 14) | @UpdateValidatorMethod(updateName = "makePurchase")
method exit (line 17) | @SignalMethod
FILE: springboot/src/main/java/io/temporal/samples/springboot/update/PurchaseWorkflowImpl.java
class PurchaseWorkflowImpl (line 10) | @WorkflowImpl(taskQueues = "UpdateSampleTaskQueue")
method start (line 20) | @Override
method makePurchase (line 26) | @Override
method makePurchaseValidator (line 42) | @Override
method exit (line 59) | @Override
FILE: springboot/src/main/java/io/temporal/samples/springboot/update/ResourceNotFoundException.java
class ResourceNotFoundException (line 6) | @ResponseStatus(value = HttpStatus.NOT_FOUND)
method ResourceNotFoundException (line 8) | public ResourceNotFoundException(String message) {
FILE: springboot/src/main/java/io/temporal/samples/springboot/update/model/Product.java
class Product (line 5) | @Entity
method Product (line 26) | public Product() {}
method Product (line 28) | public Product(Integer id, String name, String code, String descriptio...
method getId (line 37) | public Integer getId() {
method setId (line 41) | public void setId(Integer id) {
method getName (line 45) | public String getName() {
method setName (line 49) | public void setName(String name) {
method getCode (line 53) | public String getCode() {
method setCode (line 57) | public void setCode(String code) {
method getDescription (line 61) | public String getDescription() {
method setDescription (line 65) | public void setDescription(String description) {
method getPrice (line 69) | public int getPrice() {
method setPrice (line 73) | public void setPrice(int price) {
method getStock (line 77) | public int getStock() {
method setStock (line 81) | public void setStock(int stock) {
method removeStock (line 85) | public boolean removeStock() {
method removeStock (line 94) | public boolean removeStock(int value) {
method addStock (line 103) | public void addStock() {
method addStock (line 107) | public void addStock(int value) {
FILE: springboot/src/main/java/io/temporal/samples/springboot/update/model/ProductRepository.java
type ProductRepository (line 6) | @Repository
FILE: springboot/src/main/java/io/temporal/samples/springboot/update/model/Purchase.java
class Purchase (line 3) | public class Purchase {
method Purchase (line 7) | public Purchase() {}
method Purchase (line 9) | public Purchase(int product, int amount) {
method getProduct (line 14) | public int getProduct() {
method setProduct (line 18) | public void setProduct(int product) {
method getAmount (line 22) | public int getAmount() {
method setAmount (line 26) | public void setAmount(int amount) {
FILE: springboot/src/main/resources/static/js/jquery.sse.js
function createEventSource (line 77) | function createEventSource(me) {
function createAjax (line 100) | function createAjax(me) {
function runAjax (line 107) | function runAjax(me) {
FILE: springboot/src/test/java/io/temporal/samples/springboot/CamelSampleTest.java
class CamelSampleTest (line 20) | @SpringBootTest(classes = HelloSampleTest.Configuration.class)
method setUp (line 33) | @BeforeEach
method testOrdersWorkflow (line 38) | @Test
FILE: springboot/src/test/java/io/temporal/samples/springboot/CustomizeSampleTest.java
class CustomizeSampleTest (line 20) | @SpringBootTest(classes = CustomizeSampleTest.Configuration.class)
method setUp (line 33) | @BeforeEach
method testHello (line 38) | @Test
class Configuration (line 52) | @ComponentScan
FILE: springboot/src/test/java/io/temporal/samples/springboot/HelloSampleTest.java
class HelloSampleTest (line 21) | @SpringBootTest(classes = HelloSampleTest.Configuration.class)
method setUp (line 35) | @BeforeEach
method testHello (line 40) | @Test
class Configuration (line 54) | @ComponentScan
FILE: springboot/src/test/java/io/temporal/samples/springboot/HelloSampleTestMockedActivity.java
class HelloSampleTestMockedActivity (line 31) | @SpringBootTest(classes = HelloSampleTestMockedActivity.Configuration.cl...
method setUp (line 49) | @BeforeEach
method testHello (line 54) | @Test
class Configuration (line 76) | @ComponentScan
method getTestActivityImpl (line 80) | @Bean
FILE: springboot/src/test/java/io/temporal/samples/springboot/KafkaConsumerTestHelper.java
class KafkaConsumerTestHelper (line 8) | @Component
method receive (line 13) | @KafkaListener(id = "samples-test-id", topics = "${samples.message.top...
method getLatch (line 20) | public CountDownLatch getLatch() {
method getPayload (line 24) | public String getPayload() {
method setPayload (line 28) | private void setPayload(String payload) {
FILE: springboot/src/test/java/io/temporal/samples/springboot/KafkaSampleTest.java
class KafkaSampleTest (line 19) | @SpringBootTest(classes = KafkaSampleTest.Configuration.class)
method setUp (line 36) | @BeforeEach
method testKafkaWorflow (line 41) | @Test
class Configuration (line 62) | @ComponentScan
FILE: springboot/src/test/java/io/temporal/samples/springboot/UpdateSampleTest.java
class UpdateSampleTest (line 21) | @SpringBootTest(classes = HelloSampleTest.Configuration.class)
method setUp (line 35) | @BeforeEach
method testUpdate (line 40) | @Test
method testUpdateRejected (line 57) | @Test()
class Configuration (line 78) | @ComponentScan
Condensed preview — 632 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,424K chars).
[
{
"path": ".github/CODEOWNERS",
"chars": 328,
"preview": "# Primary owners\n\n* @tsurdilo @temporalio/sdk @antmendoza\n\n# Below are owners for samples for modules\n# that are owned b"
},
{
"path": ".github/dependabot.yml",
"chars": 208,
"preview": "version: 2\nupdates:\n - package-ecosystem: \"gradle\"\n directory: \"/\"\n schedule:\n interval: \"weekly\"\n - packag"
},
{
"path": ".github/workflows/ci.yml",
"chars": 1519,
"preview": "name: \"Continuous Integration\"\non: [push, pull_request]\npermissions:\n contents: read\n\njobs:\n validation:\n name: \"Gr"
},
{
"path": ".gitignore",
"chars": 128,
"preview": "target\n.*.swp\n.*.swo\n*.iml\n.DS_Store\n.idea\n.gradle\n**/build/\n**/out/\n.classpath\n.project\n.settings/\nbin/\ncore/.vscode/\n."
},
{
"path": "LICENSE",
"chars": 748,
"preview": "Temporal Java SDK\n\nCopyright (c) 2025 Temporal Technologies, Inc. All Rights Reserved\n\nCopyright (c) 2017 Uber Technolog"
},
{
"path": "README.md",
"chars": 19734,
"preview": "# Temporal Java SDK Samples\n\nThis repository contains samples that demonstrate various capabilities of \nTemporal using t"
},
{
"path": "build.gradle",
"chars": 1192,
"preview": "plugins {\n id \"net.ltgt.errorprone\" version \"4.0.1\"\n id 'com.diffplug.spotless' version '6.25.0' apply false\n i"
},
{
"path": "core/build.gradle",
"chars": 3192,
"preview": "dependencies {\n // Temporal SDK\n implementation \"io.temporal:temporal-sdk:$javaSDKVersion\"\n implementation \"io."
},
{
"path": "core/src/main/java/io/temporal/samples/apikey/ApiKeyWorker.java",
"chars": 2979,
"preview": "package io.temporal.samples.apikey;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.client.WorkflowClientO"
},
{
"path": "core/src/main/java/io/temporal/samples/apikey/MyWorkflow.java",
"chars": 218,
"preview": "package io.temporal.samples.apikey;\n\nimport io.temporal.workflow.WorkflowInterface;\nimport io.temporal.workflow.Workflow"
},
{
"path": "core/src/main/java/io/temporal/samples/apikey/MyWorkflowImpl.java",
"chars": 154,
"preview": "package io.temporal.samples.apikey;\n\npublic class MyWorkflowImpl implements MyWorkflow {\n @Override\n public String exe"
},
{
"path": "core/src/main/java/io/temporal/samples/apikey/README.md",
"chars": 2782,
"preview": "# Workflow execution with API Key\n\nThis example shows how to secure your Temporal application with API Key authenticatio"
},
{
"path": "core/src/main/java/io/temporal/samples/apikey/Starter.java",
"chars": 2795,
"preview": "package io.temporal.samples.apikey;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.client.WorkflowClientO"
},
{
"path": "core/src/main/java/io/temporal/samples/asyncchild/ChildWorkflow.java",
"chars": 230,
"preview": "package io.temporal.samples.asyncchild;\n\nimport io.temporal.workflow.WorkflowInterface;\nimport io.temporal.workflow.Work"
},
{
"path": "core/src/main/java/io/temporal/samples/asyncchild/ChildWorkflowImpl.java",
"chars": 293,
"preview": "package io.temporal.samples.asyncchild;\n\nimport io.temporal.workflow.Workflow;\nimport java.time.Duration;\n\npublic class "
},
{
"path": "core/src/main/java/io/temporal/samples/asyncchild/ParentWorkflow.java",
"chars": 295,
"preview": "package io.temporal.samples.asyncchild;\n\nimport io.temporal.api.common.v1.WorkflowExecution;\nimport io.temporal.workflow"
},
{
"path": "core/src/main/java/io/temporal/samples/asyncchild/ParentWorkflowImpl.java",
"chars": 1295,
"preview": "package io.temporal.samples.asyncchild;\n\nimport io.temporal.api.common.v1.WorkflowExecution;\nimport io.temporal.api.enum"
},
{
"path": "core/src/main/java/io/temporal/samples/asyncchild/README.md",
"chars": 295,
"preview": "# Async Child Workflow execution\n\nThe sample demonstrates shows how to invoke a Child Workflow asynchronously.\nThe Child"
},
{
"path": "core/src/main/java/io/temporal/samples/asyncchild/Starter.java",
"chars": 3364,
"preview": "package io.temporal.samples.asyncchild;\n\nimport io.temporal.api.common.v1.WorkflowExecution;\nimport io.temporal.api.work"
},
{
"path": "core/src/main/java/io/temporal/samples/asyncuntypedchild/ChildWorkflow.java",
"chars": 605,
"preview": "package io.temporal.samples.asyncuntypedchild;\n\nimport io.temporal.workflow.WorkflowInterface;\nimport io.temporal.workfl"
},
{
"path": "core/src/main/java/io/temporal/samples/asyncuntypedchild/ChildWorkflowImpl.java",
"chars": 602,
"preview": "package io.temporal.samples.asyncuntypedchild;\n\nimport io.temporal.workflow.Workflow;\n\n/**\n * Define the parent workflow"
},
{
"path": "core/src/main/java/io/temporal/samples/asyncuntypedchild/ParentWorkflow.java",
"chars": 587,
"preview": "package io.temporal.samples.asyncuntypedchild;\n\nimport io.temporal.workflow.WorkflowInterface;\nimport io.temporal.workfl"
},
{
"path": "core/src/main/java/io/temporal/samples/asyncuntypedchild/ParentWorkflowImpl.java",
"chars": 1596,
"preview": "package io.temporal.samples.asyncuntypedchild;\n\nimport static io.temporal.samples.asyncuntypedchild.Starter.WORKFLOW_ID;"
},
{
"path": "core/src/main/java/io/temporal/samples/asyncuntypedchild/README.md",
"chars": 301,
"preview": "# Async Child Workflow execution\n\nThe sample demonstrates shows how to invoke an Untyped Child Workflow asynchronously.\n"
},
{
"path": "core/src/main/java/io/temporal/samples/asyncuntypedchild/Starter.java",
"chars": 3393,
"preview": "package io.temporal.samples.asyncuntypedchild;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.client.Work"
},
{
"path": "core/src/main/java/io/temporal/samples/autoheartbeat/AutoHeartbeatUtil.java",
"chars": 3032,
"preview": "/*\n * Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved\n *\n * Copyright 2012-2016 Amazon.com, Inc. or"
},
{
"path": "core/src/main/java/io/temporal/samples/autoheartbeat/README.md",
"chars": 1323,
"preview": "# Auto-heartbeating sample for activities that define HeartbeatTimeout\n\nThis sample shows an implementation of an \"auto-"
},
{
"path": "core/src/main/java/io/temporal/samples/autoheartbeat/Starter.java",
"chars": 6760,
"preview": "/*\n * Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved\n *\n * Copyright 2012-2016 Amazon.com, Inc. or"
},
{
"path": "core/src/main/java/io/temporal/samples/autoheartbeat/activities/AutoActivities.java",
"chars": 969,
"preview": "/*\n * Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved\n *\n * Copyright 2012-2016 Amazon.com, Inc. or"
},
{
"path": "core/src/main/java/io/temporal/samples/autoheartbeat/activities/AutoActivitiesImpl.java",
"chars": 1513,
"preview": "/*\n * Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved\n *\n * Copyright 2012-2016 Amazon.com, Inc. or"
},
{
"path": "core/src/main/java/io/temporal/samples/autoheartbeat/interceptor/AutoHeartbeatActivityInboundCallsInterceptor.java",
"chars": 4197,
"preview": "/*\n * Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved\n *\n * Copyright 2012-2016 Amazon.com, Inc. or"
},
{
"path": "core/src/main/java/io/temporal/samples/autoheartbeat/interceptor/AutoHeartbeatWorkerInterceptor.java",
"chars": 1183,
"preview": "/*\n * Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved\n *\n * Copyright 2012-2016 Amazon.com, Inc. or"
},
{
"path": "core/src/main/java/io/temporal/samples/autoheartbeat/workflows/AutoWorkflow.java",
"chars": 1062,
"preview": "/*\n * Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved\n *\n * Copyright 2012-2016 Amazon.com, Inc. or"
},
{
"path": "core/src/main/java/io/temporal/samples/autoheartbeat/workflows/AutoWorkflowImpl.java",
"chars": 3321,
"preview": "/*\n * Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved\n *\n * Copyright 2012-2016 Amazon.com, Inc. or"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/HeartbeatingActivityBatchStarter.java",
"chars": 1608,
"preview": "package io.temporal.samples.batch.heartbeatingactivity;\n\nimport static io.temporal.samples.batch.heartbeatingactivity.He"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/HeartbeatingActivityBatchWorker.java",
"chars": 1517,
"preview": "package io.temporal.samples.batch.heartbeatingactivity;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.en"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/HeartbeatingActivityBatchWorkflow.java",
"chars": 366,
"preview": "package io.temporal.samples.batch.heartbeatingactivity;\n\nimport io.temporal.workflow.WorkflowInterface;\nimport io.tempor"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/HeartbeatingActivityBatchWorkflowImpl.java",
"chars": 1597,
"preview": "package io.temporal.samples.batch.heartbeatingactivity;\n\nimport io.temporal.activity.ActivityOptions;\nimport io.temporal"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/README.md",
"chars": 1143,
"preview": "A sample implementation of processing a batch by an Activity.\n\nAn Activity can run as long as needed. \nIt reports that i"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordLoader.java",
"chars": 639,
"preview": "package io.temporal.samples.batch.heartbeatingactivity;\n\nimport java.util.Optional;\n\n/**\n * Helper class that is used to"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordLoaderImpl.java",
"chars": 428,
"preview": "package io.temporal.samples.batch.heartbeatingactivity;\n\nimport java.util.Optional;\n\n/** Fake implementation of RecordLo"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordProcessor.java",
"chars": 281,
"preview": "package io.temporal.samples.batch.heartbeatingactivity;\n\n/** A helper class that implements record processing. */\npublic"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordProcessorActivity.java",
"chars": 240,
"preview": "package io.temporal.samples.batch.heartbeatingactivity;\n\nimport io.temporal.activity.ActivityInterface;\n\n@ActivityInterf"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordProcessorActivityImpl.java",
"chars": 2730,
"preview": "package io.temporal.samples.batch.heartbeatingactivity;\n\nimport io.temporal.activity.Activity;\nimport io.temporal.activi"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/RecordProcessorImpl.java",
"chars": 555,
"preview": "package io.temporal.samples.batch.heartbeatingactivity;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n/** F"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/heartbeatingactivity/SingleRecord.java",
"chars": 435,
"preview": "package io.temporal.samples.batch.heartbeatingactivity;\n\n/** Record to process. A real application would add a use case "
},
{
"path": "core/src/main/java/io/temporal/samples/batch/iterator/IteratorBatchStarter.java",
"chars": 1530,
"preview": "package io.temporal.samples.batch.iterator;\n\nimport static io.temporal.samples.batch.iterator.IteratorBatchWorker.TASK_Q"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/iterator/IteratorBatchWorker.java",
"chars": 1465,
"preview": "package io.temporal.samples.batch.iterator;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.envconfig.Clie"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/iterator/IteratorBatchWorkflow.java",
"chars": 541,
"preview": "package io.temporal.samples.batch.iterator;\n\nimport io.temporal.workflow.WorkflowInterface;\nimport io.temporal.workflow."
},
{
"path": "core/src/main/java/io/temporal/samples/batch/iterator/IteratorBatchWorkflowImpl.java",
"chars": 2411,
"preview": "package io.temporal.samples.batch.iterator;\n\nimport io.temporal.activity.ActivityOptions;\nimport io.temporal.workflow.As"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/iterator/README.md",
"chars": 1104,
"preview": "A sample implementation of the Workflow iterator pattern.\n\nA workflow starts a configured number of Child Workflows in p"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/iterator/RecordLoader.java",
"chars": 730,
"preview": "package io.temporal.samples.batch.iterator;\n\nimport io.temporal.activity.ActivityInterface;\nimport java.util.List;\n\n/**\n"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/iterator/RecordLoaderImpl.java",
"chars": 676,
"preview": "package io.temporal.samples.batch.iterator;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/** Fake implementation"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/iterator/RecordProcessorWorkflow.java",
"chars": 356,
"preview": "package io.temporal.samples.batch.iterator;\n\nimport io.temporal.workflow.WorkflowInterface;\nimport io.temporal.workflow."
},
{
"path": "core/src/main/java/io/temporal/samples/batch/iterator/RecordProcessorWorkflowImpl.java",
"chars": 624,
"preview": "package io.temporal.samples.batch.iterator;\n\nimport io.temporal.workflow.Workflow;\nimport java.time.Duration;\nimport jav"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/iterator/SingleRecord.java",
"chars": 429,
"preview": "package io.temporal.samples.batch.iterator;\n\n/** Record to process. A real application would add a use case specific dat"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/slidingwindow/BatchProgress.java",
"chars": 688,
"preview": "package io.temporal.samples.batch.slidingwindow;\n\nimport java.util.Set;\n\n/** Used as a result of {@link SlidingWindowBat"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/slidingwindow/BatchWorkflow.java",
"chars": 924,
"preview": "package io.temporal.samples.batch.slidingwindow;\n\nimport io.temporal.workflow.WorkflowInterface;\nimport io.temporal.work"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/slidingwindow/BatchWorkflowImpl.java",
"chars": 2187,
"preview": "package io.temporal.samples.batch.slidingwindow;\n\nimport io.temporal.activity.ActivityOptions;\nimport io.temporal.workfl"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/slidingwindow/ProcessBatchInput.java",
"chars": 2059,
"preview": "package io.temporal.samples.batch.slidingwindow;\n\nimport java.util.HashSet;\nimport java.util.Set;\n\n/** Input of {@link S"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/slidingwindow/README.md",
"chars": 1738,
"preview": "A sample implementation of a batch processing Workflow that maintains a sliding window of record processing Workflows.\n\n"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/slidingwindow/RecordIterable.java",
"chars": 2724,
"preview": "package io.temporal.samples.batch.slidingwindow;\n\nimport io.temporal.activity.ActivityOptions;\nimport io.temporal.workfl"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/slidingwindow/RecordLoader.java",
"chars": 680,
"preview": "package io.temporal.samples.batch.slidingwindow;\n\nimport io.temporal.activity.ActivityInterface;\nimport java.util.List;\n"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/slidingwindow/RecordLoaderImpl.java",
"chars": 712,
"preview": "package io.temporal.samples.batch.slidingwindow;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/** Fake loader im"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/slidingwindow/RecordProcessorWorkflow.java",
"chars": 475,
"preview": "package io.temporal.samples.batch.slidingwindow;\n\nimport io.temporal.workflow.WorkflowInterface;\nimport io.temporal.work"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/slidingwindow/RecordProcessorWorkflowImpl.java",
"chars": 1346,
"preview": "package io.temporal.samples.batch.slidingwindow;\n\nimport io.temporal.workflow.Workflow;\nimport java.time.Duration;\nimpor"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/slidingwindow/SingleRecord.java",
"chars": 385,
"preview": "package io.temporal.samples.batch.slidingwindow;\n\n/** Record to process. */\npublic class SingleRecord {\n private int id"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/slidingwindow/SlidingWindowBatchStarter.java",
"chars": 1333,
"preview": "package io.temporal.samples.batch.slidingwindow;\n\nimport static io.temporal.samples.batch.slidingwindow.SlidingWindowBat"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/slidingwindow/SlidingWindowBatchWorker.java",
"chars": 1457,
"preview": "package io.temporal.samples.batch.slidingwindow;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.envconfig"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/slidingwindow/SlidingWindowBatchWorkflow.java",
"chars": 559,
"preview": "package io.temporal.samples.batch.slidingwindow;\n\nimport io.temporal.workflow.QueryMethod;\nimport io.temporal.workflow.S"
},
{
"path": "core/src/main/java/io/temporal/samples/batch/slidingwindow/SlidingWindowBatchWorkflowImpl.java",
"chars": 5435,
"preview": "package io.temporal.samples.batch.slidingwindow;\n\nimport io.temporal.api.common.v1.WorkflowExecution;\nimport io.temporal"
},
{
"path": "core/src/main/java/io/temporal/samples/bookingsaga/Booking.java",
"chars": 1067,
"preview": "package io.temporal.samples.bookingsaga;\n\npublic final class Booking {\n private String carReservationID;\n private Stri"
},
{
"path": "core/src/main/java/io/temporal/samples/bookingsaga/README.md",
"chars": 605,
"preview": "## Saga example: trip booking\n\nTemporal implementation of\nthe [Camunda BPMN trip booking example](https://github.com/ber"
},
{
"path": "core/src/main/java/io/temporal/samples/bookingsaga/TripBookingActivities.java",
"chars": 1565,
"preview": "package io.temporal.samples.bookingsaga;\n\nimport io.temporal.activity.ActivityInterface;\n\n@ActivityInterface\npublic inte"
},
{
"path": "core/src/main/java/io/temporal/samples/bookingsaga/TripBookingActivitiesImpl.java",
"chars": 1560,
"preview": "package io.temporal.samples.bookingsaga;\n\nimport io.temporal.failure.ApplicationFailure;\nimport java.util.UUID;\n\npublic "
},
{
"path": "core/src/main/java/io/temporal/samples/bookingsaga/TripBookingClient.java",
"chars": 1478,
"preview": "package io.temporal.samples.bookingsaga;\n\nimport com.google.common.base.Throwables;\nimport io.temporal.client.WorkflowCl"
},
{
"path": "core/src/main/java/io/temporal/samples/bookingsaga/TripBookingWorker.java",
"chars": 1879,
"preview": "package io.temporal.samples.bookingsaga;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.envconfig.ClientC"
},
{
"path": "core/src/main/java/io/temporal/samples/bookingsaga/TripBookingWorkflow.java",
"chars": 245,
"preview": "package io.temporal.samples.bookingsaga;\n\nimport io.temporal.workflow.WorkflowInterface;\nimport io.temporal.workflow.Wor"
},
{
"path": "core/src/main/java/io/temporal/samples/bookingsaga/TripBookingWorkflowImpl.java",
"chars": 2145,
"preview": "package io.temporal.samples.bookingsaga;\n\nimport io.temporal.activity.ActivityOptions;\nimport io.temporal.failure.Activi"
},
{
"path": "core/src/main/java/io/temporal/samples/bookingsyncsaga/Booking.java",
"chars": 1005,
"preview": "package io.temporal.samples.bookingsyncsaga;\n\npublic final class Booking {\n private final String carReservationID;\n pr"
},
{
"path": "core/src/main/java/io/temporal/samples/bookingsyncsaga/README.md",
"chars": 641,
"preview": "## Saga example: synchronous trip booking\n\nThe sample demonstrates low latency workflow with client synchronously waitin"
},
{
"path": "core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingActivities.java",
"chars": 1569,
"preview": "package io.temporal.samples.bookingsyncsaga;\n\nimport io.temporal.activity.ActivityInterface;\n\n@ActivityInterface\npublic "
},
{
"path": "core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingActivitiesImpl.java",
"chars": 1795,
"preview": "package io.temporal.samples.bookingsyncsaga;\n\nimport io.temporal.failure.ApplicationFailure;\nimport java.util.UUID;\n\npub"
},
{
"path": "core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingClient.java",
"chars": 1652,
"preview": "package io.temporal.samples.bookingsyncsaga;\n\nimport com.google.common.base.Throwables;\nimport io.temporal.client.Workfl"
},
{
"path": "core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingWorker.java",
"chars": 1908,
"preview": "package io.temporal.samples.bookingsyncsaga;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.envconfig.Cli"
},
{
"path": "core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingWorkflow.java",
"chars": 526,
"preview": "package io.temporal.samples.bookingsyncsaga;\n\nimport io.temporal.workflow.UpdateMethod;\nimport io.temporal.workflow.Work"
},
{
"path": "core/src/main/java/io/temporal/samples/bookingsyncsaga/TripBookingWorkflowImpl.java",
"chars": 3405,
"preview": "package io.temporal.samples.bookingsyncsaga;\n\nimport io.temporal.activity.ActivityOptions;\nimport io.temporal.activity.L"
},
{
"path": "core/src/main/java/io/temporal/samples/common/QueryWorkflowExecution.java",
"chars": 1953,
"preview": "package io.temporal.samples.common;\n\nimport io.temporal.api.common.v1.WorkflowExecution;\nimport io.temporal.client.Workf"
},
{
"path": "core/src/main/java/io/temporal/samples/countinterceptor/ClientCounter.java",
"chars": 3356,
"preview": "package io.temporal.samples.countinterceptor;\n\nimport java.util.AbstractMap;\nimport java.util.Collections;\nimport java.u"
},
{
"path": "core/src/main/java/io/temporal/samples/countinterceptor/InterceptorStarter.java",
"chars": 3604,
"preview": "package io.temporal.samples.countinterceptor;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.client.Workf"
},
{
"path": "core/src/main/java/io/temporal/samples/countinterceptor/README.md",
"chars": 564,
"preview": "# Demo Workflow Interceptor\n\nThe sample demonstrates: \n- the use of a simple Worker Workflow Interceptor that counts the"
},
{
"path": "core/src/main/java/io/temporal/samples/countinterceptor/SimpleClientCallsInterceptor.java",
"chars": 1337,
"preview": "package io.temporal.samples.countinterceptor;\n\nimport io.temporal.common.interceptors.WorkflowClientCallsInterceptor;\nim"
},
{
"path": "core/src/main/java/io/temporal/samples/countinterceptor/SimpleClientInterceptor.java",
"chars": 617,
"preview": "package io.temporal.samples.countinterceptor;\n\nimport io.temporal.common.interceptors.WorkflowClientCallsInterceptor;\nim"
},
{
"path": "core/src/main/java/io/temporal/samples/countinterceptor/SimpleCountActivityInboundCallsInterceptor.java",
"chars": 920,
"preview": "package io.temporal.samples.countinterceptor;\n\nimport io.temporal.activity.ActivityExecutionContext;\nimport io.temporal."
},
{
"path": "core/src/main/java/io/temporal/samples/countinterceptor/SimpleCountWorkerInterceptor.java",
"chars": 528,
"preview": "package io.temporal.samples.countinterceptor;\n\nimport io.temporal.common.interceptors.*;\n\npublic class SimpleCountWorker"
},
{
"path": "core/src/main/java/io/temporal/samples/countinterceptor/SimpleCountWorkflowInboundCallsInterceptor.java",
"chars": 1403,
"preview": "package io.temporal.samples.countinterceptor;\n\nimport io.temporal.common.interceptors.WorkflowInboundCallsInterceptor;\ni"
},
{
"path": "core/src/main/java/io/temporal/samples/countinterceptor/SimpleCountWorkflowOutboundCallsInterceptor.java",
"chars": 729,
"preview": "package io.temporal.samples.countinterceptor;\n\nimport io.temporal.common.interceptors.WorkflowOutboundCallsInterceptor;\n"
},
{
"path": "core/src/main/java/io/temporal/samples/countinterceptor/WorkerCounter.java",
"chars": 3641,
"preview": "package io.temporal.samples.countinterceptor;\n\nimport java.util.AbstractMap;\nimport java.util.Collections;\nimport java.u"
},
{
"path": "core/src/main/java/io/temporal/samples/countinterceptor/activities/MyActivities.java",
"chars": 254,
"preview": "package io.temporal.samples.countinterceptor.activities;\n\nimport io.temporal.activity.ActivityInterface;\n\n@ActivityInter"
},
{
"path": "core/src/main/java/io/temporal/samples/countinterceptor/activities/MyActivitiesImpl.java",
"chars": 346,
"preview": "package io.temporal.samples.countinterceptor.activities;\n\npublic class MyActivitiesImpl implements MyActivities {\n @Ove"
},
{
"path": "core/src/main/java/io/temporal/samples/countinterceptor/workflow/MyChildWorkflow.java",
"chars": 269,
"preview": "package io.temporal.samples.countinterceptor.workflow;\n\nimport io.temporal.workflow.WorkflowInterface;\nimport io.tempora"
},
{
"path": "core/src/main/java/io/temporal/samples/countinterceptor/workflow/MyChildWorkflowImpl.java",
"chars": 690,
"preview": "package io.temporal.samples.countinterceptor.workflow;\n\nimport io.temporal.activity.ActivityOptions;\nimport io.temporal."
},
{
"path": "core/src/main/java/io/temporal/samples/countinterceptor/workflow/MyWorkflow.java",
"chars": 501,
"preview": "package io.temporal.samples.countinterceptor.workflow;\n\nimport io.temporal.workflow.QueryMethod;\nimport io.temporal.work"
},
{
"path": "core/src/main/java/io/temporal/samples/countinterceptor/workflow/MyWorkflowImpl.java",
"chars": 1206,
"preview": "package io.temporal.samples.countinterceptor.workflow;\n\nimport io.temporal.workflow.ChildWorkflowOptions;\nimport io.temp"
},
{
"path": "core/src/main/java/io/temporal/samples/customannotation/BenignExceptionTypes.java",
"chars": 618,
"preview": "package io.temporal.samples.customannotation;\n\nimport java.lang.annotation.*;\n\n/**\n * BenignExceptionTypes is an annotat"
},
{
"path": "core/src/main/java/io/temporal/samples/customannotation/BenignExceptionTypesAnnotationInterceptor.java",
"chars": 4410,
"preview": "/*\n * Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved\n *\n * Copyright 2012-2016 Amazon.com, Inc. or"
},
{
"path": "core/src/main/java/io/temporal/samples/customannotation/CustomAnnotation.java",
"chars": 7668,
"preview": "/*\n * Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved\n *\n * Copyright 2012-2016 Amazon.com, Inc. or"
},
{
"path": "core/src/main/java/io/temporal/samples/customannotation/README.md",
"chars": 428,
"preview": "# Custom annotation\n\nThe sample demonstrates how to create a custom annotation using an interceptor. In this case the an"
},
{
"path": "core/src/main/java/io/temporal/samples/customchangeversion/CustomChangeVersionActivities.java",
"chars": 274,
"preview": "package io.temporal.samples.customchangeversion;\n\nimport io.temporal.activity.ActivityInterface;\n\n@ActivityInterface\npub"
},
{
"path": "core/src/main/java/io/temporal/samples/customchangeversion/CustomChangeVersionActivitiesImpl.java",
"chars": 460,
"preview": "package io.temporal.samples.customchangeversion;\n\npublic class CustomChangeVersionActivitiesImpl implements CustomChange"
},
{
"path": "core/src/main/java/io/temporal/samples/customchangeversion/CustomChangeVersionStarter.java",
"chars": 3727,
"preview": "package io.temporal.samples.customchangeversion;\n\nimport io.grpc.StatusRuntimeException;\nimport io.temporal.api.enums.v1"
},
{
"path": "core/src/main/java/io/temporal/samples/customchangeversion/CustomChangeVersionWorkflow.java",
"chars": 256,
"preview": "package io.temporal.samples.customchangeversion;\n\nimport io.temporal.workflow.WorkflowInterface;\nimport io.temporal.work"
},
{
"path": "core/src/main/java/io/temporal/samples/customchangeversion/CustomChangeVersionWorkflowImpl.java",
"chars": 2605,
"preview": "package io.temporal.samples.customchangeversion;\n\nimport io.temporal.activity.ActivityOptions;\nimport io.temporal.common"
},
{
"path": "core/src/main/java/io/temporal/samples/customchangeversion/README.md",
"chars": 1032,
"preview": "## Custom Change Version Search Attribute Sample\n\nThis sample shows how to upsert custom search attribute when adding a "
},
{
"path": "core/src/main/java/io/temporal/samples/dsl/DslActivities.java",
"chars": 206,
"preview": "package io.temporal.samples.dsl;\n\nimport io.temporal.activity.ActivityInterface;\n\n@ActivityInterface\npublic interface Ds"
},
{
"path": "core/src/main/java/io/temporal/samples/dsl/DslActivitiesImpl.java",
"chars": 666,
"preview": "package io.temporal.samples.dsl;\n\nimport java.util.concurrent.TimeUnit;\n\npublic class DslActivitiesImpl implements DslAc"
},
{
"path": "core/src/main/java/io/temporal/samples/dsl/DslWorkflow.java",
"chars": 278,
"preview": "package io.temporal.samples.dsl;\n\nimport io.temporal.samples.dsl.model.Flow;\nimport io.temporal.workflow.WorkflowInterfa"
},
{
"path": "core/src/main/java/io/temporal/samples/dsl/DslWorkflowImpl.java",
"chars": 1880,
"preview": "package io.temporal.samples.dsl;\n\nimport io.temporal.activity.ActivityOptions;\nimport io.temporal.common.RetryOptions;\ni"
},
{
"path": "core/src/main/java/io/temporal/samples/dsl/README.md",
"chars": 628,
"preview": "# DSL Sample\n\nThis sample shows how to use a DSL on top of Temporal.\nThe sample defines a number of domain specific json"
},
{
"path": "core/src/main/java/io/temporal/samples/dsl/Starter.java",
"chars": 1992,
"preview": "package io.temporal.samples.dsl;\n\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport io.temporal.client.Workflow"
},
{
"path": "core/src/main/java/io/temporal/samples/dsl/model/Flow.java",
"chars": 935,
"preview": "package io.temporal.samples.dsl.model;\n\nimport java.util.List;\n\npublic class Flow {\n private String id;\n private Strin"
},
{
"path": "core/src/main/java/io/temporal/samples/dsl/model/FlowAction.java",
"chars": 1192,
"preview": "package io.temporal.samples.dsl.model;\n\npublic class FlowAction {\n private String action;\n private String compensateBy"
},
{
"path": "core/src/main/java/io/temporal/samples/earlyreturn/EarlyReturnClient.java",
"chars": 2977,
"preview": "package io.temporal.samples.earlyreturn;\n\nimport io.temporal.api.enums.v1.WorkflowIdConflictPolicy;\nimport io.temporal.c"
},
{
"path": "core/src/main/java/io/temporal/samples/earlyreturn/EarlyReturnWorker.java",
"chars": 805,
"preview": "package io.temporal.samples.earlyreturn;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.worker.Worker;\nim"
},
{
"path": "core/src/main/java/io/temporal/samples/earlyreturn/README.md",
"chars": 1163,
"preview": "### Early-Return Sample\n\nThis sample demonstrates an early-return from a workflow.\n\nBy utilizing Update-with-Start, a cl"
},
{
"path": "core/src/main/java/io/temporal/samples/earlyreturn/Transaction.java",
"chars": 1270,
"preview": "package io.temporal.samples.earlyreturn;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jack"
},
{
"path": "core/src/main/java/io/temporal/samples/earlyreturn/TransactionActivities.java",
"chars": 467,
"preview": "package io.temporal.samples.earlyreturn;\n\nimport io.temporal.activity.ActivityInterface;\nimport io.temporal.activity.Act"
},
{
"path": "core/src/main/java/io/temporal/samples/earlyreturn/TransactionActivitiesImpl.java",
"chars": 1723,
"preview": "package io.temporal.samples.earlyreturn;\n\nimport io.temporal.failure.ApplicationFailure;\n\npublic class TransactionActivi"
},
{
"path": "core/src/main/java/io/temporal/samples/earlyreturn/TransactionRequest.java",
"chars": 1128,
"preview": "package io.temporal.samples.earlyreturn;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jack"
},
{
"path": "core/src/main/java/io/temporal/samples/earlyreturn/TransactionWorkflow.java",
"chars": 386,
"preview": "package io.temporal.samples.earlyreturn;\n\nimport io.temporal.workflow.UpdateMethod;\nimport io.temporal.workflow.Workflow"
},
{
"path": "core/src/main/java/io/temporal/samples/earlyreturn/TransactionWorkflowImpl.java",
"chars": 1606,
"preview": "package io.temporal.samples.earlyreturn;\n\nimport io.temporal.activity.ActivityOptions;\nimport io.temporal.workflow.Workf"
},
{
"path": "core/src/main/java/io/temporal/samples/earlyreturn/TxResult.java",
"chars": 893,
"preview": "package io.temporal.samples.earlyreturn;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jack"
},
{
"path": "core/src/main/java/io/temporal/samples/encodefailures/CustomerAgeCheck.java",
"chars": 267,
"preview": "package io.temporal.samples.encodefailures;\n\nimport io.temporal.workflow.WorkflowInterface;\nimport io.temporal.workflow."
},
{
"path": "core/src/main/java/io/temporal/samples/encodefailures/CustomerAgeCheckImpl.java",
"chars": 576,
"preview": "package io.temporal.samples.encodefailures;\n\nimport io.temporal.workflow.Workflow;\n\npublic class CustomerAgeCheckImpl im"
},
{
"path": "core/src/main/java/io/temporal/samples/encodefailures/InvalidCustomerException.java",
"chars": 191,
"preview": "package io.temporal.samples.encodefailures;\n\npublic class InvalidCustomerException extends Exception {\n public InvalidC"
},
{
"path": "core/src/main/java/io/temporal/samples/encodefailures/MyCustomer.java",
"chars": 615,
"preview": "package io.temporal.samples.encodefailures;\n\npublic class MyCustomer {\n private String name;\n private int age;\n priva"
},
{
"path": "core/src/main/java/io/temporal/samples/encodefailures/README.md",
"chars": 996,
"preview": "# Using Codec to encode / decode failure messages\n\nThe sample demonstrates how to set up a simple codec for encoding/dec"
},
{
"path": "core/src/main/java/io/temporal/samples/encodefailures/SimplePrefixPayloadCodec.java",
"chars": 1493,
"preview": "package io.temporal.samples.encodefailures;\n\nimport com.google.protobuf.ByteString;\nimport io.temporal.api.common.v1.Pay"
},
{
"path": "core/src/main/java/io/temporal/samples/encodefailures/Starter.java",
"chars": 3972,
"preview": "package io.temporal.samples.encodefailures;\n\nimport io.temporal.api.common.v1.Payload;\nimport io.temporal.api.history.v1"
},
{
"path": "core/src/main/java/io/temporal/samples/encryptedpayloads/CryptCodec.java",
"chars": 4809,
"preview": "package io.temporal.samples.encryptedpayloads;\n\nimport com.google.protobuf.ByteString;\nimport io.temporal.api.common.v1."
},
{
"path": "core/src/main/java/io/temporal/samples/encryptedpayloads/EncryptedPayloadsActivity.java",
"chars": 4769,
"preview": "package io.temporal.samples.encryptedpayloads;\n\nimport io.temporal.activity.ActivityInterface;\nimport io.temporal.activi"
},
{
"path": "core/src/main/java/io/temporal/samples/envconfig/LoadFromFile.java",
"chars": 3320,
"preview": "package io.temporal.samples.envconfig;\n\n// @@@SNIPSTART java-env-config-profile\nimport io.temporal.client.WorkflowClient"
},
{
"path": "core/src/main/java/io/temporal/samples/envconfig/LoadProfile.java",
"chars": 3647,
"preview": "package io.temporal.samples.envconfig;\n\n// @@@SNIPSTART java-env-config-profile-with-overrides\nimport io.temporal.client"
},
{
"path": "core/src/main/java/io/temporal/samples/envconfig/README.md",
"chars": 741,
"preview": "# Environment Configuration Sample\n\nThis sample demonstrates how to configure a Temporal client using TOML configuration"
},
{
"path": "core/src/main/java/io/temporal/samples/excludefrominterceptor/README.md",
"chars": 770,
"preview": "# Excluding certain Workflow and Activity Types from interceptors\n\nThis sample shows how to exclude certain workflow typ"
},
{
"path": "core/src/main/java/io/temporal/samples/excludefrominterceptor/RunMyWorkflows.java",
"chars": 3681,
"preview": "package io.temporal.samples.excludefrominterceptor;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.client"
},
{
"path": "core/src/main/java/io/temporal/samples/excludefrominterceptor/activities/ForInterceptorActivities.java",
"chars": 276,
"preview": "package io.temporal.samples.excludefrominterceptor.activities;\n\nimport io.temporal.activity.ActivityInterface;\n\n@Activit"
},
{
"path": "core/src/main/java/io/temporal/samples/excludefrominterceptor/activities/ForInterceptorActivitiesImpl.java",
"chars": 287,
"preview": "package io.temporal.samples.excludefrominterceptor.activities;\n\npublic class ForInterceptorActivitiesImpl implements For"
},
{
"path": "core/src/main/java/io/temporal/samples/excludefrominterceptor/activities/MyActivities.java",
"chars": 234,
"preview": "package io.temporal.samples.excludefrominterceptor.activities;\n\nimport io.temporal.activity.ActivityInterface;\n\n@Activit"
},
{
"path": "core/src/main/java/io/temporal/samples/excludefrominterceptor/activities/MyActivitiesImpl.java",
"chars": 233,
"preview": "package io.temporal.samples.excludefrominterceptor.activities;\n\npublic class MyActivitiesImpl implements MyActivities {\n"
},
{
"path": "core/src/main/java/io/temporal/samples/excludefrominterceptor/interceptor/MyActivityInboundCallsInterceptor.java",
"chars": 1712,
"preview": "package io.temporal.samples.excludefrominterceptor.interceptor;\n\nimport io.temporal.activity.ActivityExecutionContext;\ni"
},
{
"path": "core/src/main/java/io/temporal/samples/excludefrominterceptor/interceptor/MyWorkerInterceptor.java",
"chars": 1118,
"preview": "package io.temporal.samples.excludefrominterceptor.interceptor;\n\nimport io.temporal.common.interceptors.*;\nimport java.u"
},
{
"path": "core/src/main/java/io/temporal/samples/excludefrominterceptor/interceptor/MyWorkflowInboundCallsInterceptor.java",
"chars": 1924,
"preview": "package io.temporal.samples.excludefrominterceptor.interceptor;\n\nimport io.temporal.activity.ActivityOptions;\nimport io."
},
{
"path": "core/src/main/java/io/temporal/samples/excludefrominterceptor/interceptor/MyWorkflowOutboundCallsInterceptor.java",
"chars": 1595,
"preview": "package io.temporal.samples.excludefrominterceptor.interceptor;\n\nimport io.temporal.activity.ActivityOptions;\nimport io."
},
{
"path": "core/src/main/java/io/temporal/samples/excludefrominterceptor/workflows/MyWorkflow.java",
"chars": 190,
"preview": "package io.temporal.samples.excludefrominterceptor.workflows;\n\nimport io.temporal.workflow.WorkflowMethod;\n\npublic inter"
},
{
"path": "core/src/main/java/io/temporal/samples/excludefrominterceptor/workflows/MyWorkflowOne.java",
"chars": 183,
"preview": "package io.temporal.samples.excludefrominterceptor.workflows;\n\nimport io.temporal.workflow.WorkflowInterface;\n\n@Workflow"
},
{
"path": "core/src/main/java/io/temporal/samples/excludefrominterceptor/workflows/MyWorkflowOneImpl.java",
"chars": 649,
"preview": "package io.temporal.samples.excludefrominterceptor.workflows;\n\nimport io.temporal.activity.ActivityOptions;\nimport io.te"
},
{
"path": "core/src/main/java/io/temporal/samples/excludefrominterceptor/workflows/MyWorkflowTwo.java",
"chars": 183,
"preview": "package io.temporal.samples.excludefrominterceptor.workflows;\n\nimport io.temporal.workflow.WorkflowInterface;\n\n@Workflow"
},
{
"path": "core/src/main/java/io/temporal/samples/excludefrominterceptor/workflows/MyWorkflowTwoImpl.java",
"chars": 649,
"preview": "package io.temporal.samples.excludefrominterceptor.workflows;\n\nimport io.temporal.activity.ActivityOptions;\nimport io.te"
},
{
"path": "core/src/main/java/io/temporal/samples/fileprocessing/FileProcessingStarter.java",
"chars": 2237,
"preview": "package io.temporal.samples.fileprocessing;\n\nimport static io.temporal.samples.fileprocessing.FileProcessingWorker.TASK_"
},
{
"path": "core/src/main/java/io/temporal/samples/fileprocessing/FileProcessingWorker.java",
"chars": 2622,
"preview": "package io.temporal.samples.fileprocessing;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.envconfig.Clie"
},
{
"path": "core/src/main/java/io/temporal/samples/fileprocessing/FileProcessingWorkflow.java",
"chars": 334,
"preview": "package io.temporal.samples.fileprocessing;\n\nimport io.temporal.workflow.WorkflowInterface;\nimport io.temporal.workflow."
},
{
"path": "core/src/main/java/io/temporal/samples/fileprocessing/FileProcessingWorkflowImpl.java",
"chars": 4263,
"preview": "package io.temporal.samples.fileprocessing;\n\nimport io.temporal.activity.ActivityOptions;\nimport io.temporal.common.Retr"
},
{
"path": "core/src/main/java/io/temporal/samples/fileprocessing/README.md",
"chars": 942,
"preview": "Demonstrates how to route tasks to specific Workers. This sample has a set of Activities that download a file, processes"
},
{
"path": "core/src/main/java/io/temporal/samples/fileprocessing/StoreActivities.java",
"chars": 1147,
"preview": "package io.temporal.samples.fileprocessing;\n\nimport io.temporal.activity.ActivityInterface;\nimport java.net.URL;\n\n@Activ"
},
{
"path": "core/src/main/java/io/temporal/samples/fileprocessing/StoreActivitiesImpl.java",
"chars": 2178,
"preview": "package io.temporal.samples.fileprocessing;\n\nimport com.google.common.io.Files;\nimport com.google.common.io.Resources;\ni"
},
{
"path": "core/src/main/java/io/temporal/samples/getresultsasync/MyWorkflow.java",
"chars": 240,
"preview": "package io.temporal.samples.getresultsasync;\n\nimport io.temporal.workflow.WorkflowInterface;\nimport io.temporal.workflow"
},
{
"path": "core/src/main/java/io/temporal/samples/getresultsasync/MyWorkflowImpl.java",
"chars": 324,
"preview": "package io.temporal.samples.getresultsasync;\n\nimport io.temporal.workflow.Workflow;\nimport java.time.Duration;\n\npublic c"
},
{
"path": "core/src/main/java/io/temporal/samples/getresultsasync/README.md",
"chars": 474,
"preview": "# Get Workflow results async\n\nThis sample shows the use of WorkflowStub.getResult and WorkflowStub.getResultAsync\nto sho"
},
{
"path": "core/src/main/java/io/temporal/samples/getresultsasync/Starter.java",
"chars": 2277,
"preview": "package io.temporal.samples.getresultsasync;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.client.Workfl"
},
{
"path": "core/src/main/java/io/temporal/samples/getresultsasync/Worker.java",
"chars": 1207,
"preview": "package io.temporal.samples.getresultsasync;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.envconfig.Cli"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloAccumulator.java",
"chars": 23657,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.ActivityInterface;\nimport io.temporal.activity.ActivityO"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloActivity.java",
"chars": 6646,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.ActivityInterface;\nimport io.temporal.activity.ActivityM"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloActivityExclusiveChoice.java",
"chars": 7931,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.ActivityInterface;\nimport io.temporal.activity.ActivityO"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloActivityRetry.java",
"chars": 8140,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.ActivityInterface;\nimport io.temporal.activity.ActivityO"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloAsync.java",
"chars": 6627,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.ActivityInterface;\nimport io.temporal.activity.ActivityO"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloAsyncActivityCompletion.java",
"chars": 8408,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.*;\nimport io.temporal.client.ActivityCompletionClient;\ni"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloAsyncLambda.java",
"chars": 7003,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.ActivityInterface;\nimport io.temporal.activity.ActivityO"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloAwait.java",
"chars": 5151,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.client.WorkflowOptions;"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloCancellationScope.java",
"chars": 12159,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.Activity;\nimport io.temporal.activity.ActivityCancellati"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloCancellationScopeWithTimer.java",
"chars": 8009,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.*;\nimport io.temporal.client.ActivityCompletionException"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloChild.java",
"chars": 5903,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.client.WorkflowOptions;"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloCron.java",
"chars": 8173,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.Activity;\nimport io.temporal.activity.ActivityInterface;"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloDelayedStart.java",
"chars": 4284,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.client.WorkflowOptions;"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloDetachedCancellationScope.java",
"chars": 7396,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.Activity;\nimport io.temporal.activity.ActivityCancellati"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloDynamic.java",
"chars": 5012,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.Activity;\nimport io.temporal.activity.ActivityOptions;\ni"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloEagerWorkflowStart.java",
"chars": 7032,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.ActivityInterface;\nimport io.temporal.activity.ActivityM"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloException.java",
"chars": 9274,
"preview": "package io.temporal.samples.hello;\n\nimport com.google.common.base.Throwables;\nimport io.temporal.activity.Activity;\nimpo"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloLocalActivity.java",
"chars": 5463,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.ActivityInterface;\nimport io.temporal.activity.ActivityM"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloParallelActivity.java",
"chars": 6754,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.ActivityInterface;\nimport io.temporal.activity.ActivityO"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloPeriodic.java",
"chars": 10788,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.Activity;\nimport io.temporal.activity.ActivityInterface;"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloPolymorphicActivity.java",
"chars": 8230,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.ActivityInterface;\nimport io.temporal.activity.ActivityO"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloQuery.java",
"chars": 5468,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.client.WorkflowOptions;"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloSaga.java",
"chars": 12358,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.ActivityInterface;\nimport io.temporal.activity.ActivityM"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloSchedules.java",
"chars": 9641,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.Activity;\nimport io.temporal.activity.ActivityInterface;"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloSearchAttributes.java",
"chars": 9591,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.ActivityInterface;\nimport io.temporal.activity.ActivityM"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloSideEffect.java",
"chars": 8268,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.ActivityInterface;\nimport io.temporal.activity.ActivityO"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloSignal.java",
"chars": 6540,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.client.WorkflowClient;\nimport io.temporal.client.WorkflowOptions;"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloSignalWithStartAndWorkflowInit.java",
"chars": 6984,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.ActivityInterface;\nimport io.temporal.activity.ActivityO"
},
{
"path": "core/src/main/java/io/temporal/samples/hello/HelloSignalWithTimer.java",
"chars": 5944,
"preview": "package io.temporal.samples.hello;\n\nimport io.temporal.activity.ActivityInterface;\nimport io.temporal.activity.ActivityO"
}
]
// ... and 432 more files (download for full content)
About this extraction
This page contains the full source code of the temporalio/samples-java GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 632 files (1.3 MB), approximately 299.8k tokens, and a symbol index with 2233 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.