fsupriya3
Scholar

How to build complex expressions in K2 Five

Hi Team,

 

Can someone please help to understand how we can build the complex line rules of K2 4.7 in K2 Five.

The AND operator is used between condition 1 and condition 2. However, condition 2 is having many sub/group conditions with AND, Or, Not etc. along with the Data fields. Tried with set variable etc but unable to achieve it. Not sure if need to get a smartobject created or custom .net code wriiten.

 

Kindly, suggest on it.

 

Regards,

Supriya

Labels: (1)
0 Kudos
Reply
8 Replies
fsupriya3
Scholar

Re: How to build complex expressions in K2 Five

Hi,

 

Can someone please help me with my question.

 

0 Kudos
Reply
Vernon
Moderator
Moderator

Re: How to build complex expressions in K2 Five

When referring to 4.7 I gather that you used the Thick Client designers (K2 Studio / VS). I think in the HTML Designer you can achieve the desired results using Decision steps with customer rules.

 

https://help.nintex.com/en-US/k2five/userguide/Current/default.htm#K2-Workflow-Designer/Use/Toolbox/...

 

HTH

Vernon

  

0 Kudos
Reply
fsupriya3
Scholar

Re: How to build complex expressions in K2 Five

Hi Vernon, 

 

But within decision step, how to achieve conditions with multiple AND, OR, group conditions etc.

Data fields are used.

 

For example:

Isvalid = True
And
(City = 'LV' And Not IsPass And Not IsFail) Or (City = 'AL' And Not IsPass And IsFail) Or ((City = 'NW' And IsPass And Not IsFail) And Not IsDuplicate)

 

Kindly, let me know in case of any question.

 

Thanks and Regards,

Supriya Funde

0 Kudos
Reply
khanh
Nintex Employee
Nintex Employee

Re: How to build complex expressions in K2 Five

Hi fsupriya3,

 

Perhaps a different approach to this is to break down the expression into smaller subsets. First, I would have a IsValid path decision. From there, it can go to each destination (i.e. City is LV, City is NW, etc..)

 

Image 595.png

 

0 Kudos
Reply
fsupriya3
Scholar

Re: How to build complex expressions in K2 Five

Hi Khanh,

 

Thanks for your response.

However, if a K2 4.7 activity have multiple outcomes with different condition on each line rule in that case I think this implementation with K2 Five will not be feasible because as per my knowledge so many decisions will not help to achieve the requirement. Also, it will be difficult to compare the complete result of a single query with True or false.

I am thinking if I can achieve that logic on Split by creating the variable. There are approx. 6-7 criteria's which are using such type of conditions.

Attached, one of the actual condition and there are many more which uses same type of conditions including data fields with different criteria's.

 

Could you please suggest.

 

Thanks and Regards,

Supriya Funde

 

0 Kudos
Reply
fsupriya3
Scholar

Re: How to build complex expressions in K2 Five

Hi Khanh,

 

Kindly, suggest on this.

 

Regards,

Supriya

0 Kudos
Reply
quiz
Scholar

Re: How to build complex expressions in K2 Five

Hey @fsupriya3 ,

I've never used 4.7 but on 5.5 we are able to do AND, OR, and GROUPINGS within the decision node. In order to achieve this, drag and drop the "condition" node at the bottom of the decision designer on top of the existing "IF" statement. After doing this, it will create a grouped AND condition within the IF statement. You should be able to do this as much as you want.

 

presend2_0-1631738991739.png

 

Hopefully this helps.

 

Peter

 

0 Kudos
Reply
paulk
Novice

Re: How to build complex expressions in K2 Five

If your data is stored in a database then I would suggest you use a Stored Procedure to determine the status and return a simplified value back to the WF and make the routing decisions based on that.

 

That is one complicated expression - the logic of it should probably be revisited and simplified where possible. E.g. make a partial assessment of some conditions then move on to another evaluation step and take other routes based on other parts of the data used in that expression.

 

Cheers

0 Kudos
Reply