Question

Writing Variable to Workbench Response

  • 17 November 2017
  • 7 replies
  • 6 views

Badge

Hi,

I am executing a workbench through web using FME Javascript and in response i am getting the below variables:

id:438numFeaturesOutput:65priority:100requesterHost:"192.168.1.103"requesterResultPort:52869status:"SUCCESS"statusMessage:"Translation Successful"timeFinished:"2017-11-18T01:20:11"timeRequested:"2017-11-18T01:19:59"timeStarted:"2017-11-18T01:19:59"

Can i write my custom variable to this response? If Yes, Please elaborate the method.


7 replies

Userlevel 1
Badge +4

Hi,

If I understand it correctly you would like to receive a result from the workspace. I suspect that the workbench you are executing is run through a "jobsubmitter" or "datadownload" service. If you do run it through a "datastreaming" service instead and make sure it writes something parseable like Json or XML you could basically receive any kind of output from the workspace.

Badge +7

Hi,

If I understand it correctly you would like to receive a result from the workspace. I suspect that the workbench you are executing is run through a "jobsubmitter" or "datadownload" service. If you do run it through a "datastreaming" service instead and make sure it writes something parseable like Json or XML you could basically receive any kind of output from the workspace.

Unless the workspace crashes and never writes anything. I struggled with that earlier: see this thread.

 

Userlevel 4
Badge +25

Or do you want to be able to put custom information into that response?

I believe the success/failure message can be set at a global level, see Response Messages under:

https://docs.safe.com/fme/html/FME_Server_Documentation/Content/ReferenceManual/config_file_layout.htm?Highlight=response

Also check out MACRO_DEF in the same document. It states:

"When defined, macros are available for use in pre- and post-commands, and in success and failure response strings, using the pseudo-variable (!macroName!) syntax."

So if you set a macro, it should be output in the response string (or that is how I read it). I don't think you can set the macro after the event, so it would need to be set at runtime, not in response to an event that happened in the workspace.

Does that help? If not let me know and I can investigate some more.

Badge

Or do you want to be able to put custom information into that response?

I believe the success/failure message can be set at a global level, see Response Messages under:

https://docs.safe.com/fme/html/FME_Server_Documentation/Content/ReferenceManual/config_file_layout.htm?Highlight=response

Also check out MACRO_DEF in the same document. It states:

"When defined, macros are available for use in pre- and post-commands, and in success and failure response strings, using the pseudo-variable (!macroName!) syntax."

So if you set a macro, it should be output in the response string (or that is how I read it). I don't think you can set the macro after the event, so it would need to be set at runtime, not in response to an event that happened in the workspace.

Does that help? If not let me know and I can investigate some more.

Hi @Mark2AtSafe,

 

I want to write it from workbench itself as the variable will contain some values from workbench.

 

Badge

Hi,

If I understand it correctly you would like to receive a result from the workspace. I suspect that the workbench you are executing is run through a "jobsubmitter" or "datadownload" service. If you do run it through a "datastreaming" service instead and make sure it writes something parseable like Json or XML you could basically receive any kind of output from the workspace.

Yes, workbench is running through a "jobsubmitter" or "datadownload" service. In the response of that service i need a flag variable.

 

Based on that flag variable i will execute some other tasks.

 

 

 

Badge +22

Could you do something with notifications and Post Data from Writer?

Badge

Could you do something with notifications and Post Data from Writer?

Yes, I am looking for posting data from writer kind of solution.

 

 

Reply