Tuesday, July 21, 2009

AUML Feature Implementation in Plug-in Version

This document records the overview about how AUML features are implemented in PDT Plug-in (based on version 0.2.5). Also see another post Features on PDT plug-in 4.

1. Overview

AUML features mainly include three components:

  • AUML Text editing & checking;
  • Sequence diagram & interaction table build-up;
  • Model construction;
As long as the user is editing the AUML text, PDT checks the inputs and give comments if there is any error found. When the AUML text passed syntax checks, PDT creates the AUML sequence diagram and interaction table based on user's work and complete underneath modeling so that the PDT graphical editors could represent the communication among the agents.

2. AUML Textual Notation Check:

2.1 Syntax Check

The syntax check logic is mainly inherited from standalone PDT tool. Here I summarize what kinds of error considered. An error will be alerted, if:

1) Any end of a message interaction is not an agent (a message should only associate with two agents.);


2) A percept/action interaction is not between agent/role and actor/environment;

3) The adjusting commands' argument is not a valid integer. For example, the command "agwidth+" must be followed by an integer parameter. If the parameter can not be parsed as an integer, an error will rise up. This is also true for other adjusting commands, such as "tagwidth+", "backup", "skip", "boxskip+", "offset+", etc.;

4) A line does not start with an eligible command, such as "agent", "actor", "message", "backup", etc.;

5) A short name is already used in former definition;

6) There is missing parameters, such as a declaration "agent shortname" without long name;

7) The "box" command has an illegal parameter (currently only support "par", "alt", "opt", "break" and "loop" 5 types);

8) The protocol name in AUML text does not match the name in Graphical Editor;

9) There is redundant parameter, such as "finish protocol" where the parameter "protocol" is redundant;

10) There is a short name which does not have a corresponding long name declared in this protocol;

11) The same reference is used by different crossing messages or "goto"/"label" commands;

12) The references of crossing message's start and end do not match each other;

*13) Commands "goto" and "label" do not appear in pairs;

*14) Commands "timestart" and "timeend" do not appear in pair;

*15) The cross message declaration "mes-" and "-sage" do not appear in pair;

*16) The "box" keeps open;

*17) There are no actors, agents, or environment defined in the protocol;

*18) There are no interactions defined in the protocol;

*#19) The agent/actor/environment is defined but never used in any interaction;

#20) The time constraint commands "timestart" "timeend"are nested;

#21) The long name is duplicated, which means user defines different short names for the same long name;

NOTE:
* From 13) to 19) above, the error can only be detected after parsing the whole AUML text. Therefore, they can not be used for real-time syntax check. Real-time syntax check means that every time user finishes a line, PDT performs the syntax check and gives error feedback if there is any.

# The rule is new-created in plug-in version PDT.

2.2 Design Consistency Check

Besides syntax, we need the following rule to perform further check to ensure the protocol is consistent with the other parts of the design:

22) If the entity name mismatches the entity type, for example, user declaration "agent shortname MessageA" where "MessageA" is actually a message existed in the design;

2.3 Commands Defined Differently from the Paper:

PDT implementation is slightly different from what is noted in the paper (
Michael Winikoff. Defining syntax and providing tool support for agent uml using a textual notation. IJAOSE, 1(2):123-144, 2007..pdf)

2.3.1
backup line number
In PDT, user must indicate how many lines an interaction should be backed up.

2.3.2 skip line number
Similar to
backup, user must indicate how many lines an interaction should be skipped.

2.3.3 boxskip+, interboxgap+, offset+
These 3 commands are not mentioned in the paper but implemented in the PDT plug-in.
The picture below shows their meaning:


2.3.4 Do not support inittagwidth+, but support tagwidth+

2.3.5 Do not support invis, but support environment/actor/percept/action
environment shortname longname is a declaration similar to actor declaration. PDT will draw a dashed-line box for actors and environment, but a solid-line box for agent and role.

To make the environment invisible, the long name must starts with "invis".

2.3.6 Percept & Action have bracket "<>" or "><". Messages have no bracket.

3. Sequence Diagram

Only if the AUML text passed all the checks above, the sequence diagram is constructed. Again, this is done with the standalone PDT source code.

4. Model Construction

Since PDT plug-in is re-modeled, so this part must be overwritten.

After the sequence diagram is done, the following changes in model will happen due to user-defined AUML text:

4.1 Create new entities (agent/actor/role/message/percept/action);

4.2 Create new relations (not included 3-tuple relation):
- Message->Agent;

- Agent -> Message;

- Agent -> Action;

- Role -> Action;

- Percept -> Agent;

- Percept -> Role;

- Protocol - Agent;


4.3 Propagate relations:
- Role's Agents -> Action: if an action is associated with a role in the AUML declaration, the action should be related to the role's agents;
- Percept -> Role's Agents: similar as above;

4.4 Propagate cells: create percept/message/action cells on agent's diagram;

4.5 On protocol property tab, refresh interaction table to show the updates (3-tuple relations inside a protocol are shown in this table);

* If the AUML text is modified, all the processes above should be updated to reflect the changes. But the relations between Action/Percept and Agent/Role must be modified manually since they may effect other roles or agents.

Thursday, June 25, 2009

version 0_1_6: new_feature_002

Note: version 0_1_6 is the version when the feature is created not the new version tag holding this feature.

Feature description:

1. If an external message/data is added onto agent/capability overview, the external entity should be propagated to all the upper level diagrams.

2. Similarly, if a message/data on a agent/capability overview is defined as external entity, it should be propagated to all the upper level diagrams.

Analysis & Solution:

For feature 1, we need to modify PropagationUtilF to propagated external data/message, just like how PDT propagates percept/action to upper level diagrams. Moreover, CellCreationPolicy_AgentOV should return a new command ExternalEntityCreationCommand_AgentOV to propagate external data/message to upper level diagrams.

Another thing is, when a capability is added onto an agent diagram, all the external entities (percept, action, and now plus external data/message) should be propagated to upper level diagrams. This is implemented in PropagationUtilF and called by CapabilityCreationCommand.

For feature 2, the operation triggering the whole procedure is that user clicks "external to system" checkbox on property descriptor panel of a data/message. If the checkbox is tickled, the command "ChangeExternalStatusCommand" should be performed. If the checkbox is untickled, only the command "PropertyChangedCommand" is performed to change the property "externalToSystem". For either case, EntityCell#setFaded() method will be called to trigger all the cell representing the same entity to refresh fade status.




version 0_1_6: new_feature_001


Note: version 0_1_6 is the version when the feature is created not the new version tag holding this feature.

Feature description:

This feature is for link deletion propagation strategy where shared capability is involved. The example below demonstrates the process of this propagation process.

On System overview there are a percept, an action, an external data and an external message which are associated with a capability (capability "cap") shared by two agents ("agenta" and "agentb").

Because all the external entities (percept, action, data and message) are associated with capability "cap", on Agent "agenta" diagram:

Similarly, Agent "agentb" is like:


Shared Capability "cap" possesses all the external entities:



Now, if user try to delete a link between any external entity (which in this example is the external message) and the agent ( in this case which is "agentb"), the operation will be forbidden and a user notice will pop up to tell user that this link is involved with a shared capability and can not be deleted.
This is because, if the link deletion was allowed, then the message should be deleted from agentb and all the agentb's sub-capabilities. However, agentb's sub-capability "cap" is not a private capability. "agentb" has no authority to modify "cap", and "cap" needs this message as input. Therefore, "agentb" must provide this message to "cap". Moreover, the message is external to the system, so that "agentb" can not hold this message as an internal message, which means this message must be propagated from system overview.

From the descriptioin above, we can see that the link deletion proves the link should remain on system overview. Thus, the link deletion should not be permitted.

However, if the message is not external (not external to the whole system), then it could be deleted.





Just as normal link deletion propagation process, on the lower level diagram (in this example agenta diagram) the message becomes internal message of that agent.



Analysis & Solution:

The normal link deletion propagation process (PropagationUtilC#deletelink() method) is used in cases:

* Delete link between agent/capability and another entity (percept/data/message/action) on System/Capability/Agent Overview;
* Delete link between Agent & Role;
* Delete link between Role & Percept/Goal/Action;

This feature only involves the first case.

A neat implementation is to add a static method in PropagationUtilC to caculate whether a link is involved a share capability, or say whether this link is "deletible" on System/Agent/Capability OV.

The news is that all the System/Agent/Capability Overview are using the same link deletion policy. So we only need to change one point all the others will be changed as well. Actually, since the link is between agent/capability and percept/action/data/message, we only need to change the command "LinkDeletionCommand2_SystemOV".




Wednesday, June 3, 2009

Features on PDT Plug-in 7

Propagation

1. Propagation in Detailed Design:

1.1 Propagation Requirement:

There are basically two categories of propagation on Detailed Design level:

  • Link Propagation: For example, when user connects a Data with a Message to depict that the message is a 'post event' of the Beliefset, on every diagram with these two entities on it, there should be a link between them to show the relation.
  • Cell Propagation: For instance, if user add a Percept onto a Capability diagram, the percept should be top-down propagated from the upmost detailed design diagram -- System Overview, which means the percept should be possessed by every diagram between the System Overview level and the Capability diagram level.
Although the category is simple, the propagation cases are various. The next section summarizes all the cases that are considered and implemented in the new PDT version.


1.2 Implemented Propagation Cases:

Case 1: (Implemented in Old PDT as well)

Before any user operation, there is an agent and a data (or other entity type, such as message, action, percept ...) on the system overview.


User operation in Case 1:

User connects the two icons.


Policy for Case 1:

There will be a data propagated to agent overview automatically.



Case 2:(Implemented in Old PDT as well)

Before any user operation, the icons and connections are like following:

On System Overview:


On Agent Diagram, the message and data are propagated onto agent diagram.


User Operation in Case 2:

User connects data with message:


Policy for Case 2:

The connection will be built on every diagram (in this case, the agent diagram) where icons of both two entities exist.




Case 3: (Implemented in Old PDT as well)

Even if user builds two connections between agent and data,

Policy for Case 3:

there is only one data icon propagated to agent overview.


Case 4: (Implemented in Old PDT as well)

Before any user operation, on the system overview the icons and the connections are like following: (Click to see a bigger picture)


The message is propagated to agent diagram.


User Operation in Case 4:

User adds the data onto the agent diagram.



Policy for Case 4:

The connection between data and message is built up automatically.



Case 5:

Before any user operation, on detailed design level the icons are connected as following:

On system overview, an agent (SchoolA) is connected with a message, which is posted by a data. (Click to see a bigger picture)


On SchoolA's diagram (you can see that the agent 'SchoolA' is selected on the diagram outline on the right side), capability sends out the message.


On capability diagram (capability 'CollectStudentInfo' is selected on the diagram outline):


User Operation in Case 5:


Now user deletes the connection (between the agent and the message) on system overview:


Policy for Case 5 :

The message is delete from both agent diagram and capability diagram automatically.


Case 6:

Add another copy of message onto system overview,


and create a duplicated connect between the agent and the message.


User Operation in Case 6:

Now delete one of the two connections.

Policy for Case 6:

The other duplicated connection is deleted automatically so that consistence is remained.




Case 7-9:

Case 7:
Before any user operation:


User operation in Case 7:

Delete message cell from System Overview.


Then add the message back.


Policy for Case 7:

The connections are added back automatically as well.


When user deleted the message from system overview, the cell deletion will not propagated to the capability diagram.

User operation in Case 8:

Now, if user deletes a connection (between data and message) manually on the system overview:


Policy for Case 8: (Implemented in Old PDT as well)

The connection will be deleted from every diagram. (Comparing to the picture showing the icons and connections before any user operation, the connection between the message and the data on the agent diagram is deleted automatically. This policy also works for the connections between message & plan, percept & plan, or data & plan. )

User operation in Case 9:

Now, if user adds a copy of the message onto the system overview diagram,

and then delete the other message icon which has connections.

Policy for Case 9:

To keep consistent, PDT will find a copy of the message on the diagram and build the connection automatically.



Case 10:

Before any user operation, the icons and connections are like following:

System Overview:


Agent Overview (SchoolA is selected from the diagram outline)


Agent Overview (SchoolB is selected from the diagram outline)

Note: the capability is shared by two agents.


Capability diagram (Capability 'CollectStudentInfo' is selected on the diagram outline)


User operation in Case 10:

Delete the connection between the agent 'SchoolA' and the message on system overview.


Policy for Case 10:

On agent's diagram, there is only one copy left, since this copy is connected with the shared capability. All the links point to this icon to keep consistence.


The other agent diagram and the capability diagram keep unchanged.

Case 11-12:
Case 11:

Before any user operation, there is an agent on system overview. The agent possesses a capability.


User operation in Case 11:

User adds a percept onto capability overview:

Policy for Case 11: (Implemented in Old PDT as well)

The percept is propagated to upper level diagrams up to system overview. The connections are built automatically as well.


User Operation in Case 12:

Now, if user creates a new agent:


and let the capability shared by these two agents:
Policy for Case 12:

The percept are possessed by both agents:


On System Overview, the percept is connected with the new agent as well:




1.3 Summary:

As the cases above shown, there are more than one "policy" employed for propagation. Each policy is a solution to a particular case which should be concerned independently. With the support of GEF framework, the policies shown here are implemented independently, which means that to modify/delete/add a policy will not effect the others, unless there is some overlapped logic.

Wednesday, May 20, 2009

Features on PDT Plug-in 6

Entity List

User can overlook all the entities in the PDT Project in the entity list outline.

1. Overview (Click to see the bigger image)

There are two tabs on PDT Project outline, Diagram Outline (go to Features on PDT plug-in 5 for details about Diagram Outline) and Entity List.


After clicking the "Entity List" tab, all the entities in the current project are listed here:



2. Add an entity:

If user creates an new entity, the Entity List will receive a notification and refresh the list to display the recent change.


3. Show entity info on Property View:

By clicking an item on the Entity List, user can see the entity details in the property view. (see Features on PDT Plug-in 1 about Tabbed Property View)


4. Change Entity Name:

If an entity name is changed in the property view, the Entity List will reflect the changes immediately.

5. Entity Deletion: (not Finished)

User can delete an entity from Project by right clicking the tree item in the entity list and select "Delete". This action should be implemented after propagation implementation because the entity deletion will involve the relations associated with this target entity.

Tuesday, May 5, 2009

Features on PDT plug-in 5

User can access Agent Overview and Capability Overview through Outline

1. Overview (Click to show the bigger picture)


User can click the node on the diagram tree or click the diagram editor tabs to navigate among different Diagram Editors. There are 3 diagrams currently available: System Overview, Agent Overview and Capability Overview.

2. Add Agent/Capability entity to the project

Add an agent on the system overview:


A node is appended to the diagram tree.


Click node to display the agent diagram:


Following the same way, user can add sub-capabilities for capabilities.



A capability can also be shared among the agents like the picture above saying.

3. Link Restrictions for agent/capability diagram

Follow the description in the requirement analysis document stored at the CVS repository.

4. Open more than one project at the same time

Eclipse editor support to open multiple PDT project in the IDE at the same time. Every editor will have its own outline.


5. Save, Undo/Redo:

See PDT Feature 2 section 4.

Wednesday, April 29, 2009

Drupal CMS

1. Ten reason for Drupal
2. Wikipedia page
3.