Author |
Message |
|
|
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
|
I am trying to create a simple expression on the output mapping on the start event for my workflow. But no matter what I try I get invalid expression. I figured, toLowerCase would be the most simple but I still get an error. Below is the expression.
RossEvent["reason"].toLowerCase()
All I did was double click on the mapping line then click to lower and then validate and I get an error. What is CD expecting me to add?
|
|
|
|
|
DipeshGandhi2
Joined: Nov 14, 2011
Messages: 35
Offline
|
Does your mapping data type match? E.g. String link to String. Also, where do you see the error and what is the error? Is it when you validate the expression in Expression Box? I am using GA beta release and I was able to successfully validate toUpperCase() and toLowerCase(). Please see attached screenshot. You can also see that 'myName' String is linked to String datatype in screenshot.
|
Dipesh Gandhi Software Engineer, Avaya DevConnect |
|
|
|
|
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
|
Please see the attached screen shot. Yes GA. The sharedga server at https://workflow-sharedga-sec.avaya.com/services/CollabDesigner//index.html
both are string and it just says invalid expression.
|
|
|
|
|
DipeshGandhi2
Joined: Nov 14, 2011
Messages: 35
Offline
|
You screenshot shows expression is valid.
|
Dipesh Gandhi Software Engineer, Avaya DevConnect |
|
|
|
|
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
|
You are right, brain fart, out in the sun too long :shock:
What is wrong with this expression?
RossEvent["reason"].split(";")
|
|
|
|
|
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
|
What I really want to do is given a string "abc;def;ghi" pick off the first value. This expression seem correct
RossEvent["reason"].split(";").slice(0, 1)
I am guessing in my previous post that array of string is not compatible with string.
|
|
|
|
|
DipeshGandhi2
Joined: Nov 14, 2011
Messages: 35
Offline
|
This will work..
RossEvent["reason"].substring(0, RossEvent["reason"].indexOf(";", 0))
First get index of first occurrence of ";". Then get substring to the index from first expression.
|
Dipesh Gandhi Software Engineer, Avaya DevConnect |
|
|
|
|
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
|
Thanks yes that would work. What I am hoping to do is to be able to pull apart the string and get the first, second and third sections.
RossEvent["reason"].split(";").slice(0, 1)
RossEvent["reason"].split(";").slice(1, 2)
RossEvent["reason"].split(";").slice(3, 4)
So the index of would not work unless the expression gets really crazy
RossEvent["reason"].substring(0, RossEvent["reason"].indexOf(";", 0))
RossEvent["reason"].substring(0, RossEvent["reason"].indexOf(";", RossEvent["reason"].indexOf(";", 0)+1))
...
...
...
|
|
|
|
|
DipeshGandhi2
Joined: Nov 14, 2011
Messages: 35
Offline
|
Understood.. You are almost there, append toString() and it should work..
RossEvent["reason"].split(";").slice(0, 1).toString()
RossEvent["reason"].split(";").slice(1, 2).toString()
RossEvent["reason"].split(";").slice(3, 4).toString()
|
Dipesh Gandhi Software Engineer, Avaya DevConnect |
|
|