Get Messages of GP Services in WebAppBuilder

3170
1
Jump to solution
06-17-2015 01:41 AM
PhilipGlasner1
New Contributor III

Hi colleagues,

I am recently facing the following problem:

is it possible to write messages to the output pane of the GP widget?

(arcpy.AddMessage() does not work, btw)

Any help is highly appreciated.

Philip

0 Kudos
1 Solution

Accepted Solutions
TomSellsted
MVP Regular Contributor

Philip,

Yes!  You must make sure that the geoprocessing service has the message level turned on to info so you will see all of the messages and not just errors and warnings.  I believe this is "none" by default.

I then made a simple modification to the geoprocessing widget.js onJobComplete section to display messages.  This was just to prove it was possible, but I am sure with a bit more effort, a new function could be added to display it the way you'd like.  Here is a snippet of the modification that I made to the onJobComplete function.

      //onJobComplete is invoked even if jobStatus is STATUS_FAILED.
      //It hides this.infoNode so user can not see the error message!
      //if(jobInfo.jobInfo.jobStatus !== JobInfo.STATUS_SUCCEEDED){
        this._createErrorMessages(jobInfo.jobInfo.messages);
        //return;
      //}

I just commented out the if statement so that all messages would be displayed. 

Regards,

Tom

View solution in original post

1 Reply
TomSellsted
MVP Regular Contributor

Philip,

Yes!  You must make sure that the geoprocessing service has the message level turned on to info so you will see all of the messages and not just errors and warnings.  I believe this is "none" by default.

I then made a simple modification to the geoprocessing widget.js onJobComplete section to display messages.  This was just to prove it was possible, but I am sure with a bit more effort, a new function could be added to display it the way you'd like.  Here is a snippet of the modification that I made to the onJobComplete function.

      //onJobComplete is invoked even if jobStatus is STATUS_FAILED.
      //It hides this.infoNode so user can not see the error message!
      //if(jobInfo.jobInfo.jobStatus !== JobInfo.STATUS_SUCCEEDED){
        this._createErrorMessages(jobInfo.jobInfo.messages);
        //return;
      //}

I just commented out the if statement so that all messages would be displayed. 

Regards,

Tom