Posted: 1 month agoLast activity: 1 month 1 week ago
Calling activities dynamically
Hi I want to know the best approach to call activities dynamically.
lets say I have an Activity Test in TGB-HRApps-Work-Candidate.I want to call Activity B (TGB-HRApps-Work-BenefitsEnrollment) and Activity C (TGB-HRApps-Work-PayrollSetup) based on some conditions from Test Activity.What is the best approach to achieve ?
***Edited by Moderator Marissa to update platform capability tags****
That just an example. My question is If I have a requirement to call activities of different classes which are not in inheritance path based on a condition, what would be the best approach ? How can I dynamically change the step page context to call the activities ?
The short answer is you would need an instance of BenefitsEnrollment as a page on the clipboard. The name of that page is referenced as your Step Page at which point you use "Call ActivityB". Same principle applies with Activity C.
Note that your "When" configurations for any Activity step also use the Step Page as the context, so you would need to use "Primary" here to refer to your existing Candidate instance (which is the context for the call to your "Test" Activity) in 'When' expressions where the Step Page references a different page on the clipboard (i.e. your instance of BenefitsEnrollment or PayrollSetup)
Reply back if this isn't addressing what you were asking.
The activity in other class may also be called using 'Call ClassName.ActivityName' instruction. For example, in your case you can call Activity B by using instruction as 'Call TGB-HRApps-Work-BenefitsEnrollment.Activity B' and in same way you can call Activity C using 'Call TGB-HRApps-Work-PayrollSetup.Activity C' from Activity Test.