public interface AutoFlowService
AutoFlowLaunchable
object. An example of an AutoFlowLaunchable object is a
TLF
.
NOTE: To successfully create an auto flow, these requirements must be met:
Assuming that the process flow definition is active and the element mapping is complete, the next step is to enable the TLF for auto flow and specify values for the TLF attributes that are mapped. First, get the study TLF from which you would like to create a process flow. For this example, get the first one in the list.
StudyTlfInfo tlfInfo = studyTlfService.getTlfs(study.getId(), standard.getBaseStandardTypeInfo().getName(),
standard.getModelId());
List<Tlf> tlfs = tlfInfo.getTlfs();
Tlf tlf = tlfs.iterator().next();
Then, update the TLF attribute values with those values to populate the created process flow. In this example, a user
is specified for the attribute "User Assignment 1".
tlf.setEnableAutoFlow(true);
List<AttributeValue> attributeValues = tlf.getAttributes();
UserDescriptor userA = getUser("userA");
attributeValues.add(new AttributeValue("User Assignment 1", userA));
tlf.setAttributes(attributeValues);
tlfInfo = studyTlfService.setTlfs(tlfInfo);
Once you have enabled auto flow and specified all of your attribute values, you can create the auto flow:
ProcessFlowDescriptor processFlow = autoFlowService.createAutoFlow(study.getId(),
processDefinition.getProcessDefinitionKey(), AutoFlowType.TLF, "autoFlowPrefix_", tlf.getId());
The created process flow is created and activated with the values that are specified in the TLF attributes.Modifier and Type | Method and Description |
---|---|
ProcessFlowDescriptor |
createAutoFlow(String contextId,
String processDefinitionKey,
AutoFlowType autoFlowType,
String namePrefix,
String sourceId)
Automatically create a process flow based on a process flow definition whose elements have been mapped to source
(for example, TLF) metadata.
|
ProcessFlowDescriptor createAutoFlow(String contextId, String processDefinitionKey, AutoFlowType autoFlowType, String namePrefix, String sourceId) throws AutoFlowSetupException, AutoFlowException
contextId
- The identifier of the context.processDefinitionKey
- The process flow definition key.autoFlowType
- The type from which a process flow can be automatically created.namePrefix
- The prefix to add to the name (name of source) of the process flow created.sourceId
- The identifier of the source from which the process flow is created.AutoFlowSetupException
- Thrown when the set up is incomplete to automatically create process flows.AutoFlowException
- Thrown when there is an issue during process flow creation.<i>Copyright (c) 2021, SAS Institute Inc., Cary, NC, USA</i>