Accessing Parent CR data

132 views
Skip to first unread message

andre...@baesystems.com

unread,
Mar 19, 2012, 8:00:16 PM3/19/12
to Synergy CM Tool
Hi All,

In our Rational Change system, we have 2 lifecycles. One for parents
CRs, and then another lifecycle for children CRs. We have a
CCM_RELATION attribute called "associated_child" and that represents
the relationship between the parent and its children. I have created a
"COPY" transition of the submit transition, such that you can click a
button titled "Submit Child" from the parent CR page and it will spawn
a new page where you can create a child. After creating the child, a
parent-child relationship is established. So if you look at the parent
CR you will now see this child CR listed.

My problem is, is that I want to send out an email saying something
like "CR XYZ has been raised as a child CR for parent CR ABC". The
problem is, I'm not sure how to retrieve details of the parent CR.

I'm trying to use post-transition trigger scripts. If I interrogate
the "trigger", this only returns details of the child CR. I've also
tried using a query that lists all parent-child relationships, but
that doesn't work either. I'm trying to use "$data->getDataObject-
>getChildData()", but getChildData() returns null. I assume it's
because the perl script I'm trying to run, is run before the actual
child CR has been created. So the parent-child relation has not yet
been established.

Any ideas?

Thanks!
Andrew.

mjmer...@mmm.com

unread,
Mar 20, 2012, 11:29:03 AM3/20/12
to synergy...@googlegroups.com
Hi Andrew,

There are some internal routines that you can call to get the information. I do not remember which ones it is, but we use the DOORS/Change lifecycle with SCRs and IRs
where the SCR is the parent and the IR is the child. The attribute we use is associated_ir

So this query shows us the children without an associated parent.
((cvtype='problem') and ((crstatus='ir_resolved') or (crstatus='ir_concluded')or (crstatus='ir_assigned'))and ((is_no_associated_ir())))

The is_no_associated_ir() is the routine. The other way from the parent is has_no_associated_ir()
So if you want one with a child or parent you have to put a not in front
and not(is_no_associated_ir())
and not(has_no_associated_ir())

Then you should be able to look at the associated_child attribute with has_no_associated_child() and is_no_associated_child()

There are some out of the box triggers, that I think may help you.
transitionParent.pl  It shows how to get the parent ID when you have the child. (if you don't have these triggers, you may want to download the DOORS/Change integration package.

-Mark



Mark J. Meredith | Software Engineer
3M Health Information Systems
575 W. Murray Blvd | Murray, UT 84123
Office: 801 265 4944 | Triminet: 273 4944

mjmer...@mmm.com | www.3M.com
" A boat in the harbor is safe
but that is not what boats are for"
John A. Shed

--
You received this message because you are subscribed to the Google Groups "Synergy CM Tool" group.
To post to this group, send email to synergy...@googlegroups.com.
To unsubscribe from this group, send email to synergy-cm-to...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/synergy-cm-tool?hl=en.


Ruediger...@jci.com

unread,
Mar 20, 2012, 11:48:00 AM3/20/12
to synergy...@googlegroups.com, Synergy CM Tool

One thing I stumbled over in the past for this kind of relationship is the timing .. as far as I understand the behavior of Change the parent <> child relationship is created AFTER you submitted the child CR (i.e. moved out of the START_HERE state). Once you are in the next state you can query for the CR attributes on either end of the relationship.  I have been using BSF triggers with the 'getRelatedFrom' (parent > child) and 'getRelatedTo' (child > parent) methods of the ChangeTriggerApi class (part of telelogic.cs.api object).

-Rudi.

Robert Kirchner

unread,
Mar 20, 2012, 1:15:36 PM3/20/12
to synergy...@googlegroups.com
Hi Andrew,

the relation is indeed only created after the transition - including synchronous triggers - has completed. Keep in mind that "START_HERE" is not a real state, just some placeholder that allows Rational Change to handle creation of CRs similar to transitions between real states. A new child CR first has to reach a "real" state internally before relations to or from it can be created. So a transition trigger can't help here. 

How about using a relation trigger on your "associated_child" relation? You can define it in the "Attributes" tab of the lifecycle editor in the properties of your relation.  It gets the id of the parent CR and the child CR as parameters and if needed you can use the API to query additional attributes. 

Of course this trigger will then fire not only when a new child CR is created, but also when a "associated_child" relation to an existing CR is established (if your process allows this). If you want to avoid sending an email in this case, you could e.g. check the create_time of the child CR in your trigger and send the mail only if it more or less matches the current time (i.e. the CR was created just now and not already some minutes / hours / days ago). 

Cheers,
  Robert
 

2012/3/20 <Ruediger...@jci.com>

One thing I stumbled over in the past for this kind of relationship is the timing .. as far as I understand the behavior of Change the parent <> child relationship is created AFTER you submitted the child CR (i.e. moved out of the START_HERE state). Once you are in the next state you can query for the CR attributes on either end of the relationship.  I have been using BSF triggers with the 'getRelatedFrom' (parent > child) and 'getRelatedTo' (child > parent) methods of the ChangeTriggerApi class (part of telelogic.cs.api object).

-Rudi.

--
You received this message because you are subscribed to the Google Groups "Synergy CM Tool" group.
To post to this group, send email to synergy...@googlegroups.com.
To unsubscribe from this group, send email to synergy-cm-to...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/synergy-cm-tool?hl=en.


___________________________________
robert kirchner
senior it consultant

mailto: kirc...@argumentum.de
mobile +49 170 55 190 66

argumentum GmbH ..[!].
www.argumentum.de
mailto:in...@argumentum.de
anwanderstrasse 3a . 85635 hoehenkirchen
tel +49 8102 99986-9 . fax +49 8102 99986-7

Firma: argumentum GmbH
Firmensitz: Anwanderstr. 3a, 85635 Höhenkirchen
Registergericht: Amtsgericht München, HRB 125856
Geschäftsführer: Bernd Volkmer

TING, Andrew

unread,
Mar 21, 2012, 12:26:15 AM3/21/12
to synergy...@googlegroups.com

Hi Robert,

 

How do I retrieve the parent CR and child CR from the “associated_child” relation? Do I just set a pre/post-condition trigger script?

 

I’ve set a post-condition trigger script to run for the “associated_child” attribute. In the script, I tried to use bsf.lookupBean(‘changeTriggerApi’) to return the API, but it returns null.

 

Any ideas?

 

Thanks,

Andrew.

"Warning:
The information contained in this email and any attached files is
confidential to BAE Systems Australia. If you are not the intended
recipient, any use, disclosure or copying of this email or any
attachments is expressly prohibited.  If you have received this email
in error, please notify us immediately. VIRUS: Every care has been
taken to ensure this email and its attachments are virus free,
however, any loss or damage incurred in using this email is not the
sender's responsibility.  It is your responsibility to ensure virus
checks are completed before installing any data sent in this email to
your computer."

Matthias.Sc...@materna.de

unread,
Mar 21, 2012, 3:07:04 AM3/21/12
to synergy...@googlegroups.com
Hello Andrew,

Roberts idea is to not fire the trigger as a pre or post condition on transitions but as an attribute trigger so that it rans each time someone modifies the mentioned attribute (and relations are also defined as attributes in the Attribute tab of the process definition pane in the lifecycle editor).

In this case the data will be availble using the trigger object which is available to each fired trigger (I still haven't checked that detail but I think this is what Robert mentioned).

Regards,
Matthias

i. A.
Matthias Schwellenberg
Mitarbeiter Business Division Applications
________________________________________________

MATERNA GmbH
Information & Communications

Voßkuhle 37
44141 Dortmund
Germany

Telefon: +49 231 5599-8244
Mobil: +49 1570 112-8244
Fax: +49 231 5599-98244
E-Mail: Matthias.Sc...@materna.de

www.materna.de
_________________________________________________

Hauptsitz der MATERNA GmbH: Voßkuhle 37, 44141 Dortmund
Geschäftsführer: Dr. Winfried Materna, Helmut an de Meulen, Ralph Hartwig
Amtsgericht Dortmund HRB 5839


________________________________

Hi Robert,

Any ideas?

Thanks,

Andrew.

Hi Andrew,

Cheers,

Robert

2012/3/20 <Ruediger...@jci.com>

To unsubscribe from this group, send email to synergy-cm-to...@googlegroups.com <mailto:synergy-cm-tool%2Bunsu...@googlegroups.com> .


For more options, visit this group at http://groups.google.com/group/synergy-cm-tool?hl=en.



___________________________________

robert kirchner
senior it consultant

mailto: kirc...@argumentum.de

mobile +49 170 55 190 66 <tel:%2B49%20170%2055%20190%2066>


argumentum GmbH ..[!].
www.argumentum.de
mailto:in...@argumentum.de
anwanderstrasse 3a . 85635 hoehenkirchen

tel +49 8102 99986-9 <tel:%2B49%208102%2099986-9> . fax +49 8102 99986-7 <tel:%2B49%208102%2099986-7>


Firma: argumentum GmbH
Firmensitz: Anwanderstr. 3a, 85635 Höhenkirchen
Registergericht: Amtsgericht München, HRB 125856
Geschäftsführer: Bernd Volkmer

--
You received this message because you are subscribed to the Google Groups "Synergy CM Tool" group.
To post to this group, send email to synergy...@googlegroups.com.
To unsubscribe from this group, send email to synergy-cm-to...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/synergy-cm-tool?hl=en.

"Warning:
The information contained in this email and any attached files is
confidential to BAE Systems Australia. If you are not the intended
recipient, any use, disclosure or copying of this email or any
attachments is expressly prohibited. If you have received this email
in error, please notify us immediately. VIRUS: Every care has been
taken to ensure this email and its attachments are virus free,
however, any loss or damage incurred in using this email is not the
sender's responsibility. It is your responsibility to ensure virus
checks are completed before installing any data sent in this email to
your computer."

--

Robert Kirchner

unread,
Mar 21, 2012, 8:44:40 AM3/21/12
to synergy...@googlegroups.com
Hi Andrew,

yes, you define a post-condition trigger script and set it to fire on "create action only". 

Please use just "api" in your lookupBean() call, not "changeTriggerApi"! Then you'll get a ChangeTriggerApi object through the predefined bean "api". 

I've attached a very small BSF JavaScript trigger script, which shows you how to get the parent and child CR id of a relation trigger. If needed, you can then use the API method getAttributes() to fetch additional CR attributes. 

Cheers,
  Robert


P.S.: If you want to try this out on your server, then please remove the ".txt" from the file extension. Some mail systems don't like attached .js JavaScript files...


2012/3/21 TING, Andrew <andre...@baesystems.com>
newChildEmail.js.txt
Reply all
Reply to author
Forward
0 new messages