Hi there,
I often have the need to write a subscriber that runs after a specific job has run. In order to find the right job in my subscriber I have code like this:
public class OnAfterErpOrderImport : NotificationSubscriber { public override void OnNotify(string notification, NotificationArgs args) { var localArgs = (Integration.JobFinishedIntegrationArgs)args; if (localArgs.Job.Name.ToLower() == "Import BC Sales Orders".ToLower() && !localArgs.JobFailed)
The check for the job's name is hard coded which is problematic as an integration engineer may change it without realizing there's a subscriber that uses it. It also makes it more difficult to use the same subscriber against multiple jobs without having to update the code and redeploy.
Can a field be added to the data integration job that we can use for this purpose? Similar to the TagName on pages? Then I can set it to, say ImportOrder and update my code as follows:
if (localArgs.Job.Tag == "ImportOrders" && !localArgs.JobFailed)
And then I can reuse this tag on other jobs and/or rename my jobs without causing any issues.
Thanks!
Imar