06-06-2024 01:23 PM - edited 06-06-2024 01:24 PM
This is a doubt with the rest of the questions I have, and is that in the new workflow I created, when I hit complete worklfow there are two data management that are not executed (COPY_PLP_TO_PLN, PROCESS_PLP), which are below, but I try it in other workflows and it works correctly.
Then I wanted to know how I can solve this in the new workflow, so that when I complete the workflow it also runs those data management as in the others.
Solved! Go to Solution.
06-06-2024 02:03 PM
That does not seem to be the action triggered on clicking the Complete Button but the calculate plan.
I suggest you work backwards from the PLP Dashboard in Design Mode to see which Business Rule and Function the button is calling. Once you have the Business Rule identified, you will see something like this which is triggering the Data Management Job:
BRApi.Utilities.StartDataMgmtSequence(si, m_DataMgmtCalcSequenceName, params)
or
BRApi.Utilities.StartDataMgmtSequence(si, m_DataMgmtCalcSequenceName, params)
06-06-2024 01:31 PM
HI @Marco ,
Must be something in the Dashboard Extender Business Rule that its executed when you click the Complete Button. Something likely referencing the Workflow name..
If you share the code we can take a look.
06-06-2024 01:45 PM - edited 06-06-2024 01:48 PM
Hi Aformenti.
the problem is that this functionality is being extended to other BRs and other data management, but from what I have checked, none of them send a call to the ones I need for the steps.
(Rule) PLP_SolutionHelper - > CalculatePlan -> (Function) CalculatePlanMain -> ( Function)CalculateSinglePlanDataMgmt -> (Data Management) CalculatePlan_PLP -> PLP_DataMgmt -> Singlecalc (yes) -> PLP_SolutionHelper -> CalculateSinglePlan
Else If (args.FunctionName.XFEqualsIgnoreCase("CalculatePlan"))
selectionResult = Me.CalculatePlanMain(si, globals, api, args)
If Not Me.m_CustomEvents Is Nothing Then Me.m_CustomEvents.AfterSelectionChangedEvent(si, globals, api, args, selectionResult)
Return selectionResult
06-06-2024 02:03 PM
That does not seem to be the action triggered on clicking the Complete Button but the calculate plan.
I suggest you work backwards from the PLP Dashboard in Design Mode to see which Business Rule and Function the button is calling. Once you have the Business Rule identified, you will see something like this which is triggering the Data Management Job:
BRApi.Utilities.StartDataMgmtSequence(si, m_DataMgmtCalcSequenceName, params)
or
BRApi.Utilities.StartDataMgmtSequence(si, m_DataMgmtCalcSequenceName, params)
06-06-2024 02:18 PM
Try
'Prepare Parameters
Dim params As New Dictionary(Of String, String)
params.Add("SingleCalc", "False")
params.Add("ProfileKey", wfClusterPk.ProfileKey.ToString)
params.Add("ScenarioId", wfClusterPk.ScenarioKey.ToString)
params.Add("TimeId", wfClusterPk.TimeKey.ToString)
params.Add("BatchSize", "100")
'Determine how to execute the Data Mgmt Task (Sync or Async)
If runAsBackgroundTask Then
BRApi.Utilities.StartDataMgmtSequence(si, Me.m_DataMgmtCalcSequenceName, params)
Else
BRApi.Utilities.ExecuteDataMgmtSequence(si, Me.m_DataMgmtCalcSequenceName, params)
End If
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
this is the one I found, and what you get is this:
Dim m_DataMgmtCalcSequenceName = "CalculatePlan_PLP"
but it is part of the process I had already found