What Class type is a Process Business Object?

We have a generic Rules Engine that lets you specify ad - hoc rules at run time in Metastorm BPM. We are trying to get the Process Business Object into this function for evaluation of the Process variables. The trouble is we cannot figure out what Type it is (without knowing in advance what the Process itself is).

 

So far we can set the object to be passed in as a "Metastorm.Runtime.Core.Maps.Map" object, and we can then get the MapMBO object from that. This is fine when we are in a Process event, but we would also like to call this from a form.

 

Can anyone suggest what this type may be? A Process Business Object on a form cannot be interpreted as any of these:

Metastorm.Runtime.Core.Mbo.MapMbo

Metastorm.Runtime.Core.Mbo.Query

Metastorm.Runtime.Core.Mbo.Table

Tagged:

Comments

  • I think you will have better luck leveraging the new "dynamic" type in .Net 4.0.

    AutoMapper or ValueInjecter might be useful for this because you'll need to map a complex type to something simple that your Rules engine likes (probably POCO classes).

    The problem that you already mentioned is that process maps get distinct types created per process in the Designer, so while they may all derive from the same type, the actual type is of Metastorm.Runtime.Models.ProjectName.ProcessName. That is the actual type, of which you are probably only really interested in the ProcessName.ProcessNameData business object. This would be the object you would want to coerce into a simple DataTable or other structure ready to be fed into your Rules engine. I've done something similar with reflection/iteration, but dynamic would be more elegant and would not require advanced knowledge of the process.

  • Well, I don't think it needs to be that complex.The Rules engine is built 100% in Metastorm, and edited through the client. The only thing it needs is the Process Data.

     

    I can use the Process itself, and it works fine. That is NOT the problem. The problem is that, unlike other Business Objects, I cannot find any registered BO type that the Process BO appears to be derived from.On a Form, I only have access to the BO, not the Process object.

     

    In theory I could get the user of the Activity to call Read() on the BO to get the underlying DataSet object, but that is not elegant at all. I may have to offend my aesthetic sensibilities and do it, however. It is too useful a thing to drop.

  • Declaring and assigning my variable for a map mbo in this way on a form...

    Metastorm.Runtime.Core.Mbo.MapMbo m = new Metastorm.Runtime.Core.Mbo.MapMbo(Current.ProcessContext.ProcessName);
    

     ...allows me to access the DataSet for the current MapMbo. 

    Not sure what your function expects as parameter though and if this is exactly what you've done thus far. 

  • Thomas,

     

    I had not tried to create a new one, no. I'll give it a go, thanks!