ALERT! The community will be read-only starting on April 19, 8am Pacific as the migration begins. Read more for important details.
ALERT! The community will be read-only starting on April 19, 8am Pacific as the migration begins.Read more for important details.
Absent Member.
Absent Member.
2691 views

Get Change Request from Audit

Jump to solution

My project need to trace all team member fixed change requests in one day. Because our starteam server does not enable MPX function,

so I want to use audit to locate which Change Request is modified.

My question is how i use below  String to get ChangeRequest object.

Item 1 Workspace Changes on 2014-04-08@07-23-47Z

The API not document how to use below method to get ChangeRequest.

java.lang.String getInfo1Property()
returns auxiliary information for the first "operand" object (if any)
java.lang.String getInfo2Property()
returns auxiliary information for the second "operand" object (if any)
java.lang.String getInfo3Property()
returns auxiliary information for the third "operand" object (if any)
java.lang.String getItemClass1Name()
Returns the name of the audited item's type.
java.lang.String getItemClass2Name()
Returns the name of the second "operand" item's type (if any).
java.lang.String getItemClass3Name()
Returns the name of the third "operand" item's type (if any).
java.lang.String getItemDescriptor1()
Returns the primary descriptor for the underlying audited object.
java.lang.String getItemDescriptor2()
Returns the primary descriptor for the second "operand" object (if any).
java.lang.String getItemDescriptor3()
Returns the primary descriptor for the third "operand" object (if any).
Tags (2)
0 Likes
2 Solutions

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

>>our starteam server does not enable MPX function

why not? mpx is available with all starteam licensing.

the use of mpx in your organization would significantly reduce client server traffic on your network,

as well as reduced load on your StarTeam server.

>>so I want to use audit to locate which Change Request is modified.

The server generates audits for each artifact type and instance that is created/changed/deleted during any given session.

Look for Audits whose getItemClass1Name() returns "Change Request" and getEventID() returns Audit.EventID.MODIFIED. For these audits, the value of getInfo1Property() is a String, whose numeric value represents the numeric value of an equivalent ChangeNumber Property on a ChangeRequest in that view.

In other words,

ChangeRequest cr = view.getViewMembers(server.getTypes().CHANGE_REQUEST).find(audit.getInfo1Property()) will return the ChangeRequest represented by that Audit.

An alternative approach would be to 'poll' the view every 1/2 an hour (or some preconfigured time interval),

refresh the ChangeRequest collection, sort by last modified time, and pick all CRs that have been modified since your last poll. e.g. pseudocode below

ViewMemberCollection crs = view.getViewMembers(server.getTypes().CHANGE_REQUEST);

crs.getCache().refresh();

crs.sort(DateTimeSortable); // implement & provide your date time sorter

ChangeRequest[] cc = crs.toArray();

for each (ChangeRequest cr in cc) {

 if (cr.getModifiedTime() > lastTimeIChecked && cc.getStatus().equalsa(ChangeRequest.Status.CLOSED))

 do something...

}

After all, in the absence of MPX, you're going to need to poll something - either the audits or the ChangeRequests collections...

View solution in original post

0 Likes
Micro Focus Expert
Micro Focus Expert

>> If I submit a  new change request, what kind of  audit will be generated?

Apparently, both. I think CREATED implies the artifact is created in the server, ADDED implies the artifact is added to a folder/view.

>> Is there any method to get modified time file from audit?

No. You should always look at the file (any starteam artifact)  for it's modified time property.

View solution in original post

0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

>>our starteam server does not enable MPX function

why not? mpx is available with all starteam licensing.

the use of mpx in your organization would significantly reduce client server traffic on your network,

as well as reduced load on your StarTeam server.

>>so I want to use audit to locate which Change Request is modified.

The server generates audits for each artifact type and instance that is created/changed/deleted during any given session.

Look for Audits whose getItemClass1Name() returns "Change Request" and getEventID() returns Audit.EventID.MODIFIED. For these audits, the value of getInfo1Property() is a String, whose numeric value represents the numeric value of an equivalent ChangeNumber Property on a ChangeRequest in that view.

In other words,

ChangeRequest cr = view.getViewMembers(server.getTypes().CHANGE_REQUEST).find(audit.getInfo1Property()) will return the ChangeRequest represented by that Audit.

An alternative approach would be to 'poll' the view every 1/2 an hour (or some preconfigured time interval),

refresh the ChangeRequest collection, sort by last modified time, and pick all CRs that have been modified since your last poll. e.g. pseudocode below

ViewMemberCollection crs = view.getViewMembers(server.getTypes().CHANGE_REQUEST);

crs.getCache().refresh();

crs.sort(DateTimeSortable); // implement & provide your date time sorter

ChangeRequest[] cc = crs.toArray();

for each (ChangeRequest cr in cc) {

 if (cr.getModifiedTime() > lastTimeIChecked && cc.getStatus().equalsa(ChangeRequest.Status.CLOSED))

 do something...

}

After all, in the absence of MPX, you're going to need to poll something - either the audits or the ChangeRequests collections...

View solution in original post

0 Likes
Absent Member.
Absent Member.

Thanks for your answer.

Besides, I have two questions:

1. What are difference between  Audit.EventID.ADDED and  Audit.EventID.CREATED? If I submit a  new change request, what kind of  audit will be generated?

2. If user modify a file on starteam, the modified times of file and audit are different. Is there any method to get modified time file from audit?

0 Likes
Micro Focus Expert
Micro Focus Expert

>> If I submit a  new change request, what kind of  audit will be generated?

Apparently, both. I think CREATED implies the artifact is created in the server, ADDED implies the artifact is added to a folder/view.

>> Is there any method to get modified time file from audit?

No. You should always look at the file (any starteam artifact)  for it's modified time property.

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.