How does SSIS know which variable in an OnVariableValueChanged Event? - ssis

OK, I understand all the whys and wherefores of how to create variables in ssis and that the raise_change_event must be set for the event handler to work. And, I have a SQL task written to insert a record into the SysSSISLog when the event fires.
However, despite all my digging, I can't find where/how the event handle knows WHICH variable changed.
So, it appears to me if you have multiple variables, and anyone of them changes, then the OnVariableValueChange event would fire. This makes no sense and suggests to me that I am missing something incredibly simple.
Could someone please enlighten me? THanks...

When the value of a variable is changed, the OnVariableValueChangedEvent event will only fire if the RaiseChangedEvent property of that variable is set to true (which is false by default). One thing to keep in mind, if the variable contains an expression that relies on another variable, this event will only be raised if the RaiseChangedEvent property of the dependent variable is set to true, and the raised event will only correspond to the dependent variable.

Related

A way to require dbc.Input to receive an updated value before triggering a callback while using debounce?

I have a large, dynamic number of dbc.Inputs (~200) that trigger a callback.
Their id’s use pattern matching callbacks.
The value entered in the input updates a SQL db.
The problem I am facing:
I need to have debounce=True so that every keystroke doesn’t trigger the callback.
However, having debounce=True also makes it so that if the Input is clicked into, and clicked out of without any changes being made, it still triggers the callback.
Is there any way to make it so the callback only triggers if the current value has been changed? I was hoping this could be done within the args of the input itself but did not see any args that would achieve this.

How to set rule in qradar if something does not occur in event payload for some time?

I would like to set rule, if qradar does not find the string in event payload for one week? How can I do it?
I am looking to list of conditions, but I did not find any suitable condition. I have this:
when the event(s) have not been detected by one or more of there log source types for this many seconds
However I think it is not very suitable for me, because I need to work with payload. Could someone help me how to solve this problem?
One approach to resolve this problem is to use reference sets. A concept for this is explained here. You need two rules and a reference set:
Reference Set
Create a reference set and configure the time to live to the duration when the absence should be detected.
Rule 1 (Tracker Rule)
Set up a rule that triggers on the pattern whose absence you want to detect. In your case a string in the payload. Select "Add to a Reference Set" as rule response. Use the reference set from above.
Rule 2 (Watcher Rule)
Create a second rule which triggers on Event Name (or QID) "Reference Data Expiry". Maybe you need a custom event property for the name of the reference set and/or the expired element too. With this CEP you can test for the expiry of the item added from rule 1.

SSIS For Loop does not break out of loop

I have an SSIS package where I am trying to use a For Loop to check a condition (web service response). I have a condition in the EvalExpression within SSIS and I am setting one of the variables in that EvalExpression within a dataflow task that is inside the loop. I am also logging the expression as well as the variables in the expression, and when the EvalExpression should turn false, the loop keeps going. Can someone please explain why that is? Or how can I get the true EvalExpression each iteration.
This is my EvalExpression
(#[User::statusMessageLoop] == 1 && #[User::statusMessageLoopCheck] == 1)
The variable User::statusMessageLoopCheck is set at each iteration of the loop and when I want it to break out of the loop, I set it to 0.
I hope the images below help explain my situation, and thank you all for your input.
for loop properties
conditions under where i want the loop to keep going
break out of the loop when these condition are true
I am assuming you are reading your XML into columns properly and you know how to do that.
Add a script component and select "Transformation"
Add your variable (I am calling mine isTrue) as read-write
Select your column as read on inputs
Enter the script
Add the following code to set your variable
Variables.isTrue = Row.isTrue == true ? 1 : 0;
This is basic if then else logic.
This is how you set a variable using SSIS inherit tools.
If this isn't working, maybe you should check to make sure you are reading the XML properly.
EDIT:
You need an interim variable to hold the test result and then you can set the Package Variable in the post execute. Here is a screen shot of the code:
Sorry about this. I learned this lesson with you. I typically handle all XML and JSON entirely inside C#.
Note that bool test is declared outside of row processing as well.
This assumes you only have one row of processing as well.

MSACCESS, how to edit a record after insert using the "after insert" trigger

MS Office 365 ProPlus, Access 2007 - 2016
I'm trying/failing to change the value of a field in a table after it is inserted using the "after insert" trigger. Something like this...
EditRecord
SetField
Name orig_id
Value = [mytable].[id]
End EditRecord
This doesn't seem to work.
USysApplicationLog gives...
SourceObject = mytable.AfterInsert
DataMacro InstanceID = {489D5697-5247-44A8-AE3C-3773A25F72E5}
Error Number = -20335
Category = Execution
Object Type = Macro
Description = EditRecord failed because the default alias represents a record which is read only.
The field is not read only. After the fact I can edit it just fine. I don't know what the "default alias" is nor what that even means.
If the trigger can't do this, can you think of another way to accomplish the same thing ?
You don't want to use the AfterInsert, since then the record is already saved, and tucked away nicely, and everything you need to change in that record is assumed to have been done. In fact, the default context will cause the record in question to be read only. You CAN get around this by pulling the record again, (looking up a record), but if you modify it again then all of the triggers for that record will fire again.
So I ONLY suggest you use this event to sum() or add/edit OTHER tables, but not the record that was just edited and saved.
If you need/want to update this current record, then move your "edit" or "modify" code to the "BeforeChange". This event not only lets you edit/modify right before the save (and thus preventing endless loops in which the update triggers fire again and again), but the CURRENT record is in full context, and you don't even need any "edit record" command, since you have the fresh un-saved record right in context. You thus can use SetField without the need for EditRecord.
So, the AfterInsert is really too late here, and if you could modify the record in that event, you will cause the AfteUpdate event to fire again if you do use a workaround.
Now, if you use BeforeChange, it will fire for both insert and edits (change). So, if your code really only needs to run when inserting, you can check this status by using
If [isinsert] = True then
Edit
Also, it looks like your code is attempting to save (capture) the previous value, and if it is, then you can use:
[old].[id]
Of course this does not make too much sense for "id", since that is usually an autonumber PK column, but for grabbing other values during an update in the BeforeChange event, you can certainly test + inspect the previous (old) values.

ObservableObject Set method only fires if value is different

This looks like a bug, or at least poor documentation.
The kendo docs state:
set event
Fired when the set method is invoked.
The set event is raised before the field value is updated. Calling the get method from the event handler will return the old value. Calling e.preventDefault will prevent the update of the field and the change event will not be raised.
This dojo demonstrates that the set event is only fired when the set value is different to the existing value.
It would appear to me that, to be more correct, this method should be renamed "PreChange" and a new "Set" method created that actually fires when Set is invoked, as per the documentation.
Am I correct in stating this is a bug, or am I doing something wrong?
I got your point. Don't know if this could be a bug or not...
Just my 2 cents: I feel like it's a choice poor documented.
If you try to set an identical value, it seems the set event doesn't even trigger!
It's similar to the change event... if you write the same value, the event won't trigger.