Article
Tani Frankel · May 23 1m read

Interoperability Business Process (Less) Known Limitation (which could cause a difficult to interpret error)

Some of you might not be aware of this "Known Issue/Limitation" when defining a BPL-based Business Process.

And those who are not might have encountered this (somewhat "unpleasant" error):

ERROR <Ens>ErrBPTerminated: Terminating BP <my_process_name> # due to error:

ERROR #7201: Datatype value 'xxS6xxS6...xxS6' length longer than MAXLEN allowed of 50

And/or:

ERROR #5802: Datatype validation failed on property '<my_process_class>.Thread1:%HandlerStack', with value equal to "xxS6xxS6...xxS6"

Here is the information from the docs:

BPL Scope within Loop Restriction

Under certain conditions, loops that contain scopes and have a large number of repetitions can cause an error. If possible, define the scope so that it includes the loop rather than being defined inside of the loop.

So if you have a loop inside a BPL, and you put a scope into it (and probably a 'Continue' activity), and you have say about 15 or more iterations, you will run into the error above.

Here's an example of this kind of loop -

 

And this is what the error would look like:

 

The remedy, as mentioned in the docs, is to place the loop within the scope, instead of the scope within the loop.

I hope this might help anyone who encounters this error... 

00
1 0 6 81
Log in or sign up to continue

Thanks, this is useful information. I have encountered this bug in the past, but did not have the time to figure out exactly what triggered it, and restructured my code.

It would be nice if this bug was fixed, though.

I'm happy to hear this has helped you Gertjan shed some light on the behavior you were experiencing.

Please note that this is not considered as a "bug" though, but rather as a (documented) "limitation".

And, as documented, and as you seem to indicate about your case, it is not too difficult to avoid/workaround.

Since I just came across already the 3rd customer of mine that has encountered this phenomena I figured I'd share what the manifestation of this limitation looks like, for the benefit of saving some time for the next person who runs into it, and "scratches their head" when they face that error, probably not immediately correlating it to the known issue I pointed out.

Note also (as this might have been your thread of thought, or of others who read through this), the issue here is not the simple technicality of the 50 character length limit of the related Property (which happens to be the call-stack of fault-handlers of a BP; as indicated in the error message; which I assume you could simply suggest extending to a larger capacity), but rather this is a "pointer" or an "opportunity" to raise the fact that this "design" or "structure" is not the "recommended" or "best practice" construct for a BP (to have a scope inside a loop).

So thanks also for the chance of clarifying this side of the topic.

Actually, on closer examination, it appears that in your example the problem is that the Continue is inside the Scope. If you move it outside the Scope, the problem doesn't occur (as you noted). The cause is that the fault handler that was pushed on the stack for the Scope is not removed, because the Scope is not exited "normally". Therefore, each iteration adds a fault handler to the stack that is never removed.

Having one or more scopes in a loop is a perfectly normal thing to do, if you want fine-grained error handling and/or recovery. I have just done some tests, and they work perfectly. If "best practice" dictates that this should not be done, "best practice" is wrong. A Continue inside a Scope, however, is never needed (even if perhaps convenient sometimes).

Unfortunately, I don't remember exactly what I did when I ran into my handler stack issue (it's been a while). Perhaps I also did a Continue inside a Scope. In that case, it was a bug on my part.

Perhaps this can be better documented? The description of the limitation you quoted above is rather vague. Even better would be if the compiler recognized this construct, and removed as many fault handlers from the stack as were pushed on it, when it encounters a Continue inside a Scope in a loop.

Thanks again Gertjan, your feedback continues to help refining the correct messaging on this.

Indeed I believe the wording in the documentation is, as you put it, "vague", on purpose - "Under certain conditions". The Continue I used to "trigger" the error (as you noticed, and reproduced) is "part of the picture" but not the whole picture, therefore instead of diving too deep into what is the exact sequence of events that might cause this (I tried not to either, just provided an example...), the reference is more "general".

I think also you arrived yourself at the understanding of what I was referring to when I said "not the best practice" when you mentioned - "A Continue inside a Scope, however, is never needed ... Perhaps I also did a Continue inside a Scope. In that case, it was a bug on my part."

So are scopes insides loops "totally forbidden"? No... the Documentation did not state that, just "Under certain conditions".

But - if someone encounters the error I pointed out - I hope they come to realize it's root cause is this structure, and that they have a direction for avoiding it (and probably arriving at a better flow as a consequence).

Now perhaps you are saying - well, instead of taking the scope out of the loop, just get rid of the Continue, that would really depend on the use-case, on the specifics of the process being implemented. Also, different people have different opinions on the "best way" to handle errors (in general in code; I've seen in another discussion you had some strong opinions about Try/Catch in code; and specifically using this mechanism within a BP), and some might argue that one general Scope for the whole BP is enough (or better) rather than having multiple ones in separate parts of the BP. But I think that's a topic for a different discussion... wink

Just a quick response to your "topic for a different discussion", as it is relevant in this one. A Scope inside the loop allows one to examine the exact error, and if it is not fatal, decide to handle/ignore it and continue with the next iteration. A Scope outside the loop makes this a lot harder.

What BPL structure shows the problem solution most clearly depends on the problem and sometimes, as you note, on personal preference. It is therefore important to specify exactly which conditions are not supported, rather than "certain conditions". This allows the programmer to choose the easiest and/or clearest solution path, and not have to worry about things breaking if iterations exceed a certain (unspecified) number.

To purposefully withhold that information, as you suggest the documentation does, is saddening.

As for the general "Business Process Scope Designing" topic I think we are in agreement that this would depend on the needs of the particular process, and on the preferences of the implementer.

I do want to respond though on the topic of what information is provided as part of our Documentation, and your thoughts on that.

First, I will let my colleagues from Documentation comment on whether they feel there is room to improve and provide clearer details about these "conditions" (and my colleagues in Product Management and/or Development to comment about the ideas you raised with regard to how the Compiler could behave differently and how the Stack Handler should/could handle the Continue in these circumstances). In general we always strive to improve, and I'm sure people who have been with us over the years, have seen (and continue to see) serious leaps of improvement in our Documentation over the past few years. Firsthand feedback from the field, like yours, is extremely valuable for us for this kind of improvement.

And from my perspective I would like to mention just two points -

1. "The Documentation Balance" 

When I said "vague - on purpose" I did not mean this of course in any sinister way, as "withholding information", or in a negligent way either. The whole purpose of Documentation is to be helpful, to provide information, and to empower the readers. Not providing information would be naturally counter productive, but, there is more than one way to be counter productive... In providing information there is always a balance we need to keep between delivering information in a way that enables the "Users" to become more efficient and successful in their work, vs. spilling out too much data that might only end up confusing the "User", which would be contrary to the purpose of what we set out doing.

So you might say "certain conditions" is not clear enough, better have said - "a loop with a Scope inside, with a Call inside (or a Delay, or an Alert, or maybe some other such activity), and a Continue (or maybe also some other activity that would have the same effect today, or maybe added in the future, that would have a similar effect) and above 13 iterations (or maybe less or maybe more, if things change a little in the future), etc., etc."

I think this again might come back to some "personal preferences" - some might say - just give me all of the hard facts, I'll make sense of them, and know how to handle them, while others will just get baffled. At the end of the day we need to keep this balance and probably try to have in mind the "common" or "typical" case of "Users".

2. "The Knowledge/Learning Eco-System"

Today our "offering" or "platform" for enabling people to gain knowledge and learn and experience our technology, is made up of much more than just our Documentation. In fact if you look at the top banner of our Documentation, or any one of the "members of the family" I'll mention right away, you'll see they are always "grouped" together: Online Learning, Documentation, Developer Community, Open Exchange, Global Masters and Certification.

Each has it's own characteristics, vibe, nature, audiences and goals, but they all complement each other and create, together, an "eco-system" for the "whole prism" of how one can learn and interact with our technology. Our Documentation nowadays includes links to Posts on the Community, to Videos and Courses in the Online Learning, etc. They are all intertwined. For example the Documentation includes code samples, but if you're looking for more comprehensive, fuller, perhaps closer to real-life, and vibrant samples - you'll probably go to Open Exchange. If you'd want not just a "straight answer" to some question or dilemma, but rather and opinionated one, you'd probably go to the Community. If you'd want an in-depth expert's overview of some topic, again a Community Post would probably be your choice. Etc.

So in this case, in fact by providing your comments to this Post (and our back and forth discussion), you have actually created Gertjan a valuable resource filling in the exact gap you were talking about... The Documentation would contain the basic/general info, and the more detailed information can be found right here in this thread. This is indeed an example of how these resources complement each other, and create the wider picture.

So, again, thank you for this.