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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Any Service that could return the total number of records in Value Stream?

ahawaldar
1-Newbie

Any Service that could return the total number of records in Value Stream?

Hi,

I have a value stream. I want to know the total number of records in a value stream at any given point of time. Is there any service which will help me with this?

Thanks,

Azim

5 REPLIES 5
ankigupta
5-Regular Member
(To:ahawaldar)

Hi azim hawaldar​,

I think we can simply read the ValueStream in an infotable and use <InfoTableName>.getRowCount(); service to get the count.

I hope it helps.

Hi Ankit Gupta​,

The java extension code which I have return to know the total number of rows is as below. Here WheelThing is a thing which has a valueStream associated with it. First I am getting the thing "WheelThing", on that Thing I am executing the service QueryPropertyHistory with default parameters as null.  But this is not giving me total number of rows.

Thing wheeThing = (Thing) EntityUtilities.findEntity("WheelThing", ThingworxRelationshipTypes.Thing);

InfoTable infoTable = wheeThing.QueryPropertyHistory(null, null, null, true, null);

int length =  infoTable.getLength();

Thanks,

Azim

Hi Azim,

If you are asking for the total number of rows in a ValueStream, not specifying the Thing/Property, there is no way. If you want to know the total number of row in a ValuesStream on a given Thing/Property you have to query for all the entries on the given property history and get rows.length, but of course if you have a lot of rows this will be slow.


Best Regards,

Carles.

Hello Carles Coll​,

Valuestream has been associated with a thing "WheelThing" in my example.  I am using the code as below. But it always returns me some constant number which is 512.

Thing wheeThing = (Thing) EntityUtilities.findEntity("WheelThing", ThingworxRelationshipTypes.Thing);

InfoTable infoTable = wheeThing.QueryPropertyHistory(null, null, null, true, null);

int length =  infoTable.getLength();

Thanks,

Azim

Hi Axim,

I'm not used with Java extensions, but on of the "null,null,null,true,null" parameters should be maxItems, if you set it to null it you will get only 500 registers, you should set it to a big number.

Carles.

Top Tags