Package: com.appistry.task
Annotations
Unlimited, limited, and exclusive task annotations
@TaskParameter (string parameterAlias)
The fabric automatically populates a task method's parameters on method execution with task request entries matching the parameters' name. The alias enables you to match parameters when the task request entry does not match the parameter by name. This annotation may only be set on Parameter types. The following sets up the population of an int parameter.
public void execute(@TaskParameter("MyIntParameter") int MyInt)
{
...
}
@TaskField or @TaskField(string fieldNameAlias) or @TaskField(FieldType fieldType) or @TaskField(string fieldNameAlias, FieldType fieldType)
The fabric automatically populates properties marked with the @TaskField attribute on method execution with task request entries matching the variable's name. Alternately, the developer may use a fieldNameAlias if the value's key name does not match the variable's name.
This annotation may only be set on public class member field types. The default is PropertyType.IN_OUT.
This annotation specifies how a field's value is managed. The possible options are FieldType.IN_OUT or FieldType.OUT.
FieldType.IN_OUT indicates the fabric populates the class member field with any task request entry matching the field by name before the task method is called, and set the member field's value back in to the task request after execution.
FieldType.OUT indicates the fabric only sets the Property's value back into the task request after execution. The following are example uses of @TaskField.
@TaskField(name = "MyString")
public String MyInOutString;
@TaskField(name = "OutOnlyInt", type = FieldType.OUT)
public int MyOutOnlyInt;
@TaskResult
This annotation allows you to indicate a specific public String member field to use as the task result returned by the task execution. This annotation may only be set on public String class member field types. The following sets up the task result field.
@TaskResult
public String myExecutionResult;
@TaskRequest
This annotation enables you to access the TaskRequest object. This annotation may only be set on public ITaskRequest class member fields. The @TaskRequest annotation does not work on background tasks. The following introduces the TaskRequest object into the task environment.
@TaskRequest
public ITaskRequest request;
Background task annotations
@FamSession
This annotation enables a background task to access the FAM_Session object, enable FAM-related operations. This annotation may only be set on public FAM_Session class member field types. Non-background tasks may access the FAM_Session object through the @TaskRequest annotation. The following introduces the FAM_Session object into the background task environment.
@FamSession
public FAM_Session session;
@BGTaskFailureMessage
This annotation enables a background task to set a message on public String member class field that indicates the reason that a background task has failed upon execution. When the background task execution returns control to the fabric, this message will be logged to the Fabric multicast log address. The following sets up a background failure message field.
@BGTaskFailureMessage
public String failureMessage;