sequence diagram for android application that uses NFC - uml

The below diagram is based on an android application. When the application loads the user is given 3 button to select add, update and Search. On click on add button the user is given an option to add a new user or add a new item. When the user selects the add item option he enters the required data. Once the data is entered the system check if all the values are entered is correct. if it is correct it is saved if not the user is asked to re-enter the values.One the data is saved the user is asked to write the asset id to an NFC tag.
The same process is applied for update section.
In the search the user is given 2 option to either search the asset through text or by tapping the NFC device onto the NFC tag to search the desired item from the database.
I wanted to know if the sequence diagram I have done is correct.

I would remove the Choose an Option messages. The machine does not trigger anything at the actor. It's the actor who decides. So the initial message always comes from the actor.
The Return Result is implicit with the dotted line. Instead describe what is being returned.
Finally (and most important) you do not use objects but classes in your SD. Always (!) use objects since its an object which communicates, not a class.

Related

UML Activity Diagram for android project

I have created the below diagram and I wanted to know if the diagram that I have done is correct.
The below diagram is based on an android application. When the application loads the user is given 3 button to select add, update and help. On click on add button the user is given an option to add a new user or add a new item. When he select either of the options he enters the required data once the data is entered the system check if all the values are entered correctly and then finally saved. The same process is applied for update.
Your diagram misses an entry point. Though it's rather obvious that the top action is the start, only the entry point is the one indicating the beginning.
You can omit most of the diamonds and directly transfer via a guard from actions. So your conditions should be guards and written as [Yes] or [No]. The top most action (and quite some others) is(/are) indeed what should be written inside (or aside) the diamond below.
An excerpt for an update could look like this:
Finally Values added does not look like an action but rather as state. It should be omitted. Alternatively use differently named end flows.
So far for the formal points. But as #eyp said: it's a good one and one can understand what you tried to express. The above is just for the picky teachers.
It's a good one but it lacks some detail in the diamonds. You should write besides the diamon the question before choosing the next setp to do.
For example in the diamond after Check update value you may write is valid? or another question that clarifies more the business logic.

Want to knw the UML diagram of the given use case

Below is my use case scenario please help me in creating UML diagram:
1 Enter the data in the given input filed.
2 ‘Save’ button
3 Once the user clicks on the save button the system need to check the given details are already available in the existing database. If not then the given values need to be saved on to the database and the system have to display a success message.
4 Once the data is successfully inserted display the same data in the grid below.
5 If the given details already exists in the database then the system need to display a message to the user.
Thanks in Advance
Basically its a flow and mostly we will use below umls for that.
Activity Diagram/Flow Chart
Sequence diagram
in your system you can add following basic use cases
1:Insert the data
2:Check validation of the data
3:Update the data
4:Return Error
and actors are
1.user
2.may be u can add an admin actor for controlling the system

How should I implement `OnLoad` event handler when creating an activity using a contact?

I've created my own solution with a custom entity of type activity. I'd like to show a message whenever a new instance of it is created using an existing contact but not allow the user to create one, if only attempting to do that without going via contact.
Basically, my aim is that it won't be impossible to just create that activity (the form will be hidden directly at any attempt except for one way only). The user will have to go to contacts (or leads etc.) and in there add and create an instance of the custom activity entity. That way, I can assure that the field "regarding" will be filled out already.
I'm guessing that I need to detect somehow that the opening of the form is a creation attempt. How can I do that?
Also, as it is now, the user can't create a contact-less activity of the custom type because it doesn't appear on the menu with other activities. I must have disabled it somehow but I have no idea how. Anybody who has one?
You could do this a bunch of ways but the easiest would probably be to:
Make the regarding field read only.
Make the regarding field mandatory.
That way if a user opens a create new form they wont be able to set the regarding and because its mandatory they wont be able to save the record. When they open via an existing contact the regarding field will be mapped automatically. That said in this case just making it mandatory my be enough.
(As a side JavaScript can be used to identify the current form state, but I'm not sure how useful that is here).
In terms of where custom activities appear, by default mine show in a number of locations, for example:
CRM > Workplace > Activities > Ribbon > Other Activities > XXX.
CRM > Workplace > Activities > View Selector > XXX.
They don't show under the left hand navigation of the workplace because they are grouped under 'Activities'. I'm pretty sure these are all the default settings.
You can exercise greater control by editing the sitemap, where you can put pretty much anything, anywhere.
In addition to Mr Wood, I'd like to show you some code. It works as supposed to but I'm not sure if it's optimal.
var foo = function () {
var whatIsGoingOn = Xrm.Page.ui.getFormType();
if (whatIsGoingOn === 1)
alert("Let there be an entity!");
else
alert("Not a creation...");
}
The other states' (deletion, update etc.) numeric values are listed here.
Answering the second part of your question:
When you create a custom activity you can choose whether to have it appear in 'normal' Activity menus or not by checking the box at the top right of the entity form. This is a once-only choice as far as I know and can't be changed later.
For your setup, I would suggest NOT checking this box, so it does not appear in the activity menus to avoid users even being tempted to do it that way.
Instead, add an explicit relationship to the activity N:1 to Contact, and another N:1 to Lead. Use this relationship to add your activity to the left navigation of Contact and Lead forms, or add a grid for them (depends on how you want to use this and if you need to filter the view to something other than the default "Associated View").
When a user navigates to this section they will see if any previous activities of this type exist, and be able to add a new one. BUT this means that the child record is a child via this relationship, not using "regarding", so use a script on the form for the activity so that if Contact is filled in, it is copied to Regarding, and if Lead is filled in then that is copied. If neither, then use an alert or other means to warn the use that something is wrong (see comment earlier). If you want Regarding to be read-only but filled in by script, you will need to make sure to use the force the value to be saved:
Xrm.Page.getAttribute("regardingobjectid").setSubmitMode("always");
You must have the lookups for Contact and Lead on the form to be able to use them in your scripts, but you can make them not "visible by default" so they are there but not seen by the user (and taking up no space).

Best approach for implementing Insert/Edit of Core Data Entities

Let’s suppose there is an entity called PERSON in a CoreData model and a NSPanel (displayed as a Sheet) is used to ask for the information needed to create an instance of such entity. The NSPanel also has a Save and Cancel buttons.
What would be the best way to implement this?
My current approach is to create the NSPanel and add outlets to NSTextField’s corresponding to the FirstName and LastName attributes of the PERSON Entity.
For the Save button I’ve created a Save Action that “reads” the data entered by the user through the Outlets and manually create a PERSON Entity with the provided information.
For the Cancel button, I’ve created a Cancel Action that just closes the NSPanel.
Even though the whole thing works as intended, I find this approach messy. Things get even worse with the need to implement the Edit functionality since a new method is needed to read the data from the selected Entity and pass it to the NSTextField’s, and add the required logic to the Save Action to account for the update operation.
I wonder if a full CoreData/Binding approach is possible in this scenario?
The main issue with the Full CoreData/Binding approach, at least to my short experience on these frameworks, is the fact that once the user start entering the info on a new instance, is already to late Cancel operation. Right?
The setup you describe is by no means messy. Rather, it provides ample opportunity to enhance the UI experience.
Your last point, or "main issue", is not a problem at all. You can put up the NSPanel and have the user input new values, and simply dismiss them if Cancel is pressed. Only if the Save button is pressed do you insert a new object into the core data managedObjectContext and save.
Similarly, when editing you simply retrieve the data before and populate the fields. You keep a reference to the record, if Save is pressed you modify the attributes and save the managedObjectContext. If the operation is canceled you simply discard the reference.

Using the search module to display entries based on custom fields

I have a profile weblog that contains all our users details (fields seperate from the membership).
These users can submit application forms with the use of a SAEF (stand alone entry form), which will be stored in an applications weblog. Inside this applications weblog, I have a relationship field which assigns a profile to an application.
Inside this application, radio buttons are contained to allow an admin to change the status of that application (an example, a judge views an application for Joe Bloggs and sets this application to “winner”).
What I essentially need to do is filter out all the profiles that have not been set to a number of status’. So if I apply for an application and the judge is yet to view this application, my profile should not appear in the search results. My idea of this is that I would somehow have to intertwine search results with a reverse related entry tag, and as my knowledge of the search module is limited I am at a complete loss if this is even possible.
As you can see, not only do I need to search by custom field, but the profiles that will be displayed should be determined on custom fields contained in the application entry.
I would suggest using the "status" option instead of the radio custom field.
Why? Because you can accomplish the same thing you want to do with the radio field and you can set what entries you want to return in your search results.
For example, you have a status group called: "Application", which is assigned to the that weblog/channel
Within the status group, you will have three options: Pending (waiting to be looked at), Loser (judge sets it to this because it is not a winner, or just as pending), Winner (judge considers that application a winner).
Then in the search tag, you would set what statuses it will return in the search results
so if you want to only return applications/profiles that were marked winner, you would set the status="status_id" (this will be the id of "Winner" status)

Resources