× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Edmund,

Thank you very much for your help and thank you very much to the debug developer. The information you provided did indeed help a lot to create the menu item action.

Now I can successfully open the iSphere "Job Log Explorer" view from the "Job" node of the call stack, when the debugger stops at a SEP.

I am just a little converned about that package "com.ibm.debug.pdt.internal.*" is not exported. So hopefully its classes will not be changed for the next years.

I also hope that I can rely on the following statements for retrieving the qualified job name:

private static final String PATTERN = "\\S*\\s+((\\d{6})/(.{1,10})/(.{1,10}))\\s+.*";

protected String getQualifiedJobName(IProcess process) {

Pattern pattern = Pattern.compile(PATTERN);
Matcher matcher = pattern.matcher(process.getAttribute(null));
if (matcher.find()) {
return matcher.group(1);
}

return null;
}

Now I am going to add an action for opening the iSphere "Work With Spooled Files" view to show the spooled files of the job.

Both items are on my wish list for a long time.

Best Regards,

Thomas.

Am 05.10.2020 um 17:20 schrieb Edmund Reinhardt:
Hello Thomas,
It looks like you are innovation and creating lots of new goodies which is
always welcome!
Here feedback from the debug developer on your questions
1)  The package com.ibm.debug.pdt.internal.core.model is actually exported
from the com.ibm.debug.pdt.core plugin. The user said it is not exported
probably because he did not add the plugin "com.ibm.debug.pdt.core" to
the Require-Bundle list in the MANIFEST.MF file of his own plugin. Please
add him to add com.ibm.debug.pdt.core as a Require-Bundle and try again.
2)  The user can use the base class PDTDebugTarget to access most of the
methods for PDT debug target. The connection label is a field of this
class. PDTDebugTarget is under the
package com.ibm.debug.pdt.internal.core, which is also exported from
plugin com.ibm.debug.pdt.core

I hope this helps you get the connections name and create your menu item
action.
______________________________________________________________________________________

Edmund Reinhardt
905-413-3125
IBM Canada Ltd Rational Developer for i Access Client Solutions
Architect
[1]https://www.linkedin.com/in/edmundreinhardt/ [2]http://ibm.biz/rdi_hub [3]http://ibm.biz/IBMi_ACS


----- Original message -----
From: Tools/400 <thomas.raddatz@xxxxxxxxxxx>
Sent by: "WDSCI-L" <wdsci-l-bounces@xxxxxxxxxxxxxxxxxx>
To: wdsci-l@xxxxxxxxxxxxxxxxxx
Cc:
Subject: [EXTERNAL] [WDSCI-L] How to get connection name from
DebuggeeProcess?
Date: Sun, Oct 4, 2020 10:06 AM
Hi (IBM),

I already managed adding a menu entry to the popup menu of the "Debug"
view in order to start the "iSphere Job Log Explorer", when the debugger
stops at a service entry point:

   targetID="org.eclipse.debug.ui.DebugView"
   id="org.eclipse.debug.ui.debugview.popupMenu">

I also could retrieve the qualified job number from the IProcess
selected object (Last entry in den Debug view, e.g. "Process:
403007/QUSER/QZRCSRVS Program SPLF").

Hence I now have 1 out of 2 parameters that I need to open the Job Log
Explorer. The missing parameter is the connection name.

I can see, that IProcess is a DebuggeeProcess and that DebuggeeProcess
has an "fTarget" attribute. fTarget is a PICLDebugTarget class and has
an "fConnectionLabel" attribute. So that is close to the connection name
that I need.

Sadly I am stuck here. The problems I could not yet solve are:

a) com.ibm.debug.pdt.internal.core.model.DebuggeeProcess is not exported
and hence cannot be imported to the iSphere project.

b) The same thing applies to com.ibm.debug.internal.pdt.PICLDebugTarget

c) Retrieving the connection name.

So the question is, how can I get the connection name at this point
(???):

public class OpenJobLogDebugPopupAction implements IViewActionDelegate {

     private static final String PATTERN =
"\\S*\\s+((\\d{6})/(.{1,10})/(.{1,10}))\\s+.*";

     private Object shell;
     private IStructuredSelection structuredSelection;

     public void run(IAction arg0) {
         Object selectedObject = structuredSelection.getFirstElement();
         if (selectedObject instanceof IDebugElement) {
             IDebugElement debugElement = (IDebugElement)selectedObject;
             if (selectedObject instanceof IProcess) {
                 IProcess process = (IProcess)debugElement;
                 String connectionName = ???;
                 String qualifiedJobName = getQualifiedJobName(process);
                 if (!StringHelper.isNullOrEmpty(qualifiedJobName)) {
                     LoadRemoteJobLogJob job = new
LoadRemoteJobLogJob("iSphere", qualifiedJobName);
                     job.run();
                 }
             }
         }
     }

(The example above uses hard coded connection "iSphere".)

Regards,

Thomas.

--
This is the Rational Developer for IBM i   (WDSCI-L) mailing list
To post a message email: WDSCI-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: [4]https://lists.midrange.com/mailman/listinfo/wdsci-l
or email: WDSCI-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at [5]https://archive.midrange.com/wdsci-l ;.

Help support midrange.com by shopping at amazon.com with our affiliate
link: [6]https://amazon.midrange.com


References

Visible links
1. https://www.linkedin.com/in/edmundreinhardt/
2. http://ibm.biz/rdi_hub
3. http://ibm.biz/IBMi_ACS
4. https://lists.midrange.com/mailman/listinfo/wdsci-l
5. https://archive.midrange.com/wdsci-l
6. https://amazon.midrange.com/



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.