How to update an input field in cincom smalltalk - smalltalk

When an input field depends on a real-time operation it fails to update after setting its new value
i.e.
inputfield1 setValue: 'state2'.
It seems like it awaits a screen refresher in order to do that.
So the question is, what does it take to update the display of an input field if the software sets the new value as oppose to the user?

Figured it out, I had to set the value by directly assigning to it as oppose to using the method setValue
inputfield1 value: 'state2'.

Related

Setting up multiple schedules for a ResourcePool

I am doing a simulation of a production line, which is built through Excel.
Now there is one, which needs free setting of worker shifts for each machine, three shifts in total.
My idea is to create three different Schedules, representing each of the three shifts, and then in the ResourcePool, use the If statement to set up the use of each shift. As shown in the picture enter image description here
But it didn't work. If it is possable, Could you please tell me if there is something wrong with the Java statement or the idea is wrong.
If possible, could you please tell me how to set multiple schedules in ResourcePool?
Additions to the question:
The model is to do the evaluation of the production system and the shift of the workers is an important evaluation parameter. What I want to do is to enter the shift of the workers directly in the Excel sheet and ResourcePool recognizes and uses the corresponding Schedule.
I tried to generate the corresponding Schedule by code, but the Schedule of Resourcepool cannot be set dynamically. So I would like to try to manually input multiple Schedules into the model and then set the corresponding Schedule in ResourcePool by If statement like the image.
Thanks in advance
The first thing you need to know is that the location where you placed the code is a static parameter, thus it is only evaluated once, when the object is created and not checked continuously.
This is indicated by the little popup when you hover over the button that change the entry field from code to value
If it was dynamic it would state Dynamic Value instead of Static Value
Secondly, inside that field you must use a ternary operator, not an if statement, so that the result of the formula is a scheduled object, else you will get a "misplaced construct(s)" error
If you changed the code to
v_Shift == "Shift1" ?
s_Shift1 : v_Shift == "Shift2" ? s_Shift2 : s_Shift3
It will work BUT:
It will only be evaluated when the object is created and not again
Rather not use == on Strings, always use .equals(), on Strings it might work, and sometimes it might not. You can do some research as to why ;-)
Solution: You will have to use a function to change the schedule of the resource pool. Call this function whenever the v_Shift variable changes

How to keep initial value of a field after POST is done

I have an Oracle Forms app. There is a form with a date field and I need to keep it initial value (when form is loaded), to compare it with actual value in the field. Also there is a button on the form, that posts changes.
I've tried to store initial value with global variable and check if it's changed, also I've tried to simply check that :system.record_status != 'QUERY' to track if date is modified.
Problem that at the moment, when button is pressed and post is done the values of all global variables become null, so I can't compare the initial value with the new one and :system.record_status becomes 'QUERY' again, and I don't see any more if user modified something.
How to keep the initial values or track that data was changed, doesn't matter if user posts changes or not?
This:
Problem that at the moment, when button is pressed and post is done the values of all global variables become null, so I can't compare the initial value with the new one
doesn't work that way. Post (if you refer to POST built-in) (nor COMMIT, as we're at it) doesn't clear global variables. Explicitly setting it to NULL does, so - check the form whether you've done it somewhere in your code. How? Run the form in debug mode, trace its execution and see what's going on.
Another thing that might be going wrong is that global variables's datatype is CHAR so - if you plan to compare it to a different datatype value, you should perform conversion. As it is a date value, consider applying TO_DATE function to the global variable with appropriate format mask.
this will work:
IF GET_ITEM_PROPERTY(:SYSTEM.CURSOR_ITEM,UPDATE_COLUMN) ='TRUE' THEN
Copy(Get_Item_Property(itm, Database_Value), :System.Cursor_Item);

SSIS Logging of OnVariableValueChanged with variable value

I am trying to log all changes in variable values in a SSIS generated with BIML.
I managed to create an event handler that writes everytime a variable changes its value.
When I log I use a parameter whose value I set to "System.VariableValue". I pass this parameter (togheter with variableName and PackageName) to a StoredProc and i write in a log table.
My problem is that often (but NOT always) it seems the parameter does not has any value. I see a new line in the DB Log table so this means the evnt is correctly raised and handled BUT it seems the parameter is empty.
The strangest thing is that sometimes values are logged correctly but not always, not for the same variables, not for the same packages, rather, in a quite random fashion.
Could it be a problem the fact that several variables could change value almost at the same time (some contention on the DB) ? I doubt it, because the row itself gets written on the DB. I even tried to write, as a value, something like 'New value = ' + ? that is, appending the parameter value to a fixed string. The fixed part gets written correctly but.. no value.
The name of the variable that changed value is always written correctly.
Any idea what this could be due to?
As a workaround I tried to use the ready-made logging facility of SSIS but in this case in the message column of the SYSSSISLOG table i can just read the name of the variable that changed, not its new value.
thankx
You could use Event Handler to do that. Go to the Variables page, go to Variable Grid Options, check Raise event when variable value changes, and there should be one more option appear for those variables, which is Raise Change Event, default to False, change to True for those variables that you need to track the changes (log). And put a logging task into Event handler
UPDATE
the new line could be the value of parameter has been reset, and that value, most likely equal to blank or whitespace, but still, that is recognized as value change.
if you are not very sure when that happened, you could set a Breakpoint to certain task and add watch window to see how the value change or whether the value will hit blank in the middle of your process

Confused with the "updates context keys with" feature..

do I need to define the key that gets updated with the new asnwer from the user, or do I set the condition that I need to be satisfied to proceed? The explainer on the right says both: Describe the context keys that will be updated by your action and if you need more than one condition to be met, you can use '&&' etc etc..
Can anyone explain this feature functionality better? thanks
I also had confusions in understanding the context part, but later figured it out.
Let me try to explain the way I understood.
In a story you want some actions to be executed and also you want your actions to return some result or rather I would say, you want some variables to be set with some value within your action that you will use in the next step of your conversation in wit.ai. Those variables can be defined in wit.ai as context keys.
Below is an example:
I have a credit card and I want to report lost card using bot. I say I lost my credit card and give the bot required information for it to fetch my card details, then it will call an action BlockCard. As a result of execution, I need the name, last 4 digits of the card and reference number for the raised complaint. These 3 variables need to be filled in while the action BlockCard runs. These are declared in wit.ai as context keys with '&&'. I would use these variables in the further conversation.
Note: You need to make sure that the name of context keys and name of the actions declared in wit.ai and the names used in your code are same.
Have a look at wit story:
https://wit.ai/Nayana-Manchi/CreditCardApp/stories/f7d77d9e-e993-428f-a75e-2e86f0e73cb3

Filling parameter with value from Zeconfig_var table

I have the following selection parameter:
PARAMETERS: p_ver(2) AS LISTBOX VISIBLE LENGTH 5.
I would like to populate it with the results from a ZECONFIG_VAR table.
At what point would I do this. Selection Screen Output, Start of Selection, or other. I am trying to allow users the ability to decide what version of the web service they would like to call. The config table will have different url's for the different versions.
I have looked at this Answer and the tutorial provided does not make sense to me.
I would do it at the event INITIALIZATION
However, it may be even easier to just create a search-help, and assign it to p_ver using the following:
parameters: p_ver(2) visible lenghth 5 MATCHCODE OBJECT zshelpname.
Esti is right that you probably want to fill an internal table from the DB table during INITIALIZATION.
But to the populate the listbox parameter, you need to put the call to VRM_SET_VALUES in AT SELECTION-SCREEN OUTPUT.