ibm change perl csapi: how to get value of depending attrs of a listbox

51 views
Skip to first unread message

gserri

unread,
Jan 7, 2019, 9:04:11 AM1/7/19
to Synergy CM Tool
Hello everyone,
I'm an IBM Rational Change Admin in my company, please could someone help me?

I'm trying to develop a trigger, fired in the submission transition [START2entered], that should stop all the insertions performed by cli (using perl api) that don't have the right values in the listboxes.

In particular I don't know how to check if the values of depending attributes are right, I try to explain better with an example.

In my CR_Process there are the attribute [severity] that depends on [request_type] in this way:
request_type = [Defect]        ->   severity = [Any|Fatal|Severe|Medium|Warning|Maskable]
request_type = [Enhancement]   ->   severity = [Any|High|Medium|None]

Using the method "GetListBox" I can obtain the label/value of the two attributes, in this way:

#----------------------------------------------------------------
my $list = $csapi->GetListBox($aUser, "request_type");
for(my $i=0; $i < $list->getListboxSize(); $i++) {
   
my $label = $list->getLabel($i);
   
my $value = $list->getValue($i);
   
   
print "Listbox label|value: [$i] - [$label]|[$value]\n";
}
#Output:
Listbox label|value: [0] - [Any]|[0]
Listbox label|value: [1] - [Defect]|[1]
Listbox label|value: [2] - [Enhancement]|[2]
#----------------------------------------------------------------
#----------------------------------------------------------------
my $list = $csapi->GetListBox($aUser, "severity");
for(my $i=0; $i < $list->getListboxSize(); $i++) {
   
my $label = $list->getLabel($i);
   
my $value = $list->getValue($i);
   
   
print "Listbox label|value: [$i] - [$label]|[$value]\n";
}
#Output:
Listbox label|value: [0] - [Any]|[0]
Listbox label|value: [1] - [Fatal]|[1]
Listbox label|value: [2] - [Severe]|[2]
Listbox label|value: [3] - [Medium]|[3]
Listbox label|value: [4] - [Warning]|[4]
Listbox label|value: [5] - [Maskable]|[5]
Listbox label|value: [6] - [High]|[6]
Listbox label|value: [7] - [None]|[7]
#----------------------------------------------------------------


How can I have the values of [severity] related to [request_type=Defect]?
How can I have the values of [severity] related to [request_type=Enhancement]?
There is a method to get that data?

In the file [pt_listbox.cfg] this data there is, but it is very complicated to extract.

Thanks you in advance for your support, and I want wish to all an happy year 2019.

Regards,
Giuseppe

Sheehan, Richard (US)

unread,
Jan 7, 2019, 9:36:06 AM1/7/19
to synergy...@googlegroups.com

Giuseppe,

 

Have you thought about attacking the problem differently?  (or maybe I’m not following your problem).  Anyway, I set up my listboxes using dependencies.  I then use a jython script where the script fills in the lower level values dependent on the what the upper level is set to.  This prevents illegal entries from popping in.

 

Rich

 

Richard F. Sheehan
Systems Admin Sr Prin

Enterprise Shared Services
BAE Systems, Inc.

T: 607.770.2897 M: 607.953.9424  |  E: richard....@baesystems.com
1098 Clark Street, Endicott, NY, 13760, USA – Bldg. 46-2 D47
www.baesystems.com

Connect with BAE Systems: cid:image001.png@01D15E58.0089D120cid:image002.png@01D15E58.0089D120cid:image003.png@01D15E58.0089D120cid:image004.png@01D15E58.0089D120

 

 

From: synergy...@googlegroups.com <synergy...@googlegroups.com> On Behalf Of gserri
Sent: Monday, January 07, 2019 9:04 AM
To: Synergy CM Tool <synergy...@googlegroups.com>
Subject: ibm change perl csapi: how to get value of depending attrs of a listbox

 

*** WARNING ***
EXTERNAL EMAIL -- This message originates from outside our organization.

 

--
You received this message because you are subscribed to the Google Groups "Synergy CM Tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to synergy-cm-to...@googlegroups.com.
To post to this group, send email to synergy...@googlegroups.com.
Visit this group at https://groups.google.com/group/synergy-cm-tool.
For more options, visit https://groups.google.com/d/optout.

gserri

unread,
Jan 8, 2019, 5:47:18 AM1/8/19
to Synergy CM Tool
Hi Richard ,
thank you very much for your answer and time spent to help me.

Excuse me, but I inform to you that I have some doubts because I don't know very well how to use/run or test the "jython script".
For me it is all new, because in my job experience in ChangeAdmin, I have used (and I use) only perl trigger or some default trigger.js that are called in "bsf" with standard args, but I don't have never developed some "jython script" (even if I know javascript a little bit).

There is some docs or examples to see how to use them? How to get listbox value and the dependencies?
I don't know, I would like to develop a sort of "check.js" (fired in START2entered in pre-transition with verify bsf check.js) that can verify if all related attributes values are right.

Thanks you again in advance for your support and for your time, kindly,
Giuseppe

Rahuldeb Chakrabarty

unread,
Nov 14, 2020, 3:31:39 PM11/14/20
to synergy...@googlegroups.com
Hello Giuseppe,

Have you found the solution?
Thanks a lot for your time and support.

Regards,

Rahuldeb Chakrabarty




--
Reply all
Reply to author
Forward
0 new messages