0 votes
674 views
in IBM BPM Administration by (30.6k points)

1 Answer

0 votes
by (30.6k points)

Infinite loops in BPM show up as either a BPD that never ends (a loop back that always fires) or a service that spins (a JavaScript while that never exits, a service calling itself). How to find them:

  • Instance level: Process Admin > Process Inspector / Process Instances: an instance with thousands of completed steps, or the same activity appearing over and over in the execution tree (GET /rest/bpm/wle/v1/process/{piid}?parts=executionTree). The PDW / Performance data shows the activity count per instance.
  • Event manager: a looping system step keeps re-scheduling itself - Process Admin > Event Manager > Monitor shows a queue that never drains, and event manager tasks that re-appear for the same instance every few seconds.
  • JVM level: a service in a tight loop pins a thread - take three javacores 30 seconds apart (kill -3 <pid> or wsadmin AdminControl.invoke(jvm, 'dumpThreads')) and look for a WebContainer / EM thread that stays in the same Rhino frame (org.mozilla.javascript) each time; the frame names contain the service id. IBM Thread and Monitor Dump Analyzer makes this a two-minute job.
  • Hung-thread detection: WebSphere logs WSVR0605W: Thread ... has been active for ... milliseconds and may be hung with a stack - set com.ibm.websphere.threadmonitor.threshold to catch loops early.
  • Design-time: the validation panel warns about BPD loops without exit conditions only in obvious cases; review every "loop back" sequence flow for a condition that can become false, and every while in scripts for the increment.
// safe loop pattern in a script task
var guard = 0;
while (hasMore && guard++ < 10000) { hasMore = fetchNextPage(); }
if (guard >= 10000) throw new Error("Loop guard hit - aborting");

Stopping a running one: Process Admin > instance > Suspend then Terminate (or the REST PUT /process/{piid}?action=terminate); a thread stuck in a script needs a JVM restart of that member - BPM cannot interrupt a Rhino loop.

References

Related questions

0 votes
1 answer 1.2k views
0 votes
2 answers 3.1k views
asked Oct 16, 2017 in Coach Views by qaziMateen (120 points)
0 votes
1 answer 2.8k views
0 votes
1 answer 3.0k views
0 votes
1 answer 1.6k views
asked May 19, 2016 in Team Services by anonymous
0 votes
1 answer 2.5k views
0 votes
4 answers 4.5k views
0 votes
1 answer 642 views
0 votes
1 answer 1.5k views
0 votes
1 answer 797 views
0 votes
1 answer 688 views
0 votes
2 answers 4.7k views
0 votes
1 answer 2.1k views
0 votes
1 answer 1.2k views
0 votes
1 answer 874 views

723 questions

807 answers

98 comments

4.9k users

Join BPM Community Discord Channel

Welcome to BPM Tips Q&A, Community wiki/forum where you can ask questions and receive answers from other IBM BPM experts and members of the community. Users with 2000 points will automatically be promoted to expert level.
Created by Dosvak LLC
Our Youtube Channel
...