Adding functions to Nintex Workflows with XLST transformations

Document created by Fernando Hunth Champion on Mar 22, 2015Last modified by Fernando Hunth Champion on Feb 7, 2016
Version 2Show Document
  • View in full screen mode

Introduction

 

I saw an answer on Nintex Community ( Re: Workflow Number Formatting  )  about how to solve number formatting

One of the replies from Manfred Lauer was about solving it with XSLT using the "Query XML" action.

 

That reply inspired me to start writing about all xlst formulas that can be used in Nintex Workflow and currently are not available as inline functions.

 

I will write some different post with differents formulas and will update this document with all formulas and samples.

 

First sample

 

Formula: SUM

The first sample is for calculating the Sum of some values

 

Workflow

So let's start configuring the action named "Query XML"

 

I left the result on the workflow history, where magically we can see the calculated result

 

 

 

 

Part 2

 

Now we'll see the following formulas:

 

  • COUNT
  • FLOOR
  • CEILING
  • ROUND
  • AVG

 

Workflow

So let's start configuring the action named "Query XML"

 

 

 

 

 

On the XML I use

 

 

<?xml version='1.0'?>

<root>

  <expenditure>1000</expenditure>

  <expenditure>3000</expenditure>

  <expenditure>2000</expenditure>

</root>

 

On the XSLT I use the following template

 

<?xml version='1.0'?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">

COUNT : <xsl:value-of select='count(//expenditure)'/>

---

FLOOR: <xsl:value-of select='floor(1976.6)'/>

---

CEILING:<xsl:value-of select='ceiling(1976.6)'/>

---

ROUND:<xsl:value-of select='round(1976.6)'/>

---

AVG : <xsl:value-of select=' (sum(//expenditure))  div (count(//expenditure))  '/>

</xsl:template>

</xsl:stylesheet>

 

 

I left the result on the workflow history, where magically we can see the calculated result

 

 

 

Attachments

    Outcomes