Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [tigerstripe-dev] exact enclosing model project

Title: Re: [tigerstripe-dev] exact enclosing model project
Hi Eric,
The workaround works. Thank you very much!
best regards,
From: Zhang, Jin-Zhai (TSG-BAS-China-SH)
Sent: 2010年2月14日 23:49
To: 'Eric Dillon'
Subject: RE: [tigerstripe-dev] exact enclosing model project

Hi Eric,
Thanks! I'll try and back to you.
best regards,

From: Eric Dillon [mailto:erdillon@xxxxxxxxx]
Sent: 2010年2月13日 9:25
To: Tigerstripe Developers; Zhang, Jin-Zhai (TSG-BAS-China-SH)
Subject: Re: [tigerstripe-dev] exact enclosing model project

Hi Jinzhai,

Here is a work-around that should work for you:

      String name = null;
        IAbstractArtifact art = ....;
        if (art.getParentModuleHeader() != null) {
            name = art.getParentModuleHeader().getOriginalName();
        } else
           name = art.getProjectDescriptor().getProjectLabel();


On 2/10/10 2:32 AM, "Zhang, Jin-Zhai (TSG-BAS-China-SH)" <jinzhai.zhang@xxxxxx> wrote:

Sorry, I put subject and re-send.

Hi Team,
Would please help me with following question: I have a Tigerstripe model project which depends on other models, now given an artifact (e.g. an Package artifact, or a ManagedEntityArtifact), how can I know which Tigerstripe model does the artifact belong to, at runtime?

Here let me give more details. I have a model 'spm' tigerstripe project. It depends on a model named 'spm_dependencies'. We export 'spm_dependencies' as a tigerstripe model and add it in the list of 'dependencies' of the 'spm' model project.

Now I run an 'artifact rule' (as part of a generater) with 'spm' model project. the configuration of the rule is given here:

I suppose I can know enclosing model in this way:

  ITigerstripeModelProject proj = packageArtifact.getTigerstripeProject();
   String enclosingModelProjName = null;
   if (proj != null) {
        enclosingModelProjName = proj.getName();

Given a package or an entity defined in the current model ('spm' model), the getTigerstripeProject() returns an object from which I can get model proj name. but if the package or the entity is defined in dependency model ('spm_dependencies' model), the method returns null.

Any suggestion?

best regards,


tigerstripe-dev mailing list

This email may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message.

For corporate legal information go to:

Back to the top