Convert Requirements to UML UseCases

We’ve received this following request from one of our customers.
“I have made Requirement diagrams and now I want to convert them into UML UseCase Diagrams. And in my diagram, each Requirement has an unique ID. So when I convert those Requirements into UseCases, I want converted UseCases to have the ID that original Requirement had.”

This feature isn’t in Astah Professional yet, so we made it possible by using Script Plug-in. This is how we made it happen. We wrote a script using Astah API to convert the existing Requirement diagrams into UML UseCase diagram as below and let it run in Astah. And also it performed to let:
– Requirements to be converted into UML UseCase models
– UseCase have the same ID that original Requirement has as UseCase’s stereotype and also its UseCase’s definition field

Requirement Diagram UML UseCase

Our customer had a concern that letting UseCase has its ID as stereotype will not comply with UML’s specification. But sticking to the standard is not necessary all the time. Every team has their own way to model that works the best for themselves. So we want our software to be flexible as possible and have the potential in its customizability.

If you want to try this feature, here’s the description.

What this program does:
This converts Requirements in existing Requirement Diagrams into UseCases in UML UseCase diagrams and original Requirements ID will appear:
(1) as stereotype in converted UseCase and
UML UseCase
(2) in definition field of converted UseCase

UseCase2

How to run this program:
(1) Install Astah Script Plug-in
(2) Download this .zip file from the URL below.
https://s3.amazonaws.com/cdn.astah.net/ConvertReqToUC.zip
(3) Unzip and save this ‘ConvertReqToUC’ folder in Astah Installation folder/api/sample.
(4) Open Command Prompt and compile using ‘compile.bat’ file which is included in the .zip file
Example: C:\Program Files\astah-professional\api\sample\ConvertReqToUC>compile
(Reference: How to use Astah API Sample applications)
(5) Run it with the commend below in Command Prompt
run C:/…/…/xxx.asta (target project file)  *This target project file must be closed when running this program
(6) After the process completes (it tells you so in Command Prompt), open the .asta file. A [rootPackageForReqToUC] package must be created with all the converted UseCases with in it.
(7) To show UseCases in the diagram, select the UseCases in the structure tree and drag them onto UseCase Diagram in Diagram Editor.

This is one of many examples for how to extend Astah’s features by writing Scripts. We have many more samples available on our website, so try them out using this Script Plug-in and API to customize your Astah to perform what you really need.

Cheers,
SJ

Advertisements

2 thoughts on “Convert Requirements to UML UseCases

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s