Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
praxkan

Veteran
Registered:
Posts: 142
Reply with quote  #1 
Looking at linked processes as a possible solution. Couldnt find anything in the documentation that leads me to believe this is even possible.

Requirement: I have to spawn "x" (dynamic) number of instances of the same linked process, and make the parent process wait at a stage until all those children are complete.

Is such a thing possible using linked process? 

If not, whats a good eWorkaround ? I suppose the parent process could just "fire and forget", or somehow wait on a stage with a conditional action/timer of some sort - but all these seem like asynchronous ways to do it. Not really what I'm looking for.
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #2 
What you need to do is the same as MBPM does with linked processes, but manually. Here it is:

Firstly, you loop around (in code) and generate the folders by raising flags.

Next, when the child folder enters an archive stage, it automatically raises the flag 'my parent' (need to check this, but has not changed since it was introduced in v6, and it caused me serious grief when I discovered it).

Set the parent to respond to that flag, ie 'this folder'. In invoking the flag, you set the 'only start if' property to check that all the required folders are archived. Something like :
"select count(*) from efolder where eparent = 'folderid' and earchived = 0" is equal to 0
(in code, obviously, and you may need to qualify it with the process name, depending on your processes)

That is how the engine does it, anyhow, although it is slightly more complex as there are more conditions for the rendezvous actions.

__________________
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  #3 
Fascinating... I didnt know the child folders automatically call the parent. We've had multiple processes where I added this sort of function manually using a flag :|

How does the child folder know which flag on the parent to call though? Is there some hidden system name for the flag, or do you just draw a flagged action with "this folder" without an associated flag on the action ? 
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #4 
The child folder raises the flag called 'my parent', the parent folder id. The parent is set automatically to the flag raiser if a folder is raised by a flag. You need to use RaiseFlag(ProcessConext.FolderParent) to acheive that manually.

The parent can respond to a flag 'this folder'.

This is not well understood, as are flags in general. Because of this, our own training course has a specific section on flags, and covers a lot of what is not even in the documentation.

__________________
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  #5 
Thanks Jerome!
0
praxkan

Veteran
Registered:
Posts: 142
Reply with quote  #6 
Got this working... apparently in v9, its not "my parent" anymore, but instead "ThisFolder"

1) On the parent process, the flag action must have "Flag used to invoke this action" as ThisFolder, Folder which must raise flag as "ThisFolder"

2) On child process, call flag as Mstm.RaiseFlag(ProcessContext.FolderParent, ProcessContext.FolderParent,null);


Still cant figure out a way to pass parameters through this hidden flag though...Is it even possible, or do we have to create a custom flag if we need anything with parameters, beyond a straight flag call.
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #7 
That is not quite what I meant. There is no 'my parent' flag (never was), but you raise the flag named as the folder id of the parent. The parent folder is set to wait for the flag 'this folder'. You do not need to create any flags.

To pass parameters, you do need to create a flag. This is more complex, but (as described my me elsewhere and again not documented), to do this optimally you need to raise the flag as the folder's parent. To do this, you need to use RaiseFlag() and pass in the parent folder id as the raiser's folder id (2nd param). The parent flag action is then set to only respond to 'this folder'.

You can see that it is complex, and this is why we have a separate section for it in our training. Sadly Metastorm never documented this properly.

BTW, it has always worked like this since v5 (the last version I worked on), and only changed slightly in v6 when 'sub-procedure' stages were introduced, and every folder hitting an archive stage raises the flag named after their parent (again not documented!).

[Edit: to be honest, I should follow my sig and do a quick example of each, but with Metastorm BPM going to the wall I've kind of lost my impetus on the product.]

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