cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Getting sub-items of documents, using MKSAPI

mhyang
9-Granite

Getting sub-items of documents, using MKSAPI

Greetings to whom it may concerns,

 

I want to get  sub-item lists of  several documents in the Integrity system, using MKS API.

For being not able to find suitable options, I tried this.

 

Command cmd = new Command(Command.IM, "issues");
cmd.addOption(new Option("queryDefinition", "(field[\"Document ID\" = 2])"));

Response response = null;
try {
response = cmdRunner.execute(cmd);
LOGGER.debug("reponse = " + response);
LOGGER.debug(response.getCommandString());
} catch (APIException e) {
LOGGER.error(e.getResponse());
}

 

 

And there are problems I'm aware of, with the command,

  • that it shows sub-items of every documents in the system, 
  • that it shows sub-items of one whose Document Id is 2, not lists from several document. 
  • (modified) that it just shows all items in the system. 

So, Here is my question,
Is there any other command or options appropriate to in this situation?


Any ideas or tips will be very helpful,
thank you for reading.

1 ACCEPTED SOLUTION

Accepted Solutions
awalsh
17-Peridot
(To:mhyang)

While you cannot run "im viewsegment" from the CLI, it is certified for the API. 

It is in the list of certified commands in the Integrations Builder Guide: Published API Commands > Published Commands > Workflow and Document Management Commands > im viewsegment.  I've linked to the 11.2 guide, but the command has been supported in the API for several releases now. 

 

 

 

View solution in original post

3 REPLIES 3
awalsh
17-Peridot
(To:mhyang)

The command you want is im viewsegment [document ID], which will give you the entire document.

For options, such as filtering, see the viewsegment man page in the CLI Reference: https://support.ptc.com/cs/help/integrity_hc/integrity112_hc/en/#page/IntegrityHelp%2Fim_viewsegment.html%23

 

mhyang
9-Granite
(To:mhyang)

Thank you for your reply.

However,using CLI and Java API.
the "viewsegment' command is available only in the GUI mode, as far as I know.
( C:\Users>im viewsegment 2
*** MKS124814: Cannot show view information: This view is only available in the
Graphical UI.)

Is there anyway to get all child Items of selected item(document) (not just 1 level, the whole level of child items) by java api?

 

* This Java API gets responses of all items in the system so it does not give me the lists of child items of a selected item(document=2).

Command cmd = new Command(Command.IM, "issues");
cmd.addOption(new Option("queryDefinition", "(field[\"Document ID\" = 2])"));

 

awalsh
17-Peridot
(To:mhyang)

While you cannot run "im viewsegment" from the CLI, it is certified for the API. 

It is in the list of certified commands in the Integrations Builder Guide: Published API Commands > Published Commands > Workflow and Document Management Commands > im viewsegment.  I've linked to the 11.2 guide, but the command has been supported in the API for several releases now. 

 

 

 

Top Tags