Home      Members   Calendar   Who's On

Welcome Guest ( Login | Register )
      

Home » BPM.NET 2009 » BPM.NET 2009 » Workflow expression editor syntax?


Workflow expression editor syntax?Expand / Collapse
Author
Message
Posted Thursday, December 17, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Monday, May 17, 2010
Posts: 20, Visits: 92
I understand that the workflow expression editor is based on C#, but is there a better definition of what it will accept?

I'm attempting to declare a variable in the expression, set that variable value using a substring and then return the value to the script.

I thought it would be something as simple as this (assuming a type of system.string):

Variable.FirstName.Substring(0,1);

But that doesn't work so i tried to create variables first and work with them:

string strFirstName = Variable.FirstName;

string strFinitial = strFirstName.Substring(0,1);

return(strFinitial);

No luck, though.  I also can't find much documentation on using the editor...

Any help is much appreciated.

Thanks,

-Nate 

Post #1715
Posted Thursday, December 17, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Wednesday, February 08, 2012
Posts: 17, Visits: 42
Hi,

You can achieve the scenario by using the below code.

string Name="Sri";string strFinitial = Name.Substring(0,1);return(strFinitial);

Please find the attached document, which contains the screenshot of the same.

Thanks,

Suman.

csn

  Post Attachments 
Refer.doc (285 views, 123.83 KB)

Post #1720
Posted Thursday, December 17, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Monday, May 17, 2010
Posts: 20, Visits: 92
Suman,

Thanks. That code did work. I need to take it one step further. I need to use value from another variable to start with.

You had:
string Name = "Sri";string strFinitial = Name.Substring(0,1);return(strFinitial);

what I need is:

string Name = Variable.FirstName;string strFinitial = Name.Substring(0,1);return(strFinitial);

When I attempt this, I get an error saying the "Cannot implicitly convert type 'object' to 'string'" My workflow variables are already setup as strings so I'm not sure why it errors.

Essentially, I need to start with a value from one variable and grab the first character to assign to the value of a second variable.

Also, I'm curious how you got to the Output screen (the last step in your Word document)? I've never seen that before.

Thanks,
-Nate
Post #1721
Posted Friday, December 18, 2009
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: Sunday, December 27, 2009
Posts: 1, Visits: 11
Hi,

You can achieve this by converting the variable to string type.

string Name = Variable.FirstName.ToString();
string strFinitial = Name.Substring(0,1);return(strFinitial);

Regarding the second question, window which is displaying the variable with value is from BAM reports. When you double click on any instance, process execution of the workflow will be shown. If you click on any activity of the execution view, variable information will be shown in that.

Regards,

PKumar

Post #1723
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
-
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.

All times are GMT -5:00, Time now is 5:58am

 
Execution: 0.125.15 queries.Compression Enabled.

Copyright © 2002 - 2009 Skelta Software. All rights reserved. Tel: 1 (678) 306 4110 | Email:sales@skelta.com
Skelta - A BPM Workflow Software Company