Fetch Workflow Information inside Transformation Event handler

Shivangi
New Contributor II

Dear Community,

 

I'm currently working with event handlers and need to retrieve workflow-related information within the FinalizeValidateIntersect operation. I'm using si.WorkflowClusterPk to access this data, but I'm exploring alternative approaches to avoid relying solely on this method.
Thank You.
5 REPLIES 5

JackLacava
Community Manager
Community Manager

This is very vague. What is wrong with relying on that property? If you search the helper tree for "Workflow" or "Cluster" you'll find plenty of Wf-related options ...

 

 

 

Krishna
Valued Contributor

@Shivangi  - Could you please provide more details what are you trying to achieve ? The Si.WorkflowClusterPk  will get you the current selection of WFP. As @JackLacava mentioned there are other methods to get the WFP information. Example Parent or descendants. See below example. 

'Get the Workflow and Loop through with Text 1 Value
Dim gTime As String = BRApi.Workflow.General.GetGlobalTime(si)
Dim scenario As String = "Actual"
Dim wfClusterPk2 As WorkflowUnitClusterPk = BRApi.Workflow.General.GetWorkflowUnitClusterPk(si, _
      "Total Corporate", scenario, gTime)
Dim objList As List(Of WorkFlowProfileInfo) = BRApi.Workflow.Metadata.GetRelatives(si, _
      wfClusterPk2, WorkflowProfileRelativeTypes.Descendants, _
      WorkflowProfileTypes.InputImportChild)
			
Thanks
Krishna

Shivangi
New Contributor II

Hi @Krishna ,

The issue is as you mentioned, Im trying to run an automation but the Si.WorkflowClusterPk is fetching only the current workflow information. So is there any way that I could achieve fetching the workflow name or related information dynamically please.

Krishna
Valued Contributor

@Shivangi  - If you are performing automation then

1. you can call the WF name in the Rule and create a DM job, schedule it in the Task Manager. Or

2. you can use my previous example which will loop through the all the WF profile and you can define the condition to execute the WF and invoke using DM and schedule in task manager. 

3. If it is Direct Connect then you can use the Data Import Scheduler Open Place solution to schedule the WF data load.

Hope this helps

Thanks
Krishna

Shivangi
New Contributor II

Sure, Thank You Very much!