Skip to main content

I am using a C# REST service call to start a workspace. Passing the notification directives in the body.

The notification subscription is setup with the PUSH service call. Basically, the subscription makes a service call when the workspace is failed or successful.

When I published the workspace, with JobSubmitter, I made sure the right writer output is selected to be included in the service call, but the writer output will be included only if I run that workspace from WebUI, not with the service call. Is there a directive\\parameter that I can use in the initial service call to tell the notification to include the writer content in the notification body?

Any thoughts?

I forgot to add the REST service call body:

 

{

 

"publishedParameters":

 

p{"name":"_SourceDataset","value":"MySourceDirectory"},{"name":"_ResultDataset","value":"MyOtputDirectory"} ],

 

 

"NMDirectives":

 

{ "successTopics": u"Success_Topic"],

 

"failureTopics": q"Failure_Topic"]

 

}

 

}

I see two possible solutions to work around this if there is no solution using extra directive/parameter:

  1. Refer to this question to replace your REST call by a call to the jobsubmitter service. This will use what you configured at publication time: https://knowledge.safe.com/questions/29537/problem-with-notification-that-are-not-activated.html
  2. Use a workspace in a push subscription, make it read the standard json about the failed or successful workspace, get the jobid, retrieve the job parameters using REST call (Ex: http://fmeserver/fmerest/v2/transformations/jobs/id/42/request?accept=json&detail;=low) and from there, find the correct writer output location, read the json and notify your topic with the read json.

Regards,

Larry


Can you watch the topic monitoring panel to make sure the notification is actually being triggered. That would be the first step to debugging this, just to make sure the first step is working.

 


Can you watch the topic monitoring panel to make sure the notification is actually being triggered. That would be the first step to debugging this, just to make sure the first step is working.

 

The notification is being triggered. I am watching that. I was also told by support that you can not actually get the output with a REST service call, but it can be achieved with a JobSubmitter service, as Larry stated below.

 

 


I see two possible solutions to work around this if there is no solution using extra directive/parameter:

  1. Refer to this question to replace your REST call by a call to the jobsubmitter service. This will use what you configured at publication time: https://knowledge.safe.com/questions/29537/problem-with-notification-that-are-not-activated.html
  2. Use a workspace in a push subscription, make it read the standard json about the failed or successful workspace, get the jobid, retrieve the job parameters using REST call (Ex: http://fmeserver/fmerest/v2/transformations/jobs/id/42/request?accept=json&detail;=low) and from there, find the correct writer output location, read the json and notify your topic with the read json.

Regards,

Larry

Thanks for answering, Larry.

We ended up writing and then reading from the file for now. This was the initial plan, but as we developed it made sense to do everything in memory, if possible. The file writing works for now ... I may test the jobsubmitter later, when I get a chance ...


Reply