Syntax statements in CodeWorkflows

Build 1501 on 14/Nov/2017  This topic last edited on: 26/Aug/2014, at 11:55

Here are some notes to keep in mind about the CodeWorkflow syntax (examples of these points are in other paragraphs of this document).

In VB.NET we use the XElement and XDocument classes to write/read the xml (here more info about their syntax: http://msdn.microsoft.com/en-us/library/bb384460.aspx). While in the old WidowsWorkflows we have to write the xml pieces out of the workflow at the bottom of the ‘wf_...’ file, in CodeWorkflows the XElement class allow us to write xml tags directly into the code. Moreover, we can embed the value of variables into the xml using the “<%= … %>” syntax.

VB.NET provides a way to manage the runtime exceptions: the Try...Catch… statement. This statement surrounds a piece of code: if an error occurs, the exception object is passed to the Catch code, where the exception can be managed as needed. Here more information about the Try…Catch… statement: http://msdn.microsoft.com/en-us/library/fk6t46tz.aspx

In old WindowsWorkflows, the conversion from a number id (12345) to its string representation (‘obj12345’) and other similar conversions are applied into the xslt stylesheet by the extension methods (namespace xmlns:fn="http://www.teradp.com/schemas/GN4/1/Xslt"). These utility methods are available also into the CodeWorkflows: they are in the Context.XsltExtensions property.

To access the data of the current user you can use the Context.LoginContext property.