What kind of expression to be pass to Elsa Javascript expression evaluator? - elsa-workflows

I have tried to pass multiple expressions but none of them is working. Below are some expressions:
1==1
8>3
5<6
if(8 > 4)
Here some screenshots for reference:
Javascript Expression
Javascript Expression Evaluator response

The following expressions you listed will work:
1==1
8>3
5<6
The 4th one will fail, since it's an incomplete expression.
If the expressions you mentioned don't work, it might indicate a bug or some other issue.
I tried to reproduce the expression evaluation with success, so something else might be causing the expressions to fail in your instance. If you open a GitHub issue with repro steps using a clean Elsa project setup and any errors you might be seeing, we will be better equipped to try and help.
PS.
The first screenshot shows an expression of 2+2 which you then try to cast to a boolean. In JavaScript, I think this would result in a truthy value, but I haven't tried to see what happens when Jint (the JavaScript evaluation library Elsa uses) executes this.
The second screenshot doesn't show the expression you tried.
In any case, I recommend cresting a small console application demonstrating the issue.

Related

abap multiple method call

While debugging abap code I found an interessting code construct.
method_name(: Parameter1 ), Parameter2 ).
As far as I can tell this one calls the method twice. The first time with the first parameter and the second time with the second.
Unfortunately I have no idea how this construct is called and so I can't find any documentation in the SAP docu or with google.
I can tell that this works but is this an official construct?
Does it work with more than two parameters? (E.g. four times)
Best regards,
Dirk
Congratulations, you've found an obscure and most certainly discouraged use of a so-called chained statement. Using this for method calls is not recommended, but since it was once allowed, SAP will be very reluctant to remove this again...
When the ABAP compiler finds a colon, it first expands it blindly without any syntax check (expanding A:B,C,D. into A B. A C. A D.).
And only then it analyses the syntax of each of them - to tell whether it is an assignment, method call or whatever. Pavel

Why I got syntax error while I enable strict warning (performance penalty) in Firefox bug?

I have build a website run heavy ajax and I'm really care about performance after I enable Strict warning(performance penalty) in firebug it shown me a lot of warning from system and jquery2.2.3 as below image.
Enabling the option Strict Warnings (performance penalty) means that you will also get JavaScript warnings, which are hints about correct usage, though they may not have any effect on the execution of the code.
Examples for this are already shown in your screenshot, like references to undefined variables or using a single equal sign in a statement, which may be a comparison.
Example causing such messages:
while (item = array[i]) {
...
}
In this case item is not declared via var or let before a value is assigned to it, so you'll get a "reference to undefined property" warning. And an assignment is used within the while condition, which will cause a "test for equality (==) mistyped as assignment (=)?" warning.
jQuery and other libraries make a lot of use of such constructs. That's why you see so many messages related to it.
The logs marked with <System> are coming from browser internal code and can be ignored by you. To see them you must also have Show Chrome Errors or Show Chrome Messages.
Using strict means browser will check many things like if variable is initialized before use. There is no syntax error etc

How ought I run the annotate function in gui-debugger/annotator on a datum?

I am trying to learn how to use the DrRacket debugger's annotate function. My ultimate aim is to build a REPL that you can execute from within a closure and have access to everything that's in scope. (see my previous question on that topic and Greg Hendershott's well-researched answer) For the time being, I'm just trying to explore how the annotate function works. You can see my first exploratory attempt at using it, and the results, here.
The error, which is happing inside of the annotator, seems to arise when it tries to match he application of string-append. The matcher is looking for a #%plain-app and the expanded syntax I'm presenting to it contains an #%app. I'm unsure if I should be expanding the syntax differently so it comes out as a #%plain-app or if there's something else I'm doing wrong to produce the syntax I'm feeding into the annotator. Does anybody see where my error is?
This revision to my previous pasterack post is swallowed without complaint. It seems that the syntax match must take place on a top-level syntax object (ruling out anything that could happen in an expansion phase, like a macro), and expansion must take place with a current namespace attached. There are some more subtleties in the syntax match, particularly around the fact that the syntax object needs to be free-identifier=? to #%plain-app. For all the gory details, refer to the mailing list thread I started.

C++ Builder F1007 Irreducible Expression Tree

I'm using C++ builder XE under Windows 7 pro.
I'm currently stepping through a function and want to inspect the value of some of my variables. There's a character array I've got, local to a function.
char result[80];
When I try to inspect this (with the code paused inside this function), a message pops up :
Error inspecting 'result': F1007 Irreducible expression tree
If I try to add a watch to this variable, it says "???".
Any ideas what could cause this, and what it could mean in this context ?
According to the documentation:
F1007 Irreducible expression tree (C++)
An expression on the indicated line of the source file caused the code generator to be unable to generate code. Avoid using the expression. Notify Embarcadero if an expression consistently reproduces this error.
You are likely encountering a codegen bug and should file a Quality Central ticket to Embarcadero for review.

Evaluate dynamic string as an XPath expression?

Currently, I'm writing something to do Unit testing for XSLT2 functions, the idea is very simple:
Create a custom-library.xsl, which contains some custom XSLT2 functions.
Create a data XML contains the test cases, as following XML Schema xslunit.xsd:
schema structure http://xml.bodz.net/schema/xslunit/xslunit.png
Run the test cases by transform it, using xslunit-xslt2.xsl, and get the test result html.
Now, the question is, there is function-call in the test cases, and I have to evaluate it in the XSLT (file xslunit-xslt2.xsl). But I can't find a way to evaluate an XPath.
Though, it may be easy to using some kind of Java extensions, but I really don't want to bring in another trouble. I hope everything can just work with-in XSLT2 only.
No, pure XSLT 2.0 does not have support do evaluate an XPath expression found in your XML data. Saxon 9 (in its commercial editions) however has an extension function: http://www.saxonica.com/documentation/extensions/functions/evaluate.xml. And AltovaXML Tools has a similar one: http://manual.altova.com/AltovaXML/altovaxmlcommunity/index.html?xextaltova_general.htm
Update a decade later: XSLT 3.0 has an instruction <xsl:evaluate> which evaluates an XPath expression supplied dynamically as a string.

Resources