How to loop through all Import steps within the node of the workflow hierarchy?
- 2 years ago
Yup! Makes total sense what you are striving for. The generalized strategy would be:
- Get your list of base Import profiles; either systematically (ideal) or from a manual list (simple/effective)
- For each profile, get the TextX property and add to a list
- Do your SFTP checks against the list
If we just focus on the first two components it might look something like the below. For clarity I'll assume the following structure:
Parent Level Workflow Group
|--- Workflow1 |----- Import |----- Forms |----- Adj |--- Workflow2 |----- Import |----- Forms |----- Adj |--- Etc...
Getting the list of .Import workflows (Workflow1.Import, Workflow2.Import):
Dim parentWfProfileInfo As WorkflowProfileInfo = BRApi.Workflow.Metadata.GetProfile(si, _ "Parent Level Workflow Group") Dim baseWfProfileInfo As New List (Of WorkflowProfileInfo)( _ BRApi.Workflow.Metadata.GetRelatives(si, _ BRApi.Workflow.General.GetWorkflowUnitClusterPk(si, _ parentWfProfileInfo.Name, "YourScenarioName", "YourApplicableTimePeriod"), _ WorkflowProfileRelativeTypes.Descendants, _ WorkflowProfileTypes.InputImportChild ))
Getting the TextX Attributes for each base .Import profile:
Dim textXAttribute As New List(Of String) 'will store the value of attribute from each profile For Each profile In baseWfProfileInfo textXAttribute.Add( _ profile.GetAttribute( _ scenarioType.TheAssociatedScenarioType.Id, _ sharedconstants.WorkflowProfileAttributeIndexes.Text1 _ ).Value ) 'I assume Text1 here Next
At this point the textXAttribute is a list of strings containing the pieces you were after. You can do your SFTP comparison logic against this. Or turn this into a delimited string, etc. etc.
One thing to note! I'm assuming the textX attributes are stored at the .Import level. If they are stored one level up you'll change the GetRelatives section.
Whew! Hope that makes sense or is enough to get you started in the correct direction. Follow-ups are welcomed.
Cheers! -db