Conditional execution of activities - cadence-workflow

Does Cadence support conditional activities? My use case is a Workflow with multiple activities. Some activities have a condition that relies on the output of the preceding activities.

For this particular question, using if condition in workflow code on activity result to decide next activity should work.

Related

Stop ADF pipeline execution if there is no data

I must stop the execution of an adf pipeline if there is no data in a table, but this should not generate an error, it should only stop the execution, is this possible?
You can use if activity wherein 1st validate whether there is any data in table, if yes then use other activities within True case else do nothing.
It would exit without any issues

Can we call the pipeline in parallel and have multiple instances running?

I have a scenario where I have to execute a pipeline from different pipelines to log the validations.
So I'm planning to have a single pipeline for all the validations (like counts, duplicates, count drops etc..) and this pipeline should be trigger when a particular table execution completes.
for example: There are two pipelines P1 & P2 which both invokes this validation pipeline upon completion. so there is a chance that this validation pipeline may trigger twice at same time.
can we run a pipeline like this? is there any lock will applied automatically?
You can reuse a pipeline which acts as generic pipeline in other pipelines and call them parallelly and there is no lock aspect.
Just that make sure the generic pipeline is allowed parallel executions else it would be in queue

Multiple statements in a before update trigger vs multiple before update triggers

I am using before update triggers to enforce some complex business rules.
One trigger has three separate checks, each running its own query.
Is this best implemented using:
a) a single before update trigger containing all three querys
b) three separate before update triggers each containing a single query
If all checks inside triggers are connected with business rules, then one trigger gives better (more redadable) structure of checks, better control over checks order, trigger can be terminated with error in any time without processing all checks, additionaly there is always place to reuse some information obtained during check in next one.
The same functionality can be achieved with multiple triggers, but execution order of those triggers may be not so obvious.
According to Documentation
If multiple triggers of the same kind are defined for the same event,
they will be fired in alphabetical order by name.
It' s worth mentioning, that placing complex business rules inside triggers is not recommended approach.

run azure pipeline task as per dynamic conditions

Can we run task of azure pipeline as per dynamic condition?
Actually i want to run some of the task from the listed task, and every time choice of the task to run maybe different as per user requirement.
For your issue,I think you can set conditions through Control Options in task to control the run of task. If this does not meet your needs, you can give a specific example, so that I can better understand your request.
Inside the Control Options of each task you can specify the conditions under which the task will run.
If the built-in conditions don't meet your needs, then you can specify custom conditions
Conditions are written as expressions. The agent evaluates the expression beginning with the innermost function and works its way out. The final result is a boolean value that determines if the task should run or not. See the expressions topic for a full guide to the syntax.
Here is a document provided some examples,you can refer to it.

Workflow Scheduling in WF4

I have 7 workflow that need to execute; that need to run in certain order ? Is there any scheduling service for this in wf4 or any other approach i can use?
Ocean
If you need to run them sequentially in a certain order, why not just create another workflow and put all 7 of your workflows as activities in a top sequential activity?
If you create an activity that derives fron NativeActivity you can schedule child activities in any order you like. That is the closest thing to a "SchedulerService" I can think of.
However you have to know the activites you want to run at compile time. You can only arrange the order differently using this approach.
If you don't know which activities you want to use at compile time you could use a parent/child technique I showed on my blog WF4 How To Invoke a Child Workflow as XAML