Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
Rob_B

Veteran
Registered:
Posts: 109
Reply with quote  #1 
Does anyone know whether it is possible to pass a Business Object when cloning a folder? I have a process which clones multiple folders to pass to sub-processes, BUT the data is all held in a Business Object from another sub-process which is held in a library

this architecture allows the sub-processes to be edited independantly and re-imported, and also allows many processes to share a data structure which is great, but the data isn't passed from the parent to the clone

is there a way of doing this without setting each field one by one?

R

__________________
There are, essentially, three types of mathematician; those who can count, and those who can't
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #2 
That is an interesting point. Even if the Sub-Process is used as designed, not just to share data structures (which is a fine unintended use of same, I must admit), the Sub-Process data will not be copied for a cloned Folder. That seems to be a design flaw IMO.

There is no way to easily copy the data. You certainly cannot pass anything to a newly cloned Folder. The only way would be to open another Business Object (preferably in Read-Only mode) and assign the data variables from one to t'other.

I could write a simple function to copy a BO like this, but the big downside is the inability to create that BO just for this event. That means you must have it 'opened' every time the Folder is accessed, which is another design flaw. You could, however, get the data from the database in a SelectSql() and do the same, however. To make it generic you need to pass in the table name (as the underlying TableSet irritatingly seems to have a table called 'Table1' - another design flaw?).

The function would go something like:

Pass in BO to set and table name (assume eFolderId is the ref), and the folder id of the source (should be Parent in this case, but let's be generic)

Run the SQL: SELECT * FROM <Table Name> WHERE eFolderId = @SourceFolderId

run that through a foreach loop, getting the row each time

run that through a foreach loop setting each field EXCEPT THE FIRST (which would be eFolderId) to the same indexed field in the passed in BO. I am pretty sure you can do that. If not, you have to get the column information and the column name.

I hope that makes some kind of sense. If I get enough time (and bored enough) I may have a go today.

__________________
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
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #3 
Further test show that it does work, but in order to work, the Sub Process MUST be added to the main Process. You do not need the Folder to ever go there, but it must be added. If you do that, all Sub-Process data is also cloned.

__________________
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
Rob_B

Veteran
Registered:
Posts: 109
Reply with quote  #4 
An imaginative solution, thanks Jerome (c:

I will try this; I didn't want the maintenance overhead of copying each row (the whole idea of splitting it out is so that the sub-process owners can update the variable library, re-publish, and just click "refresh" in the main process, a big improvement), but of course looping through like this would obviate any maintenance.

Maybe we'll be able to pass fully populated BOs around in 9.1....or 9.2.... or.... 'twould be very useful!


__________________
There are, essentially, three types of mathematician; those who can count, and those who can't
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #5 
Not too likely. It all depends how it is managed. Scripted Business Objects are promised for 9.1, but I have no idea what they will be capable of as yet.

We are considering adding the ability to serialise a Business Object to XML (probably and XML recordset - it seems the most appropriate) and populating one from that. In theory in 9.1 we could even create a new BO from this, replicating the old one, which would be nice.

The main driver is the inability to handle changes to editable BO's as they exist. Perhaps that will be addressed with scripted Business Objects, but I cannot see how they would maintain state between updates, myself.

__________________
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
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!