Post

1 follower Follow
0
Avatar

Nested loops

I would like to list all use cases, and all actors referenced by  each use case, each on a separate line. How do I do this?

 

Example: I have UseCaseA, with Actor1 and Actor 2, and UseCase B, with Actor2 and Actor3. I need a list that looks like this:

UseCaseA ... Actor1

UseCaseA ... Actor2

UseCaseB ... Actor2

UseCaseB ... Actor3

 

I tried something like this:

$repeatUseCases

$repeatReferencedActors

$Name1 $Name

$endrepeatReferencedActors

$endrepeatUseCases

... but it doesn't work. Btw, this is an Excel report

Bernd Waldmann Answered

Please sign in to leave a comment.

3 comments

0
Avatar

Bernd,

You've come really close, and just missed it by a tiny bit with your $Name1 and $Name keywords. Each keyword needs to be used in its proper context, and by putting $Name1 and $Name inside the $repeatReferencedActors section, the reporting engine is attempting to apply both of those to your actors.

Instead, try this:

$repeatUseCases

$Name

$repeatReferencedActors

$Name

$endrepeatReferencedActors

$endrepeatUseCases

This way, you've got a $Name keyword at each matching level - use cases and actors - and the reporting engine will give you a name on each of those elements.

It gets a little trickier (but can still be done) when trying to match this information up on the same line in an Excel template. Take a look at the attached sample and let me know if this is more like what you're looking for.

Jason

Permanently deleted user 0 votes
Comment actions Permalink
0
Avatar

Hi Jason,

thanks for the reply. What I need to have is both the actor name and the use case name on the same line, so how do I make CC print both?

In your example, I get

  UseCaseA

    Actor1

    Actor2

  UseCaseB

    Actor2

    Actor3

What I need is

  UseCaseA ... Actor1

  UseCaseA ... Actor2

  UseCaseB ... Actor2

  UseCaseB ... Actor3

see the difference?

 

Bernd

Bernd Waldmann 0 votes
Comment actions Permalink
0
Avatar

Hi Bernd,

I *believe* the template that Jason attached in his reply should do the trick. I took a look at it and it's pretty simple, just three lines:

 

$repeatUseCases 

$Name $listReferencedActors

$endrepeatUseCases

 

Which produced a result like this (Loan Processing Sample Project):

 

Submit Loan Application  Applicant

Submit Loan Application  Credit Bureau

Evaluate Loan Application Loan Officer

Evaluate Loan Application Applicant

Create Loan Account  Loan Administrator

Create Loan Account  Customer

Setup Automatic Payments Customer

View Account Status  Customer

 

Jeff

Jeff Marver 0 votes
Comment actions Permalink