Element Exist Condition Check

Hi, I want to check the condition, In the left I want to continue and in the Right I just Email and stopped the process.
But I want to implement in the State Machine how do I implement this.
If element found then I want to continue the process if not then just informed by email and stopped the prcoess. Please help.
@Palaniyappan @lakshman

1 Like

Call a workflow in the left and right side with invoke workflow and continue with a process
Keep this if condition in a state machine
You were almost done
Cheers @balkishan

1 Like

Fine to stop a process
In the Else part out a assign activity and mention like
SystemError = “no element exists”
And in right side that is Then part mention like this
SystemError = “element exists”

Now in transition mention like if
SystemError = “no element exists”
Then it will go to one state
Or it will go to another state
But decide whether to use a state or final state based on the next process

Cheers @balkishan

Okay bro you meant to say call the workflow which I want to continue in the left side Then part. And call the Email Workflow in the Right Side of If Condition. Right?
So I want to stop it also bro.
Just I am confused with the condition.
So I have to create another boolean var in the main state machine workflow is it right?

1 Like


1 Like

Hi @balkishan

What you can do here is create a separate workflow for this one.
Then in the Process.xaml file, invoke the workflow.
You should have an Out argument for the IsElementExist

Then in Process.xaml, right after you invoke a workflow, add a Flow Decision.
Use the Out argument from the invoked workflow as the condition.
If it is true, then it will continue. If not, invoke a workflow in the right side of the Flow Decision that will send an email.

That’s all. :slight_smile:

THanks and regards :slight_smile:


SystemError = True/False ??? Right ?

1 Like

I have to used in a State Machine bro.

@Palaniyappan @Jan_Brian_Despi

1 Like

Yah good

That rights you are going good
Any issues
Mention the SystemError in transition as a condition
Cheers @balkishan

1 Like

In the else part I have to assign a activity.
But I have to used Try Catch also bro?

Yes of course include that activity inside a try catch block within ELse part
Cheers @balkishan

SystemError should be an Exception type right If I am not wrong? Will it check the boolean condition also? As our ExistElement is a boolean type.

See the main thing is
In the first state checking
You will be having the if condition and in the THEN part include a writeline as you did before and mention a assign activity with SystemError a Boolean variable with value as True. You can also include other activities and keep all of them inside a try catch block
While in Else part same all in a try catch block and mention the writeline and followed by a assign activity with a SystemError a booelan variable of value False
—Now in transition mention the value SystemError = True then got to one state or go to another state

Simple isn’t it
Cheers @balkishan

1 Like

Activity include inside a Try Catch block within Else Part?
sorry bro not getting you.

1 Like

Fine kindly have a look in this
— in the first state do you have the condition…?
If so in the first state itself use a try catch block and put the element exists inside the try block and use a if condition also followed by that
— in the if condition mention the condition we want and in the THEN part put a assign activity like this
SystemError = True and in ELSE part mention like this SystemError = False

Now in the transition that we are going to connect from the state checked to other states
Mention the condition like
SystemError = True Means go to one state or
Go to another state with condition
SystemError = False

Simple @balkishan

1 Like

Bro but the workflow we will invoke here na?

so how can I assign this activity here like SystemError = True, and so on…

sorryn bro I am little bit confused here.

I have like this bro.

In the first Checking I have like this.

Ok so you have that as a separate workflow…
If so create SystemError as a argument inside that workflow and get that as a Out argument so that we can use that in transition

Cheers @balkishan

1 Like

yes, That’s way I was trying to say bro. Because I have all separate workflow.
And I have to use the Try Catch also.

1 Like