• 2 replies
  • Latest Post - ‏2012-12-20T10:39:24Z by SystemAdmin
2260 Posts

Pinned topic how to get the activity diagram in RoseRT? (C#)

‏2006-09-30T18:06:18Z |
Hallo everyone,

My code:

this.m_RoseRTApp = (RoseRT.Application)Marshal.GetActiveObject("RoseRT.Application");
this.m_RoseRTModel = this.m_RoseRTApp.CurrentModel;
RoseRT.LogicalPackage rootLogicalPackage = m_RoseRTModel.RootLogicalPackage;
RoseRT.AnalysisStateMachineOwner owner = rootLogicalPackage.AnalysisStateMachineOwner;
Console.WriteLine("Count: " + owner.AnalysisStateMachines.Count);

And now I get the Error message:
Error: Called an RRTEI function from an REI object.

And I can not go on any more.

Who can help me please?

Updated on 2012-12-20T10:39:24Z at 2012-12-20T10:39:24Z by SystemAdmin
  • SystemAdmin
    2260 Posts

    Re: how to get the activity diagram in RoseRT? (C#)

    Hi ,
    We can get handel of activity diagram in RoseRT using vB code.

    Problem : In the below model ,User wants to add a state on NewActivityDiagram.

    Use Case view

    Logical View ---
    |---State/Activity Model1----
    Component View

    deployement View
    Answer - The below RRTEI/VB code can be useful to acomplish this task,

    Sub Main
    Set thePackage = RoseRTApp.currentModel.RootLogicalPackage
    set theAnalysisColl = thePackage.GetAllAnalysisStateMachines()

    for counter=1 to theAnalysisColl.Count
    If theAnalysisColl.GetAt(counter).Name = "State/Activity Model1" Then
    goto level1
    end if
    next counter


    Set AnalysisStateMachine = theAnalysisColl.GetAt(counter)

    Set AnalysisStateDiagColl = AnalysisStateMachine.Diagrams
    for counter1=1 to AnalysisStateDiagColl.Count
    If AnalysisStateDiagColl.GetAt(counter1).Name = "NewActivityDiagram" Then
    goto level2
    end if
    next counter


    Set theActivitydiagram = AnalysisStateDiagColl.GetAt(counter1)

    set TheState = AnalysisStateMachine.AddAnalysisState("NewState")

    Set TheStateview = theActivitydiagram.AddAnalysisStateView(TheState)

    End Sub
    I don't have much knowledge about C# but you can developed similar code in c#.

  • SystemAdmin
    2260 Posts

    Re: how to get the activity diagram in RoseRT? (C#)

    Hi Everybody,

    To Capture all elements in all type of diagrams,predefined methods and attributes are there in Rational Rose RT Extensibility interface reference documentation except for activity diagram.Is there any reference documentation for capturing activity diagram?

    So, Any one help me, Are there any predefined methods for capturing activityDiagram other than the following methods

    I wanted to know predefined methods to read activity, state, start state, end state,Transition, self transition, Horizontal synchronization,vertical synchronization,decision and swimlane.

    Could you please help me soon :)

    Thanks in advance


    Lakshmi Narayana,