Vadim Tabakman

Earlier last year, I was curious about performing some Trigonometry calculations in a Nintex workflow and was wondering how to do it. Out of the box, there didn't really seem to be an easy way to do it.

I have 2 options.

1. Create a custom action that performed them.

2. Build the algorithm into workflow.

Just for kicks I built an approximation algorithm, to give me the result of sin(radians). You are probably asking why? I just wanted to see if I could do it. Note : I found the algorithm here How does the calculator find values of sine This algorithm will give you an approximation of the result of a sine calculation, but for the purposes of the test, it was good enough. Here is the workflow that reproduced the algorithm in using Nintex Workflow :

Download MathSinWorkflow As you can see, this isn't the smallest of workflows, and although I could have made it a little neater using a State Machine, I just chose to do some cut an pasting. The final result is that I did get what I expected, which is an approximation of the calculation for a trigonometric sin operation. Then came the release of Build 10906 of Nintex Workflow (I think it was 10906. Maybe it was 10903.. don't think is matters now), and the Workflow team implemented In-line Functions. These are a great way of extending Nintex Workflow, and are completely underutilized. Having come from development background, I decided to add 3 new In-line functions. The best part is, I didn't even have to do any coding.

1. Open SQL Management Studio

2. Navigate to the NW2007DB database 3.

Open the "String Functions"

4. Add the following 3 lines to give you Sin, Cos and Tan functionality

5.

6. Actually, it's preferable not to add the inline function to Nintex Workflow using the NWAdmin.exe command line tool.  It has a -o AddInlineFunction operation, so you don't have to directly manipulate the Nintex Workflow database.

You will now have the following In-line Functions available to you : fn-Sin, fn-Cos, and fn-Tan. This is strictly using the .Net Math class, and I knew that they have Sin, Cos and Tan functions that we could utilize. .System.Math Methods This opens up Nintex Workflow to many possibilities. If .Net does not already have the class and method that you need to use, then it wouldn't be too hard to make an assembly that exposes that functionality. You would need to make sure it's deployed to all WFE's and probably Application Servers as well, but it's much easier and quicker than building a complex workflow or even

developing a custom Workflow Action. Taking this into account, my workflow have now changed to this : Download MathSinInlineWorkflow

Vast improvement from ~39 actions to 3 actions. So although when you design your workflow, it might look extremely complicated at the start, over time, as you get a better feel for Nintex Workflow, you will find that there are some interesting way of improving your workflow design for quicker design, and easier maintenance in the future.

Posted by Vadim Tabakman Friday, December 16, 2011 8:57:00 AM Categories: Inline Functions Math Calculations Nintex Nintex Workflow
Copyright Vadim Tabakman
Rate this Content 0 Votes

Comments

Friday, February 22, 2013 6:23:07 AM
Ajith

re: Nintex Workflow - Trigonometry (why?....why not?)

Hi,

really intresting...but is it ok to make modifications to the (Nintex) database directly? Or did I got something wrong here?

Friday, February 22, 2013 6:53:43 AM

re: Nintex Workflow - Trigonometry (why?....why not?)

Hi Ajith,

as per the SDK, you can add your own inline functions to Nintex Workflow to enhance it.

cheers,

Vadim

Friday, February 22, 2013 6:58:23 AM

re: Nintex Workflow - Trigonometry (why?....why not?)

Hey Ajith,

Actually, it's preferable to add the inline function to Nintex Workflow using the NWAdmin.exe command line tool.  It has a -o AddInlineFunction operation, so you don't have to directly manipulate the Nintex Workflow database.

cheers,

Vadim

Tuesday, January 21, 2014 4:59:10 AM
Shardul Pasare

re: Nintex Workflow - Trigonometry (why?....why not?)

Hi,

Is it possible to deploy inline function using Visual studio (without using  NWAdmin.exe)

Thanks in advance.

 

Shadul Pasare

Tuesday, January 21, 2014 7:26:23 AM

re: Nintex Workflow - Trigonometry (why?....why not?)

Hi Shardul,

I believe all it is doing is adding a record to the StringFunctions table in the Nintex Workflow database, but I would suggest you email support at nintex dot com and see if talking directly to the Nintex Workflow database is a valid way of doing this.

cheers,

Vadim

Wednesday, January 22, 2014 2:26:14 AM
Shardul

Inline Deployment

Hi Vadim,

            Thank you for your reply.

             Also is there any way to modify parameters for already deployed inline function.

             e.g. I have deployed some inline function "TrimStart". Now I want to modify name for this inline function or want to modify description. how it can be achieved.

Thanks,

Shardul

 

Wednesday, January 22, 2014 8:25:41 AM

re: Nintex Workflow - Trigonometry (why?....why not?)

Hi Shardul,

I think the only way would be to remove the Inline Function and add it back to Nintex Workflow with NWAdmin or manipulate the StringFunctions table.

If you do this, make sure you go an update any workflow that is using the Inline Function.

cheers,

Vadim

Thursday, January 23, 2014 3:04:28 AM
Shardul

re: Nintex Workflow - Trigonometry (why?....why not?)

Thank you Vadim for your help.

Thanks,

Shardul

 

You must sign in to this site to post comments.
Already Registered?
Sign In
Not Yet Registered?
Register

Statistics

  • Entries (279)
  • Comments (1769)

Categories