Frequently Asked Questions - Tips - Updates

Most recent updates are at the top

StaticID instead of phone number

The PATS lab uses a so-called staticID instead of real phone numbers for identifying mobile phones. This means for example that the method getFrom() on an Sms signal returns a string such as A-FHGGVB instead of a phone number. It also means that if you want to send an Sms from the GUI and receive an SMS back to your mobile phone, you need to type your staticID instead of your phone number. Apart from this you need not worry about the distinction between a staticID and a phone number.

You can find your staticID by sending an SMS from your mobile phone and checking what is returned by sig.getFrom()

On the order of attributes and ports

The UML compiler has no intimate understanding of semantic problems that may occur because of changes in the order of declarations or initialization. In the case shown in the example model of the DynTrafikanten ports, it is important that the DynOutMediator are initiated to point to the corresponding input port. If the input port is not existing, there will be structural problems. Therefore it is necessary that the input port is created before the DynOutMediator. The order is given by the order these ports appear in the model explorer under the enclosing class. This is again due to the order in which you entered it, but it can be changed by rightclicking the class and selecting Properties. Then go into OwnedPorts and there you may change the order by using arrows in the right margin of the dialog box. The same ordering principles are also used for attributes.

New versions of SMSMediators and DynTrafikantenMediators for special problems

There have been some problems with the predefined interface mediator libraries. Therefore I have made new versions to cope with exactly those problems. If you do not encounter these problems, you need not exchange your jars.

SMSMediators version 051116 includes a dummy constructor without parameters to InputSmsMediator. This is because the UMLCompiler assumes this if you define a subclass of InputSmsMediator in your program. If you do not do this, and it is not necessary, you need not use this version.

DynTrafikantenMediators version 051116 corrects a method (called messageContent) that is used for tracing. Unfortunately there will be a runtime error if a DynInfo returns without any routes, probably because you have given the wrong bus stop input as disId to DynRequest. The new version will produce a constant text and should therefore not give any runtime error.

How to calculate the distance between the mobile phone and for instance a bus stop

The file GreatCircleAlgorithm.java is an example of how this is done.

How to make a fat jar

In order to make an executable file with all the necessary information including the PATS and Trafikanten libraries, you will need to install a plugin that makes you capable of making a "fat jar". You find that plugin at Fat jar.

Mysterious error on Linux system - Workspace in use

There have been incidents of the Linux system (on Ifi) suddenly responding that the workspace is in use when trying to enter your normal workspace. The remedy is to delete the file $workspace_dir/.metadata/.lock

Last version of JavaFrame is JavaFrameIFI-051019

Make sure you use the version of JavaFrame found in the jar-file: JavaFrameIFI-051019.jar For a period there was also from the resource page a pointer to an earlier version of JavaFrame. This should have been updated.

New version of UML Compiler 1.0.8 for making arrays

Install new UML Compiler version by replacing no.uio.ifi.javaframetransformation_1.0.7 by no.uio.ifi.javaframetransformation_1.0.8 in the plugin directory.

DO NOT TOUCH the Java Frame profile, otherwise you will lose your stereotypes. Startup the RSM again with parameter -clean. You may remove the old 1.0.7 version from the plugin directory before starting up again.

The new version of the compiler will generate arrays when an attribute has an upper multiplicity higher than 1. You may also use "*".

The compiler can be found at: JavaFrameTransformation 1.0.8

How to use standard Java classes

In your solution it may be necessary to use for instance java.util.ArrayList or some other predefined classes from Java. This is accomplished by setting up a "shadow structure". Make a new package on the same level as your Multiple Blind Date system package called "java", (not in it). Under java you add another package called "util". In this package you have to make UML classes with the same names as the java classes, for instance ArrayList or Date. They are not supposed to have any attributes or operations, just the class with the correct name.

Now it is possible to say that some element in your Multiple Blind Date model is of type java.util.ArrayList (from your own made shadow srtucture), for instance an attribute. If you now are in a transition effect and wants to add something to the state machine's ArrayList al you can write "csm.al.add(int index,object);". To retrieve the object, for instance a String write "String someTekst = csm.al.get(int index);".

It is now very important that you do not transform the java package you have created. Select only the model package where the BD system models are. If you transform the package: "java" it will be generated java files named ArrayList and so forth with no attributes or operations, these classes will override the "real ones". If you accidentally transform the package, manually delete the files from the Java project(target of transformation).

SMSPorts and TrafikantenPorts

Concerning the two files SMSPorts.emx and Trafikanten.emx, follow the instructions given in : Example system instructions
Then when the example system is working you can use the SMSPorts and TrafikantenPorts in your own BDS model. In your BDS project right-click the model and choose: Import Model Library,File,Browse, find the SMSPorts.emx from your workspace dir (SMSPorts) and import this into your BDS model. Do the same with the trafikanten.emx file. Now it is possible to set the type of your ports to for example: SmsInputMediator or say that a Signal is of type Sms.

Dynamically creating active objects

Atle has made an example model that shows how to model dynamically generated objects. This may come in handy for the Drop2. Download the model from MakingBabies.emx

Instructions for running the MakingBabies project:

1. Create a new instance of ChildSM by sending a CreateChild message to creatorSM. The CreateChild message has two parameters: name (of type String) and gender (of type integer).

2. After a childSM has been created, a Boo message with the name of a ChildSM can be sent to the creatorSM. The message is then forwarded to the childSM with the given name, which then responds by sending a Squeel message.

The System.out.println statements are remnants from testing and can be ignored. The Hei message has no parameters and is included just to check that the creatorSM is alive and well. It should respond with a Hopp message.

Difficulties with installing the plugins on Linux (Norwegian version)

Jeg definerte en eclipse extension p? mitt hjemmeomr?de. Hvordan gj?re det st?r her (Punkt nummer 5 sier at du m? sende med masse argumenter for ? starte, de kan droppes) En annen side som gir mer forklaring av eclipse extension: her Jeg testa inf5150 filene og det fungerte.

Updates to the proposed solution drop 1

On page 14 the use of new message types "AddPerson" and "AddOk" is not necessary. Just forward "JoinEvent" and let the event create and output the "JoinEventOk" message.

On page 15 the confirmation message "JoinEventOk(phone)" is attached to the wrong lifeline ":Session", the correct one is ":ControllerSM" which shall route the message to the correct session.