1

I would like to inject a value in to an annotation. Below I'm using an annotation for an Simple Workflow (SWF) class:

@Activities(version = "1.00")
@ActivityRegistrationOptions(defaultTaskList = FlowConstants.NO_DEFAULT_TASK_LIST)
public interface MyActivities {
    ...
}

Rather than use a constant, how do I inject a value to use for defaultTaskList?

Kias
  • 841
  • 9
  • 22

1 Answers1

1

You can't specify anything else than a constant in an annotation.


However, I'm no SWF expert (far from it...), but I think the point of defaultTaskList is to provide the default value. The javadoc states that you may specify the list on activity invocation:

defaultTaskList: Task list that activity task is delivered through when no task list is specified on activity invocation.

Example from amazon (tasklist1):

AmazonSimpleWorkflow swfClient = new AmazonSimpleWorkflowClient(awsCredentials);
ActivityWorker worker = new ActivityWorker(swfClient,
                                           "domain1",
                                           "tasklist1");
worker.addActivitiesImplementation(new MyActivitiesImpl());

// Start worker
worker.start(); 
alexbt
  • 16,415
  • 6
  • 78
  • 87
  • The default value depends on the context. E.g. if it's on a dev machine the task list will be different than a prod machine, etc. I think it may be possible using http://stackoverflow.com/a/2897856/654495 – Kias Sep 08 '16 at 17:34