Using callContextBpmData and Db in an external BPM

whether this is the same context <pun intended> as Jose is speaking but this is how I add BPM data to my external BPM.  In this case I am hooking it to the Update method of Job Entry.  After compiling, deploying and recycling the application pool you may need to go back into the BPM designer and "refresh" the connection to the method so it sees the change to the call.

public class JobEntryBpm : ContextBoundBase<ErpContext>

{

public void Update(Erp.Tablesets.JobEntryTableset ds,

Ice.Tablesets.ContextTableset ctx)

{

var bpmRow = ctx.BpmData.FirstOrDefault();

if (bpmRow != null && bpmRow.ShortChar01 == "MYVALUE") {… }


Jim Kinneman
Encompass Solutions, Inc.

Hi,


As far as I can tell, when I'm creating an external BPM and I want to gain access to tables that are out of scope, I have my custom class inherit from Ice.ContextBoundBase<Erp.ErpContext> which gives me access to its Db property and brings all the tables into scope (Db.OrderHed, Db.QuoteDtl, Db.Memo, etc).


And if I want to bring callContextBpmData into scope I need my custom class to inherit from Epicor.Customization.Bpm.CustomizationBase (its an abstract class so I can't instantiate it, I can only inherit from it). 


The problem is I can only inherit from one class at a time so I don't know how to bring all of the tables I need into scope and still bring callContextBpmData into scope at the same time. 


Does anybody know how to do this?


Thanks,


Bryce

If you inherit from Epicor.Customization.Bpm.MethodCustomizationBase<Erp.ErpContext>Â
​it carries both Db and callConext.​

​
public abstract class CustomizationBase<TCtx> : CustomizationBase, IDisposable where TCtx: IceDataContext, IIceContext
​
Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Wed, Jul 8, 2015 at 8:00 PM, bwhiteside@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p></p><p><span>Hi,</span></p><p><span><br></span></p><p><span>As far as I can tell, when I&#39;m creating an external BPM and I want to gain access to tables that are out of scope, I have my custom class inherit from </span><span style="word-spacing:normal;margin:0px;padding:0px;outline:0px;font-family:Arial, Verdana, geneva, sans-serif;vertical-align:baseline;color:rgb(51,51,51);">Ice.ContextBoundBase&lt;Erp.ErpContext&gt; which gives me access to its Db property and brings all the tables into scope (Db.OrderHed, Db.QuoteDtl, Db.Memo, etc).</span></p><p><span><br></span></p><p><span>And if I want to bring </span><span style="word-spacing:normal;">callContextBpmData into scope I need my custom class to inherit from </span><span style="word-spacing:normal;color:rgb(51,51,51);font-family:Arial, Verdana, geneva, sans-serif;">Epicor.Customization.Bpm.CustomizationBase (its an abstract class so I can&#39;t instantiate it, I can only inherit from it). </span></p><p><span style="word-spacing:normal;color:rgb(51,51,51);font-family:Arial, Verdana, geneva, sans-serif;"><br></span></p><p><span style="color:rgb(51,51,51);font-family:Arial, Verdana, geneva, sans-serif;word-spacing:normal;">The problem is I can only inherit from one class at a time so I don&#39;t know how to bring all of the tables I need into scope and still bring callContextBpmData into scope at the same time. </span></p><p><br></p><p>Does anybody know how to do this?</p><p><br></p><p>Thanks,</p><p><br></p><p>Bryce</p><p></p>

</div>
 


<div style="color:rgb(255,255,255);min-height:0px;"></div>

1 Like

Excellent. Thank you Jose. You are a wealth of knowledge!

 

Bryce Whiteside  |  IT Programmer  |  AGM Container Controls, Inc.  |  bwhiteside@...  |  t: 520.881.2130 ext 2145

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, July 08, 2015 6:14 PM
To: Vantage
Subject: Re: [Vantage] Using callContextBpmData and Db in an external BPM

 

 

If you inherit from Epicor.Customization.Bpm.MethodCustomizationBase<Erp.ErpContext> 

​it carries both Db and callConext.​


​

public abstract class CustomizationBase<TCtx> : CustomizationBase, IDisposable where TCtx: IceDataContext, IIceContext

​

Jose C Gomez

Software Engineer


T: 904.469.1524 mobile


Quis custodiet ipsos custodes?

 

On Wed, Jul 8, 2015 at 8:00 PM, bwhiteside@... [vantage] <vantage@yahoogroups.com> wrote:

 

Hi,

 

As far as I can tell, when I'm creating an external BPM and I want to gain access to tables that are out of scope, I have my custom class inherit from Ice.ContextBoundBase<Erp.ErpContext> which gives me access to its Db property and brings all the tables into scope (Db.OrderHed, Db.QuoteDtl, Db.Memo, etc).

 

And if I want to bring callContextBpmData into scope I need my custom class to inherit from Epicor.Customization.Bpm.CustomizationBase (its an abstract class so I can't instantiate it, I can only inherit from it). 



The problem is I can only inherit from one class at a time so I don't know how to bring all of the tables I need into scope and still bring callContextBpmData into scope at the same time. 

 

Does anybody know how to do this?

 

Thanks,

 

Bryce

 

Jose,

How do you inherit from Epicor.Customization.Bpm.MethodCustomizationBase<Erp.ErpContext> properly?

I got an error message saying I had to implement Epicor.Customization.Bpm.MethodCustomizationBase<Erp.ErpContext>.ExecuteBase(), so I added this to my custom class:

 protected override void ExecuteBase()
 {

 }   

Now I get an error that says Epicor.Customization.Bpm.MethodCustomizationBase<Erp.ErpContext> does not contain a constructor that takes 0 arguments. Not sure what arguments to pass in.

Do you have any example code where you are inheriting from  Epicor.Customization.Bpm.MethodCustomizationBase<Erp.ErpContext>?

Thanks,

Bryce
 
So execute base is the default execution method ... you know the best thing you can do is to creeate a very basic BPM in Epicor and then get the source files fromÂ
\\SERVER\C$\InetPub\EpicorInstance\Server\BPM\SourcesÂ
And that will have an implementation of the standard BPM you can then modify / add / fix that to your hearts content and then use it in your external DLL.


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Thu, Jul 9, 2015 at 1:31 PM, bwhiteside@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p>Jose,</p><div><br></div><div>How do you inherit from <span style="color:rgb(51,51,51);font-family:Arial, Verdana, geneva, sans-serif;word-spacing:normal;">Epicor.Customization.Bpm.MethodCustomizationBase&lt;Erp.ErpContext&gt; properly?</span></div><div><span style="color:rgb(51,51,51);font-family:Arial, Verdana, geneva, sans-serif;word-spacing:normal;"><br></span></div><div><span style="color:rgb(51,51,51);font-family:Arial, Verdana, geneva, sans-serif;word-spacing:normal;">I got an error message saying I had to implement Epicor.Customization.Bpm.MethodCustomizationBase&lt;Erp.ErpContext&gt;.ExecuteBase(), so I added this to my custom class:</span><br></div><div><span style="color:rgb(51,51,51);font-family:Arial, Verdana, geneva, sans-serif;word-spacing:normal;"><p style="margin-top:12px;margin-bottom:12px;outline:0px;vertical-align:baseline;"> protected override void ExecuteBase()<br><span style="margin:0px;padding:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;vertical-align:baseline;background:transparent;"> {<br><br> }   </span></p><p style="margin-top:12px;margin-bottom:12px;outline:0px;vertical-align:baseline;"><span style="margin:0px;padding:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;vertical-align:baseline;background:transparent;">Now I get an error that says <span style="margin:0px;padding:0px;outline:0px;font-weight:inherit;font-style:inherit;font-family:inherit;vertical-align:baseline;background:transparent;">Epicor.Customization.Bpm.MethodCustomizationBase&lt;Erp.ErpContext&gt; does not contain a constructor that takes 0 arguments. Not sure what arguments to pass in.</span></span></p></span></div><div>Do you have any example code where you are inheriting from <span style="word-spacing:normal;"> </span><span style="word-spacing:normal;color:rgb(51,51,51);font-family:Arial, Verdana, geneva, sans-serif;">Epicor.Customization.Bpm.MethodCustomizationBase&lt;Erp.ErpContext&gt;?</span></div><div><span style="word-spacing:normal;color:rgb(51,51,51);font-family:Arial, Verdana, geneva, sans-serif;"><br></span></div><div><span style="word-spacing:normal;color:rgb(51,51,51);font-family:Arial, Verdana, geneva, sans-serif;">Thanks,</span></div><div><span style="word-spacing:normal;color:rgb(51,51,51);font-family:Arial, Verdana, geneva, sans-serif;"><br></span></div><div><span style="word-spacing:normal;color:rgb(51,51,51);font-family:Arial, Verdana, geneva, sans-serif;">Bryce</span></div><div> </div><p></p>

</div><span class="ygrps-yiv-543893769">
 


<div style="color:#fff;min-height:0;"></div>