Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
suityou01

Avatar / Picture

Veteran
Registered:
Posts: 213
Reply with quote  #1 
I am trying to create a custom (scripted) BO. I am creating my server side script and trying to follow the designer user guide (I know, but it's all I have).

The documentation is somewhat lacking. They don't even show in their examples which references to include. After much poking around I am getting somewhere.

However, the current issue I have is that I want to implement the ISupportRefill interface. Which means I need to support the AlwaysRefresh method.

From the documentation I have the following

Quote:

ISupportRefill

#region ISupportRefill Members

This interface gets a value indicating whether the business object should retrieve its data on

every request.

 


Which is useless. What is the signature of this method?

I have tried

 

public void AlwaysRefresh()
{
}


But no joy.

To save the inevitable toing and froing on here, has anyone managed to document these interfaces rather than the hodge-podge of mixed code examples that form the dogs breakfast that is section 26.10 of the designer user guide?
0
jpesout

Avatar / Picture

Veteran
Registered:
Posts: 107
Reply with quote  #2 
Did you see examples located in <Metastorm folder>\BPM\Sample Processes\sample 3\ScriptedBusinessObjects.Solution? It's not documented yet, but better than nothing.

    public virtual bool AlwaysRefresh

{
get { return false; }
}

0
suityou01

Avatar / Picture

Veteran
Registered:
Posts: 213
Reply with quote  #3 

Some useful stuff in there. Thanks.

0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #4 
Definitely something I have been meaning to get into. I have not had the need yet, so have sort of ignored it.

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
suityou01

Avatar / Picture

Veteran
Registered:
Posts: 213
Reply with quote  #5 

Need to call Oracle stored procedures so custom business objects seemed like a good route.

 

I have mostly figured out what needs to be done. Essentially you add a server side script (class) and add parameters, variables and an instance DataSet, with read/write methods. All pretty standard stuff, although Metastorm seem to thing that the C# data types are no good and have implemented their own which involves casting (performance hit?)

 

So I have done all of this, but the class still does not appear in the drop down list of available scripts on my custom business object. The class compiles fine.

 

I also tried creating a default class (no code added or removed) to see if this basic class would appear in the list. Still nothing.

 

Any ideas anyone? I've been waiting for Metastorm support for over a day now to get back to me with an answer so it's not looking too hopeful at the moment.

0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #6 
Please do let us know your progress. I am very interested. I'm sorry I cannot help at the moment, though.

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
suityou01

Avatar / Picture

Veteran
Registered:
Posts: 213
Reply with quote  #7 

Expect a full write up when I crack it. :)

0
suityou01

Avatar / Picture

Veteran
Registered:
Posts: 213
Reply with quote  #8 

Sorry to keep harping on about this. I have now progressed to getting my custom business object compiled and deployed. What I now want to do is assign a process variable to my one input parameter. (Precisely like sample 3, CustomerOrders1 business object has Local.txtCustomerName assigned the parameter CustomerID).

 

I have tried dragging. This does not work. It puts a little yellow arrow in the "Other Business Objects" window next to the drag target (the parameter in question) but doesn't actually assign it (which I would expect means it appears in the parentheses after the parameter name).

 

Any help appreciated. So close to cracking this now, and then the full write up will be on here once I do.

0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #9 
You need to click on the parameter, then click on the 'fx' (used to be '...') button to open the Expression Builder. From there select your variable.

Don't forget to set the BO instance to 'Always Refresh' from the context menu.

BTW, please do continue updating this, and if you are able to share the solution, that would be great too!

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
powerplay

Avatar / Picture

Senior Member
Registered:
Posts: 77
Reply with quote  #10 
Hi,

Kindly help with editable Scripted BO that writes the data back to database.
An example would definitely be helpful.

Regards!

__________________
Thanks
HB
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #11 
I have not tried an editable BO. I don't think it is complex, but you need to add some functions. There should be an example in the examples directory.

I would like to use these going forward, mainly because editable grids are now much less flexible than they used to be, but I am very wary given the time wasted trying to get the RO scripted BO going successfully.

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
praxkan

Veteran
Registered:
Posts: 142
Reply with quote  #12 
I've gotten a version of editable BO grid working using a combination of the example samples that come with metastorm. Its fairly simple but not obvious by any stretch, like everything else metastorm :)

c:\Program Files (x86)\Metastorm\BPM\Sample Processes\Scripted BO Example

I can't share code because of security restrictions (i think), but here's the high level steps that are not obvious from the example. 

  • Your class must implement these interfaces - IDataSetAccess, ISupportRefill, IEditableAccess, IDisposable. Get the implementer methods of these from the examples and modify as you need.
  • Put your update statement inside the Commit() function [unless you want changes immediately saved into the DB, even on cancel...in which case put the update inside Write()]
  • Oh, and remember to assign a primary key to your table in the Read() function, otherwise it wont work as an editable grid :)
           data.Tables[0].PrimaryKey = new DataColumn[] {data.Tables[0].Columns["<col name>"]};

0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!