BPM Help!

I’m creating a BPM to help with our conversion to E10. We’re going to be eliminating some unnecessary operation codes from our bills of operations in the process. The BPM I’d like to write is to occur on the EngWorkBench.ChangeECORevApproved Method.

What I’m trying to do is write a Query that checks for the existange of 1 of 2 (either/or) operation codes BEFORE I allow a revision to be marked as approved and checked back in.

IN the pre-processing step, I have selected the 'Number of Rows in the Query is more than 0 option.

For the Query window, I have written.
for each ttecogroup where ttecogroup.company = ‘MB’ no-lock.
for each/preslect ttecorev where ttecorev.company = ttecogroup.company and
ttecorev.approved = False no-lock.
for each/preselect ttecoopr where ttecoopr.company = ttecorev.company and
ttecoopr.groupid = ttecorev.groupid and
ttecoopr.partnum = ttecorev.partnum and
ttecoopr.altmethod = ttecorev.altmethod and
(ttecoopr.opcode = ‘9005’ or ttecoopr.opcode = ‘9010’) no-lock.
end.
end.
end.

Is there a way for me to get this query working so that when I try to approve this revision; I get a message? Right now no matter if I change the criterial from greater than 0 or to less than 1; I ALWAYS get the exception message.

2 main questions:

1 - what am I doing wrong?

2 - Is there a technique I can use in this process to help with debugging so that in the future I can utilize these techniques to help me resolve my issue?

Forgive me as I am a SQL guy and the ABL/4GL coding is killing me. Will be so happy when we are on E10.

Please advise
Thank you!
Jeff Henslee
M-B Companies Inc.

are the opcode 9005 and 9010 the ones you want to allow?

if so, and you want the query to return a row when an opcode other than one of those two is selected, try changing

(ttecoopr.opcode = ‘9005’ or ttecoopr.opcode = ‘9010’)

to

NOT(ttecoopr.opcode <> ‘9005’ AND ttecoopr.opcode <> ‘9010’)

Just wondering if the fields in your query are populated?
I seem to remember ECO tt tables were “different”.
Mya or may not be populated, depending on the method, field(s) changed, etc…
In V8 I might try simple Pre and Post processing directives

  • no conditions, action of informational messages with any fields from the query?

Thanks for the reply. Actually, the 2 operations are the ones I do NOT want to allow.
I basically wanted to see if there were any rows returned if either of the 2 opcodes were in a bill of operations. If the record count is > 0 then I wanted to display the error.

Okay. So you have pre-existing MOMs that might use one of those two Opcodes, and you want to halt on updates to the MOM, if either are in use.

  1. Drop the ttecogroup table as it isn’t changing when you approve the revision.
  2. Change the ttecorev.approved = False to ttecorev.approved = True. The ttecorevapproved field in is set to true when approving a previously unapproved rev. This still allows a Rev to be unapproved without raising an exception
  3. Use the ecoopr table instead of the ttecoopr table. That way an Opr that isn’t changing, but contains the target OpCode, will still raise an exception.

Thanks Calvin - will try working on this later this morning. Much appreciated.