Enterprise architect: Order of entry/exit functions in states - state-machine

In my state machine, I have a state with several entry and exit functions. Enterprise Architect sorts them alphabetically, which can lead to something like this:
entry / a
exit / b
entry / c
The entry and exit functions are what EA calls "element operations".
Question: How can I change the order of these operations? Ideally, I'd like to be able to order them in any way; if that is not possible, I'd like to have all the entry functions before the exit functions.
What I tried: In the "operations"-dialog, one can sort by columns; however, this does not change the order in the state diagram.

In the operations dialog you have select an operation and press Ctrl +UP or Ctrl +DOWN to change the order of the operation.
Alternatively right click and choose option Move up or Move down

I'm using EA 14, and there is a checkbox on "Start > View > Preferences > Objects" (Ctrl+F9 > Objects) named "Sort Features Alphabetically". I have just unchecked it and the operations now appear in the chronological order (entry, do, exit). I haven't checked the impact on other diagrams, though.

Related

Can I write "or" statements in Cucumber?

I am new to using the Cucumber testing framework and am trying to test if a table contains a value in one of the cells. The value I am looking for can vary between 4 different values: Pending, Idle, Active, Unknown. How can I test to see if at least one of these values exist?
This is what I have currently but it only tests for one of the values:
Scenario: Status exists in my table
When I am in the Edge UI
And I click "Administration"
And I click "Sites"
Then I see "Site Elements"
And I see "Idle" inside table
This is what I want to be able to do:
Scenario: Status exists in my table
When I am in the Edge UI
And I click "Administration"
And I click "Sites"
Then I see "Site Elements"
And I see "Idle" or "Pending" or "Active" or "Unknown" inside table
You can make regex pattern in last row like this:
And I see (.*)
After that in method you can use ifs ose switch
Switch(parameter)
{
Case: "Idle":
// logic here
}
Yes, cucumber expressions give you the flexibility to use or's via /.
See https://cucumber.io/docs/cucumber/cucumber-expressions/#alternative-text for more information.
You should write your Cukes in a different way. Instead of using your cukes to document HOW you do something you should use them to document WHAT you are doing and WHY its important. This involves pushing all the HOW into step definitions or better yet helper methods called by step definitions.
The second thing you want a scenario to do is too actually test some behaviour. So ideally you want to do something that changes one of these states, i.e. you perfom an action that results in the value from pending to active.
All this stuff about clicking this and clicking that and seeing particular strings is a really good way to write really fragile scenarios which break whenever someone changes minor details in HOW something is done even if those changes don't break the functionality of what is being done
Scenario: Any status exists in my table
When I am in the Edge UI
And I click "Administration"
And I click "Sites"
Then I see "Site Elements"
And I see a site status inside the table
I believe this is what you are trying to communicate here. Inside your step definition, you can then check that it is one of the recognised statuses.
Given('I see a site status inside the table', function (){...})
However, if you're trying to locate each individual one, then splitting this into a Scenario Outline, and using some of the other answers here as inspiration, you can match the status that you are meant to see in each scenario:
defineParameterType(new ParameterType(
'siteStatus',
/Idle|Pending|Active|Unknown/,
String,
s => new String(s)
))
Given('I see "{siteStatus}" inside the table', function (){...})
OR
Given(/^I see "(Idle|Pending|Active|Unknown) inside the table"$/, function (){...})
Alongside
Scenario Template: Each status exists in my table
When I am in the Edge UI
And I click "Administration"
And I click "Sites"
Then I see "Site Elements"
And I see a "<status>" inside the table
Scenarios:
| status |
| Idle |
| Pending |
| Active |
| Unknown |

Options in second select depending on selected option in first select

Is it possible to create a node.js slack app where users can choose car make in one select menu and then car model in another select menu where the options in the second select menu depends on what car make was choosen in the first menu?
The solution I am looking for could either be in a slack message, in a dialog or chained (if that is a thing).
I have found great examples with only one select menu but I really need to be able to create a pattern where C depends on choices in B and B depends on choices in A etc.
Hopefully someone understands what I mean :)
The only way to implement a select menu depending on the input of a prior select menu is to post one after the other.
Here is a basic outline:
App post message with select menu A
User makes choice and app receives request from Slack with choice for A
App overwrite prior message with select menu B based on choice from A

Remove inside geometry of a model

For a project I'm currently working on I'm looking for a quick and easy way to get rid of inside geometry of a house model.
This house model has everything in it, floors, inner walls, stairs, kitchen, you name it, but I want to remove all geometry on the inside so I'm basically left with just the "shell" of the house. say if you would "submerge" the house underwater, everything touched by the water I want to keep, the rest I want to be removed (maybe a weird explanation but I hope it's rather clear what I mean).
Because I need to do this process on a lot of different house types, it's simply too much work to do this manually by hand, and I'm therefore looking for a method which can do this quickly.
I use 3ds Max for my modeling, but solutions in different software, for instance Meshlab, are fine too!
Thanks in advance,
Maik Bentlage, iBuild
For a MeshLab solution, this blog entry describes a method to use ambient occlusion to remove interior vertices. In MeshLab 2016.12:
Filters > Color Creation and Processing > Ambient Occlusion
Filters > Selection > Select by Vertex Quality. Play with sliders to select low quality values, i.e. all the interior vertices that are not visible (try min 0, max 0.1).
Filters > Selection > Delete Selected Vertices
This isn't a perfect solution, but may be good enough for your needs. If you can determine a max quality value that works consistently for your models, you could easily script this for batch processing.
It really depends upon how each house was created.
If it’s a hierarchical approach, i.e., the house is a parent and models inside (kitchen, floors…) are children, then you can easily use a simple MaxScript such as this one to delete all children from your scene (inspired by this thread from cgsociety) :
global meshes_list=#()
fn selecting_children ancestors =
(
for i in ancestors do
(
counting = i.children
if counting.count>0 then
(
for x in counting do
(
append meshes_list x
)
)
)
return meshes_list
)
rollout hierarchy_rollout "Hierarchy Operations"
(
checkbox Checkbox_DeleteSelection "Delete Selection" checked:false
button select_children "Select All Children"
on select_children pressed do
(
select objects
sel = selection as array
x = selecting_children sel
select x
if Checkbox_DeleteSelection.state == true do
( delete selection )
)
)
createDialog hierarchy_rollout 200 150
Just make sure that you don’t end up deleting other meshes or houses as well!
If they are not hierarchically ordered, then you can Select by Name (press H) and delete everything manually, but more quickly than selecting them one by one with your mouse.
If the whole house is a single mesh (including props inside), then I am not aware of any existing way to automatically delete everything inside. You can still select by Element (after converting it to an Editable Poly/Mesh) and, after selecting the house (assuming it's a single mesh), pressing Ctrl + I for inverting selection and delete everything. But it’ll still be time consuming.
A workaround might be to attach every house into one gigantic mesh (just open the attach list to select everything at once) and to use the rectangular selection to select only the highest part (which should isolate props or most of them) of everything, in the Left or Right Wireframe Viewport, and then press Ctrl + I.

How can a child of an aggregate root use values from another aggregate root

For example, consider a store having multiple menus. Menus list items and one item can be listed in multiple menus.
Imagining a Menu aggregate root and Item aggregate root. A Menu would have a collection of MenuItem's who reference an Item AR along with ordering information within the particular menu.
My question is, how would you access the Item's name, price, description from the MenuItem. Say, for instance, the Menu AR handles a command to re-order itself by price (I know that sounds UI related, but I'm strictly talking domain model here, idk maybe it's a business rule that a menu must be sorted in a particular way? )
Would you obtain a Value Object for the Item AR inside the MenuItem? If so, would the Menu AR hold a reference to a domain service to lookup the value object for the Item, or would the MenuItem use the domain service.
I guess, the Menu AR should be consistent at all times and that could mean that when an Item is added to a Menu, the MenuItem holds a reference to a value object for the Item.
Sounds like that would break the 'reference entities by identity' rule, so the MenuItem would hold a reference to ItemId. Considering the use of event sourcing, whenever you'd want to apply a command to the Menu AR, it would replay all of it's events bringing it into consistency and then you issue a command to re-order the menu's items.
The MenuItem would only have a ItemId and not the details of that item, would this be the time to load those items? The Menu could loop over it's MenuItems then use a service to lookup a Item value object by ItemId for each MenuItem and then perform the sorting.
Thanks for any input, greatly appreciated.
Like you said, this should probably be done in the query side. I'm not sure that I see how keeping the ordering consistent in the domain would be of any use? Perhaps I would if menus had different ordering strategies, but even then. Anyway...
If the data used by an AR is not within it's boundary then it may only be made eventually consistent, unless you modify more than a single AR per transaction which is usually a bad practice.
You may do something like that:
menu = menuRepository.findById(menuId);
menu.reorder(itemPricingService);
Some also prefer to resolve dependencies in the application service/command handler:
menu = menuRepository.findById(menuId);
itemIdList = menu.items().map(extractItemId);
itemPriceList = itemPricingService.pricesOf(itemIdList);
menu.reorder(itemPriceList);
However, you will also need to listen to an event such as ItemPriceChanged in order to keep the menu ordering consistent with price changes.
There's also another strategy where you could copy over pricing information to the MenuItem. The price would be kept eventually consistent relying on events and a reorder would occur from the item of which the price changed.
You may use a similar reordering strategy as implemented here. Have a look at the reorderFrom implementation of Product and ProductBacklogItem.

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.

Resources