Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How can I get component created datetime?

I am writting project by java plain api. 

Now, I want to get created/updated datetime of a component. But I found that getCreatedDate/getUpdatedDatetime API is not existed in IComponent class.  So how can I get the created datetime/updatetime of a component?
I have ever ask this question, but no answer.
Please give an advice.

0 votes



One answer

Permanent link
A Component implements IComponent and IAuditable.
IAuditable provides modified() for the modification date. There is no creation date I could find.
IAuditable can have States (history) you can try to see if there is a state history with differnet modification times and take the first date if so.

1 vote

Comments

In my case, I want to remember the component created datetime and modified time. 

I'm write RTC extension project
. This project need to remember changed or created component name and other information into a custom table. So I want to  compare the updated datetime and created datetime of a component to make sure that the component is new or update. I can insert or update the component change into my custom table.

I want to check the component is update or created. 

According to the JavaDoc of IAuditable you can use the IAuditable.getPredecessorState() and IAuditable.getMergePredecessorState() State recursively, to find such information.

"IAuditable.getPredecessorState() Returns the primary predecessor state of this auditable item state. The predecessor state is another state of the same audtiable item. When ITeamRepository.allStates(IItemHandle, IAccessProfile) is used to retrieve all the known states of the item, the predecessor (and merge predecessor) states of each state can be used to construct the version graph.

A newly-created auditable item may or may not carry predecessor state information. Moreover, predecessor states are only retrieved when history is requested. Clients that want to see these must use allStates(itemHandle,HISTORY) in order to get meaningful values that they can depend on. The initial state of an item has no predecessor state."

Each state will have a modification date and the first modification date in the state hitory is the creation date.

1 vote

It seems need to do some source test.

I will try it.

Thks a lot.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,934

Question asked: Sep 25 '13, 9:30 a.m.

Question was seen: 4,907 times

Last updated: Oct 02 '13, 6:05 a.m.

Confirmation Cancel Confirm