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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

si rlog command from Java API doesn't enumerate all file members ?

amatei
12-Amethyst

si rlog command from Java API doesn't enumerate all file members ?

Hello,

I am using PTC Integrity client Build: 10.6.0.7337

I have a project say X containing 4 file members.

I am interested to see the revision history  for these 4  file members.

In CLI it works just fine

si rlog  --hostname=someHost --port=somePort --user=someUser --project=SomeProject/project.pj  --norecurse --format="{membername}, [{revision}],{author}\n"

I see the revision history for all 4 file members.

However using the  Java API I receive information only about 3 of the file members.

Similarly if I check a project with 3 file members, the Java API returns information about 2 file members

Similarly if I check a project with 1 file member, the Java API returns no information !

Therefore I assume there is a bug  in the  mksapi.jar and always information about one file member is skipped

           IntegrationPointFactory factory = IntegrationPointFactory.getInstance();
            IntegrationPoint integrationPoint = factory.createLocalIntegrationPoint(APIVersion.API_4_13);
            integrationPoint.setAutoStartIntegrityClient(true);
            String userNameX = "someUser";
            String passwordX = "somePassword";
            Session session = integrationPoint.createSession(userNameX, passwordX);

            CmdRunner cmdRunner = session.createCmdRunner();
           
            String hostX = "someHost";
            int portX = 101;
            cmdRunner.setDefaultHostname(hostX);
            cmdRunner.setDefaultPort(portX);
               
            
            HashMap<String, String> options  = new HashMap<>();

            String commandText = "rlog";
            options.put("project","SomeProject/project.pj");
            options.put("norecurse",null);
            options.put("batch",null);
            options.put("nofailOnAmbiguousProject",null);

            String cmd_args="{membername}, [{revision}], {author}\n" ;
            options.put("format",cmd_args);
           
            Command cmd = new Command(Command.SI, commandText);
           
            for (Map.Entry<String,String > entry : options.entrySet())
            {
                 if (null == entry.getValue())
                        cmd.addOption(new Option(entry.getKey()));
                else      
                    cmd.addOption(new Option(entry.getKey(),entry.getValue()));
            }
           
            Response response = cmdRunner.execute(cmd);
            WorkItemIterator selection = response.getWorkItems();
           
           
            while (selection.hasNext())
            {
                WorkItem workItem = selection.next();
                       
                txtArea.append(String.format("workItem: %s (%d)\r\n",workItem.getId(),workItem.getFieldListSize()));
            
            }
           
            cmdRunner.release();

1 ACCEPTED SOLUTION

Accepted Solutions
KaelLizak
14-Alexandrite
(To:amatei)

Hello Alexandru Matei‌,

This looks like CS92181/RFC 419881.  Please contact PTC Integrity Lifecycle Management Support to open a case to log your organization against this issue.

Regards,
Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager

View solution in original post

2 REPLIES 2
KaelLizak
14-Alexandrite
(To:amatei)

Hello Alexandru Matei‌,

This looks like CS92181/RFC 419881.  Please contact PTC Integrity Lifecycle Management Support to open a case to log your organization against this issue.

Regards,
Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
amatei
12-Amethyst
(To:KaelLizak)

All right, thank you. I will try to ask someone qualified(allowed) to do this, from my company to contact PTC Support.

Top Tags