Random Compiler errors "The expression that you have entered is not valid."

This was a very interesting bug that came up during the holidays; yeap we were busy troubleshooting over Christmas :).

The issue was very intermittant and hard to repro (as always) and we had to resort to multiple iterations with the customer and support team just to get a complete understanding of the problem.  The OD throws compile errors randomly and a error {!} sign is shown next to the expression shape. When you open the Expression shape, you find that parts of some messages are underlined by red marks to indicate that the parts are missing type references.

Let’s say there are two orchestrations inside the same project with namespaces as “A.B” and “A.B.C”. OD (Orchestration designer) adds these as the modules (BTSModule) to the XLANG compiler. Each module is supposed to create a scope so BTSModule creates a new scope symbol for the last name of the namespace and replaces the existing ones if any with the new one.

So now consider a scenario where “A.B.C” is added first, so the symbol table is populated with a tree which looks like A -> B -> C (-> is used for better presentation). Where ‘C’ is a scope symbol. Now if OD adds “A.B”, then the compiler replaces the existing namespace symbol “B” by new scope symbol B”, while doing so the references to “C” is gone. So now the tree looks like A->B.

But later when we are adding the message types in “A.B.C” namespace are succeeding why? BTSModule also in-turn holds the root of the module and uses it while adding the parts. So the types are added to a local symbol not to the one A->B… But later when the expressions are evaluated the actual symbol tree is used causing the failure.

Root cause: It’s to do with the order in which the modules are added to the compiler.
Solution: Modified the OD (Orchestration designer) to create the BTS modules in a sorted manner.

This fix is being released as KB979153 and should be available soon.

- Guru