Trigger Method Directive on First Save

I’m trying to trigger a BPM to fire on first save.

I’ve read an old topic BPM condition only working on first save

And I’ve used this in the past, but I don’t know why I’m not getting a data set value to populate on a message box.

I have a Condition widget. Condition is "Number of rows in the MyQuery query is equal to 1.

The Query joins the ds.ProdGrup table the ERP.ProdGrup table with a filter on the ds table. Fiter is RowMod = “A”

I put messages boxes on both true and false condition to pass the RowMod value.

When I create a new record, there is no RowMod Value

How is there no Value for “A” or any other sort of value passing through this dataset field?

You’ll need to capture the RowMod value in the Pre-Processing, store it in a CallContext field, then access it in Post-Processing and do your work accordingly.

RowMod doesn’t exist in Post-Processing because the change has already taken place and the resulting data has no RowMod applied anymore.

1 Like

I might be wrong here, but if you’re joining the ERP.ProdGroup in pre-processing, then the query will return 0 rows, because there is no matching record in the ERP.ProdGroup table. It wouldn’t be added to the database until post-processing. Try just removing the ERP.ProdGroup table from your query.

Edit: Just saw that the BPM is post-processing. Need more coffee apparently. Andrew is correct, there is not RowMod post processing. His fix of storing the RowMod value in CallContext is the way to go.

Andrew,

I’ve never used that widget before… Which Widget will I use? How will I set that up and use it in my Post Processing BPM?

I thought I could invoke the Automation Studio Widget in a Pre-Processing BPM, but I got a massive error.

It is the Set BPM Data widget. You choose a ‘CallContextBPMData’ field to set the value to, then you can access that same field in your Post-Processing BPM.

Choose ‘Set BPM Data’ widget
image

Choose a CallContextData field to use. (Character or ShortChar for string values)
image

Expression to get the RowMod from the ProdGrup row.
image

Andrew sorry to bug again. How do I access the Field in the Post-Processing BPM? I’m sorry to bug you. I’ve have never used this method before. I appreciate your help! I know this will be the last step to get this BPM to fire correctly!

In the post-processing you should add a condition with 2 elements:

  • has been enabled from the specified directive - select your pre-processing directive
  • the callcontectbpmdata.char01 is equal to the “A” expression

That should get your there

In the pre-process you can add the enable-post-process directive widget if RowMod = “A”. Then in the post-process you can check to see if the enable was set. Something like this:

Of course, you’ll have other criteria on that condition block.

Joe

1 Like

@andrew.johnson , @jdtrent , @SueLowden

Thank you all! All of your comments got my BPM to fire. I don’t know how to give you all credit for helping me out. Thanks for taking the time to help me out!