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

perl module for RTC/RQM/RRC?

Has anyone tried to put together a perl module(s) for programmatic interaction with Jazz/RTC?

0 votes

Comments

Hey everyone:  check out the Lyo perl that we're working on:

https://git.eclipse.org/c/lyo/org.eclipse.lyo.client.git/tree/org.eclipse.lyo.client.perl

THis is the master URL:
http://www.eclipse.org/lyo/

If anyone is watching this thread, how does this look to you?

use CLM2;

my $clm = new CLM2("machine", "port", "user", "password");

my $cmpa = $clm->getCMProjectArea('Demo Lifecycle Project(Change Management)');

   query() returns a list of ID, content pairs:


   (id1, taskForID1, id2, taskForID2, id3, taskForID3, ...)



my @idPairs = $cmpa->query( { ownedBy => 'd15921s' } );

for my $id (@idPairs) {
    my $tsk = shift @idPairs;

    #  Get and bump due dates:
    my $dd = $tsk->getDueDatetime();  # "2013-01-26T02:01:48.667Z"

    my $dd2 = myDateUtil.addBizDays($dd, 14);  # not part of CLM; no need

    $tsk->setDueDatetime($dd2);

    $rc = $cmpa->update($id, $tsk);
}
Looks interesting?   Join the Lyo development effort!


looks interesting.. not sure I understand the comment

   query() returns a list of ID, content pairs:


   (id1, taskForID1, id2, taskForID2, id3, taskForID3, ...)



it should just return a collection of content objects.. one element of the object is the id.

so $tsk->id should be = 1 or 43565 or whatever the workitem id is.
$tsk->type = workitem type..

you will have to be careful to avoid workitem attribute name collisions.
type above might be a custom attribute name, so $tsk->workitem_type might be a better content attribute element name for that field

I am experimenting with keeping content and keys separate so that real value semantics can be applied to tasks, reqs, etc., and also to keep behaviors and functions symmetric.   Here's how a task is created:
my $cmpa = $clm->getCMProjectArea('Demo Lifecycle Project(Change Management)');
my $tsk = $cmpa->vendTask();
$tsk->setTitle("I am The Title");
Now at this point, the task has not been created.   There is no ID.  But then...
my $id = $cmpa->create($tsk);
The $id is an object associated with task.   It is relevant in the DB domain; the task does not have to be and can have relevance solely in the code domain.   We're following const arg conventions here so $tsk is not modified in the create() operation.  So the fetchOne method is "easy" because it takes an id and returns the task object associated with it.   But query() can return more than one AND the query params might not have ID.   So it is forced to return id-task pairs.

sorry, don't understand your terminology 'task'.. in RTC everything is a workitem.

there IS a task workitem, but I don't think that is what you are referencing..

Yep, it's all workitems.   Some are tasks, some are defects, etc.  The subtle thing is that a workitem can exist as an object before it is actually inserted/created.   Thus, we have to keep a WorkItem object separate from the key that can fetch it from a persistor.

Hoping this starts to get people engaged in the Lyo perl effort.

so, isn't that just a state of the workitem? (saved) committed or not..

save as internal.. create an object, populate the fields (not ID as its not relevant prior to save) Save.  If save fails, then ID is updated as is created date/by, etc..

so again, I don't understand word task, and ID is irrelevant.. object state matters, new, saved, dirty, not dirty.

showing 5 of 7 show 2 more comments


2 answers

Permanent link
The vagaries of forms vs. basic auth , the blur of XML namespaces, and non-symmetry of ccm, qm, and rm services are driving me to this sort of thing.


use CLM;

$clm = new CLM("https://rtc.jpmchase.net:9443");

$clm->auth("name", "password");

$clm->setDefaultOutputFormat("json");

$workItem = $clm->getWorkItem("3651");

print Dumper($workItem);

$workItem->set("owner", $newOwnerCode):

$clm->updateWorkItem($workItem);

0 votes


Permanent link
sounds interesting, but the native api is only available in Java.

you can wrapper REST access, but much of the function is not available thru REST.

0 votes

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,937

Question asked: May 31 '12, 8:14 a.m.

Question was seen: 6,252 times

Last updated: Jan 27 '13, 8:09 p.m.

Confirmation Cancel Confirm