@Override public Void visitExecutable(ExecutableElement method, ProcessingEnvironment env) { if (method.getAnnotation(Execute.class) != null) { String workflowName = ProcessorUtils.computeWorkflowName( workflowDefinition.getInterfaceName(), method); String workflowVersion = ProcessorUtils.computeWorkflowVersion(method); ExecuteMethod executeMethod = new ExecuteMethod(workflowName, workflowVersion); setMethodInfo(method, executeMethod, workflowDefinition.getPackageName()); executeMethod.setAnnotationsToCopy(ProcessorUtils.getAnnotationsText(env, method, annotationsToExcludeFromCopying)); workflowDefinition.setExecuteMethod(executeMethod); } else if (method.getAnnotation(Signal.class) != null) { String signalName = ProcessorUtils.computeSignalName(method); SignalMethod signalMethod = new SignalMethod(signalName); setMethodInfo(method, signalMethod, workflowDefinition.getPackageName()); workflowDefinition.getSignals().add(signalMethod); } else if (method.getAnnotation(GetState.class) != null) { GetStateMethod getStateMethod = new GetStateMethod(); setMethodInfo(method, getStateMethod, workflowDefinition.getPackageName()); workflowDefinition.setGetStateMethod(getStateMethod); } return super.visitExecutable(method, env); }
public static String computeWorkflowName(String interfaceName, ExecutableElement workflow) { assert(workflow != null); String workflowName = null; Execute options = workflow.getAnnotation(Execute.class); if (options != null && !options.name().isEmpty()) { workflowName = options.name(); } else { workflowName = interfaceName + "." + workflow.getSimpleName().toString(); } return workflowName; }
public static String computeWorkflowVersion(ExecutableElement workflow) { String version = "1.0"; // Default Execute options = workflow.getAnnotation(Execute.class); if (!options.version().isEmpty()) { version = options.version(); } return version; }
@Execute(version = "1.0") public void greet();
@Execute(version = "1.0") public void loop(int times);
@Execute(version = "1.0") public void placeOrder(int amount);
@Execute(version = "1.0") public void runMultipleActivitiesConcurrently();
@Execute(version = "1.1") void process();
@Execute(version = "1.0") public void processOrder();
@Execute(version = "1.0") public void startWorkflow();
@Execute(version = "1.0") void startWorkflow();
@Execute(version = "1.0") public void doWhile();
@Execute(version = "1.0") Promise<List<String>> search(String query);
@Execute(version = "1.0") public void startWorkflow() throws Throwable ;
@Execute(version = "1.0") public Promise<Integer> parallelComputing(int braches);
@Execute(name = "SplitMergeWorkflowExample", version = "1.0") void average(String bucketName, String fileName, final int numberOfWorkers);
@Execute(version = "1.0") void helloWorld(String name);
@Execute(name = "ProcessFile", version = "1.0") public void processFile(String sourceBucketName, String sourceFilename, String targetBucketName, String targetFilename) throws IOException;
@Execute(name = "MakeBooking", version = "1.0") void makeBooking(int requestID, int customerID, boolean reserveAir, boolean reserveCar);
@Execute( name = ExportInstanceWorkflow.WORKFLOW_TYPE, version = ExportInstanceWorkflow.WORKFLOW_VERSION ) void export( ExportInstanceRequest request );
@Execute( name = "JobWorkflow", version = "1.0" ) void executeCommand( RunJobRequest request );
@Execute( name = ExportSnapshotWorkflow.WORKFLOW_TYPE, version = ExportSnapshotWorkflow.WORKFLOW_VERSION ) void export( ExportSnapshotRequest request );
@Execute( name = "CheckWaitWorkflow", version = "1.0" ) void checkAndWait( CheckAndWait request ) throws TimeoutException;
/** * Process the file at inputBucketName.inputFileName. * Place the result at outputBucketName.outputFileName. * * @param inputBucketName input bucket to process from * @param inputFilename input file to process from * @param outputBucketName output bucket to put result to * @param outputFilename output file to put result to * @throws IOException */ @Execute(name = "ProcessFile", version = "1.0") void processFile(String inputBucketName, String inputFilename, String outputBucketName, String outputFilename) throws IOException;
/** * <p> * Start the race including organizing the horses, counting laps, and * announcing winners. * </p> * <p> * Note that the method is marked with {@link Execute}. This signals the * stub generator to generate corresponding methods in the stubs and * configure the stubs to use them to request new workflows. * </p> * * @param horseNames * the names of the horses in the race. * * @param laps * the number laps to run. */ @Execute(version = "1.0.0") void go(Collection<String> horseNames, int laps);
/** * deploy the whole stack * @return Url of the stack webserver */ @Execute(version="1.0") public Promise<String> deploy(String springTemplate);
/** * Start workflow that executes activity according to options. * * @param activity * activity type to execute * @param activityArguments * arguments passed to activity * @param cronExpression * time pattern in unix cron format. * @param continueAsNewAfterSeconds * frequency of a new workflow run creation */ @Execute(name = "CronWorkflow", version = "1.1") void startCron(CronWithRetryWorkflowOptions options);
/** * Start workflow that executes activity according to options. */ @Execute(name = "CronWorkflow", version = "1.0") void startCron(CronWorkflowOptions options);
/** * Start workflow that executes activity according to options. * * @param activity * activity type to execute * @param options * define the schedule of the execution. */ @Execute(name = "PeriodicWorkflow", version = "1.0") void startPeriodicWorkflow(ActivityType activity, Object[] activityArguments, PeriodicWorkflowOptions options);
/** * Entry of workflow */ @Execute( name = "NoOpWorkflow", version = "1.0" ) void run();