Welcome to Landmark IPA my friend. Unfortunately, I think you've stumbled upon an all-too-common practice in this agile-development world... where dev teams are so "agile" that they focus only on releasing new features while using their customers as QA, this mentality is what you've stumbled on, not just this silly situation with IPA that defies development logic.
Just wait until you try to use the E4X standard thats in IPA. Or, better yet, wait until you find out that implicit javascript casting doesn't work properly in many situations in IPA 10.1.1.x, or that if you try to test a variable as being undefined, in SOME instances you need to you =="undefined" and in SOME others you need to use == undefined, the same goes for NULL values. Sometimes you can't catch an undefined variable at all - even though you can see the variable in the log.
This starts to make me want to pull my hair out- and then, when you submit the ticket... guess what. It's not a JT, no.... it's an "ENHANCEMENT REQUEST". You know, those requests no one knows how to find to upvote and that no one sees for years?
Yeah, submit one of those.
Or, along these same lines, wait until you try to use the Application Config console and you realize that certain code is only accepted under certain contexts, and that real LPL doesn't work in all the situations, even though it should. or that you can force the ConfigConsole to accept some code that it otherwise wouldn't if you just open and save it really fast.
It makes one's heart grow warm.
Activity started: Assign4940 (Run Id: 2) Evaluating JavaScript expression var a = 1;; to value undefined t1 = (new Number(1)) //I had put in a.toSource()
Geoff Like everything with IPA ( which woozy touched on) you need to know it's quirks.
IPDesigner/IPA has warts, but it's a very powerful solution when you have enough time to figure out those warts and how to work around them. It's a love/hate relationship sometimes.
I use E4X & XML modification extensively and I even do some modification of action request XML-- it can be useful, but it has it's limits, especially in the newer versions. Infor is aware of the issues with E4X and I have no doubt they will be fixing them eventually.
If you use XML/E4X extensively for managing connections with disparate systems, it can work fine IF *IF* IFFFFFFFFFF you first experiment with how and when IPA does NOT follow the specification and where it DOES follow the spec. Sometimes, when you discover how IPA needs to do something, it makes sense in an "IPA way" and you'll get a feel for that.
It's hard for me to accurately describe how you'll eventually understand how the tool works and it's limitations, but I can only say it will be a similar experience to learning any general programming language. You'll have parts where you go "Why in the heck would anything ever do it that way?" and then you'll eventually see some logic in it as you move on.
Also - have you tried defining your JS functions in the start node? I'll check and see if that works to hold the expression..
Ah Woozy,
you beat me to it, I didn't see your response to put it in the start node!
Woozy - you always bring an air of calm common sense to the discussion -- thanks for that
~Peter
If you spend even just a few minutes evaluating even free, open source BPM designers, you'll see that Infor/Lawson are WAY behind the curve on features and user experience. So there really is no excuse for having such horrible products. I know it's a small thing, but one great indicator that the designers at Infor have no idea what coding is about: they don't even use fixed-width fonts in their editor! Not to mention that they don't call their repaint methods (basic Java UI knowledge) when they destroy their graphics and so you end up with lots of screwy graphics glitches. And have you seen the way they structure their log files? Totally inconsistent and haphazard...
Amen to everything you just said.
Sweet! thanks guys! I stored a function in the start node as a string and it didn't work but as a xml type it does. I'll give it a whirl. I figured you'd be able to get great stuff to happen with this tool as it is ultimately javascript and XML. But sometimes I think I'd do better with just a notepad and nodeJS. I wish there was a wiki for how to get powerful, organized, advanced stuff to happen within this loony bin of a tool. thanks again!
Ask and ye shall receive. I'll let you know when I get the wiki started.
Where Assign contains:
Output:
This shows that it it performed as pass by value and that your original value in myInt isn't changed. So if you actually wanted to change the value, you would have to call:
myInt = addOne(myInt);
This has been working for me. I hope it works for you too. If you want to see some much more complex examples of how I've used functions in my flows, see: https://www.lawsonguru.co...ions-in-processflow/