How do you create a link to a Option List with different set values in AnyLogic? - simulation

I created an "Option List" & parameter with that data type in "Main" with three different options (A, B, & C). Additionally, I set the "Control Type" to "Radio Button" and defined the List of values.
Now, when I go to "Simulation" I want to have a radio button in the view that the user can select. When that selection is made and the simulation is run, the simulation would use the selected value.
The problem I am having is how to use the "Link to:" option to link this to the "Option List" parameter defined.
I created a "variable" in the "Simulation" view with the correct "Option List" data type, but the radio button won't let me "Link To" that particular variable.
How do you set up the "Link To" to point & change the "Option List" defined in Main?

Nevermind, I was able to resolve this by using a collection object within "Simulation" that defines the three options in the "Option List".
Then, inside the simulation for that parameter I used the following code:
dataOptions.get(radio.getValue())
Now, when the radio button changes an integer gets sent to the dataOptions collection and sends the correct Enum value.

Related

How to hide panel by specific condition in grafana

I want to hide some panel by specific condition in graphana.
For instance, I have some variable in my dashboard and I want to change visibility of some graph if my variable is equal to some specific value.
Is there any way to do this?
UPD: Using repeat panel option is not solution in my case, because this option just dynamically creates new panels. But I want to hide some panel by specific value of my variable, if variable is not equal to this value then the panel should not be hidden.
I dont see an option to hide/show a panel with template variable, but instead you can create two dashboards and use dashboard links.
For example:
First Dashboard (Type A)
Second Dashboard (Type B)
Create a Dashboard link "Type B" in First Dashboard pointing to second Dashboard.
Similarly Create a Dashboard link "Type A" in Second Dashboard and point it to First dashboard.
Settings -> Link -> New Link -> Choose "Include time range" & "Include template variable value"
I have actually used this option because mine was just two variables so it was duplicating the dashboard to two and linking eachother.
If it is multiple values to show/hide, i recommend to achieve it via repeat options some how linking that variable in your query.

How to dynamically change dialog with select field

I'm new to Magnolia, and I'm making my own module.
I have a dialog box when adding a component and I want to change next fields below dynamically using a select field.
Example:
Select field with {"type 1", "type 2", ...}
IF "type 1" is selected
->show a text field below
ELSE
->show a basicUpload field below
Thanks in advance.
I believe same was already discussed here and few other places if you look over questions tagged "magnolia".
Long story short, fields are atomic, independent entities. They do not know about each other. So the only way to create such dynamic connection is over "parent" form. You need to extend form presenter and field factory (if you want select that would be SelectFieldFactory) and in there, when field is created, attach value changed or similar listener to it so when value is changed in the field, you can inform presenter to make some other field visible or hide it.
IIRC you can see example of that done in External Forms module (if you have access to enterprise code). Not sure if any of the community modules show the same.

How to control Show/Hide fields at Runtime in Orbeon Form Runner?

I have created a form in orbeon form builder which has three 30 questions which are belongs to 3 categories. Now I don't want to show all the 30 questions to every one also I don't want to create different forms for each category because all these categories belongs to one module.
While adding the form I have a drop down question like "Select Category". If user select the first category then I need to display only first category related questions and hide the second and third category related questions.
Is there any way to achieve my task in Form Runner?
UPDATE:
#ebruchez, I have followed your suggestion, I tried testing this feature on default "contacts" form. I have created a new text field in the contact form named "Account Related Field" as a label and "control-10" as Control Name. Below is the screen shot for the same.
Then After that I clicked on control setting of the "Account Related Field" and under the "Formulas" tab I have added the following XPath expression in "Visibility" section. $topic='Account' following is the screenshot.
After adding the path expression I saved the contact form and published. Then I tried opening the form in form runner. But I am not able to view the "Account Related Field" field on UI after selecting the "topic" value is "Account" in the form runner. This is the screenshot of form runner after publishing form in form builder.
Did I miss something. Please help to resolve the issue. I need to view "Account Related Field" field only if "topic" field value is "Account"
Thanks in advance.
Yes you can, by using a "Visibility" formula under the section settings. For example if your dropdown is named foo and has two entries, category1 and category2, then you can write:
$foo = 'category1'
to make the section visible only if the dropdown selected category1, and:
$foo = 'category2'
to make the section visible only if the dropdown selected category2.
This doc might help.

How to hide the value of a tag in Enterprise Architect documentation

I made a custom template on Enterprise Architect that is a slight modification of the requirements template that came with the program. I edited the template to make it that the value of a specific tag will also be included in the documentation.
"Requirement Type: {Element.valueOf(****)}"**
However, not every element in my document has a value for that specific tag. Is there a way I can have that line show up only when the tag has a value? Or have the documentation say
""Requirement Type: none"
if there is no value?
I am using EA version 8.0.860 from Sparx Systems
If you are using version 10, there is a new feature called Fragment Template. You could move the specific part of the document that you would like to show/hide into a Fragment Template by performing the following steps:
Create a new Fragment Template
Configure the fragment, e.g.
package>
diagram>
element>
Requirement Type: {Element.valueOf(****)}
<element
<diagram
<package
On the Document Options, go to Element Filter tab
Click Add Filter
On the drop-down Search On, choose TagValue
Check the Property, set Condition to "Equal To", and set the value as the Tag name
Check the Value, set Condition to "Equal To", and do not set the value
Check the Required, then press OK button to close Add Filters window. This means that if the Tagged Value has no value, it will not be shown.
Press OK button to close Document Options window
You may create more than one fragment according to your needs.
Import the fragment template into your main template.
But since you are using version 8, IMO the options that you have are:
Adding "Requirement Type:" text into every Tagged Value that has value
OR, adding "none" into every Tagged Value that has no value.
You could create an EA Script to automate number 1 and number 2, because those are repetitive tasks.

Programmatically show link to another report in Report Builder 3.0?

I have a grouping in my report that I want to use to link to another report. My dilemma is that I only want the link to be clickable when the value in the cell fulfills a certain criteria (number > x for example). If the condition isn't true, then I don't want the cell to be clickable. Is there a way to do this?
Edit: I've tried to set an IIF statement as part of the url, but what do I link to in the "false-part" of the statement? Using "" actually just refreshes the report, which isn't really what I want either. It also complains when I tried about:blank saying the url must start with http:// etc.
Use Nothing keyword in iif expression as false part. If Nothing is specified for Action than no link will be created.
=iif(YOUR_CONDITION, "Other Report", Nothing)
An action isn't dynamic so there's no way to turn it on and off based on a condition. But the expression you use to open another report can use an expression - whether you are using jump to report or the jump to URL action. One thing you might consider is for the condition when you don't want to jump to the other report is to jump to the same report. That is, let's say you are on Report A and you want to jump to Report B only when number > x. Then you use the expression:
=iif(number > x, "Report B", "Report A")
Report A will be cached so the net effect is that you didn't click even though the user can see the cursor change to a hand and can in fact execute a click.