public interface AutoFlowService
AutoFlowLaunchable
's attributes. An example of an AutoFlowLaunchable object is a
TLF
.
NOTE: To successfully create an auto flow, the following must be true:
Assuming the process definition is active, and the element mapping is complete, the next step is to enable the TLF for auto flow and provide values for the TLF attributes that are mapped. First, get the study TLF from which you would like to create a process flow. For simplicity, this example will 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, you can update the TLF attribute values with those you want the created process flow to be populated with. In
this example, a user is being set for 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 should now be created and activated with the values 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 definition whose elements have been mapped to source (ex:
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 definition key.autoFlowType
- The type from which a process flow can be automatically created.namePrefix
- The prefix to be added to the name (name of source) of the process flow created.sourceId
- The identifier of the source from which the process flow is being created.AutoFlowSetupException
- Thrown if setup is incomplete for automatically creating process flows.AutoFlowException
- Thrown if there was an issue during process flow creation.<i>Copyright (c) 2020, SAS Institute Inc., Cary, NC, USA</i>