I only want the Log Error activity to be executed only when any of the set variable activity executes ie: Only when there is an error.But it always executes
Like this
Not sure what is wrong here.How can i configure the pipeline properly so that the Log Error executes only when there is an error.
It doesn’t work that way. You are using two Conditional paths : Success and On Skip. Since you have connected both of them with the Script activity, it would run in one of these scenarios:
Both success
Both Skipped
First Succeeded , second skipped
First Skipped, second succeeded
In all of these conditions, it will run the Script activity according to your configuration.
You can try the below approach instead:
Create a variable on pipeline level: flag .
Set the default value for this variable as : False
Cut the script activity
Paste it inside If activity with condition of validating if Flag==’true’ then run the script activity in True block
Connect the If activity with on completion conditional path
So even if one set variable turns the value of flag to True , the script activity would run after checking the status of flag variable.
I only want the Log Error activity to be executed only when any of the set variable activity executes ie: Only when there is an error.But it always executes
As you are connecting Log Error activity with set variable activity using on skip (grey arrow) which detect if import data is succeeded then set import data activity which id depend on it when import data activity is failed then set import error activity is considered as skipped and it will execute the next dependent activity log error and on success (green arrow) dependency.
On Success (Green arrow) : Activity B only runs if Activity A has a final status of succeeded.
On Failure (Red arrow): Activity B only runs if Activity A has a final status of failed.
On Completeion (Blue arrow): Activity B runs if Activity A has a final status of succeeded or failed
On Skip (grey arrow): Activity B runs if Activity A has a final status of skipped.
For your requirement you only need to connect Log Error activity to set variable activity with On Succes (green arrow) dependency as below:
2
Answers
It doesn’t work that way. You are using two Conditional paths : Success and On Skip. Since you have connected both of them with the Script activity, it would run in one of these scenarios:
In all of these conditions, it will run the Script activity according to your configuration.
You can try the below approach instead:
flag
.False
So even if one set variable turns the value of flag to True , the script activity would run after checking the status of flag variable.
Your solution would look like this:
As you are connecting Log Error activity with set variable activity using
on skip (grey arrow)
which detect if import data is succeeded then set import data activity which id depend on it when import data activity is failed then set import error activity is considered as skipped and it will execute the next dependent activity log error andon success (green arrow)
dependency.For your requirement you only need to connect Log Error activity to set variable activity with On Succes (green arrow) dependency as below: