cancel
Showing results for 
Search instead for 
Did you mean: 

Re-using a subprocess

rashmis
Champ in-the-making
Champ in-the-making
hi.

I want to create a new process diagram with a subprocess. This subprocess should be  a process that i created earlier in a different project. Basically, i just want to re-use process A as a subprocess in Process B. So when i double click on the subprocess element, the process A opens. Is this possible ???

i am attaching the snapshot.

Thanks
rashmis[attachment=0]main-subprocess.JPG[/attachment]
6 REPLIES 6

tiesebarrell
Champ in-the-making
Champ in-the-making
rashmis,

unfortunately, no, we don't support this linking of subprocesses for reuse yet. However, if you rename the subprocess you made earlier to match to filename that is automatically created when you double click and overwrite the auto-file with your own, it should be the subprocess you get when you double-click the subprocess node. However, at that time it's obviously linked to that specific node and you can't reuse it without duplicating the file.

rashmis
Champ in-the-making
Champ in-the-making
yes, i had already tried this way Smiley Happybut i was unable to create the xml for the main process. i was getting this problem
http://forums.activiti.org/en/viewtopic.php?f=3&t=535&p=2239&hilit=dev#p2239

tiesebarrell
Champ in-the-making
Champ in-the-making
Can you attach the two files (.diagram) involved? Maybe I can figure it out from those.

rashmis
Champ in-the-making
Champ in-the-making
hi tiesebarrell.

Attaching my .activiti files.

Also, I noticed something strange, when i did this ==>

1. Copy process diagram from project 1 (Act 1,  see the LHS of the snapshot) and copy it to project 2.
2. In Project 2 (Act 2) I rename this copied file into the default subprocess filename that got created on double click of the subprocess element. (Renaming by right click-> refactor->rename)
3. When i open this diagram in the eclipse designer, the tab still shows the original name of the diagram. I have attached the Before& Aftre renaming snapshots.

I am also attaching the complete process diagram so that it is easier for you to reproduce at your end. Please see if you are encountering these problems.[attachment=2]Subprocess tab after renaming.JPG[/attachment][attachment=1]activiti files.zip[/attachment][attachment=0]Subprocess tab before renaming.JPG[/attachment]

tiesebarrell
Champ in-the-making
Champ in-the-making
rashmis,

thanks for posting the files. There are a couple of separate issues here, so I'll try to provide some comments on each of them

1) Sub process isn't opened when an existing file is given the name of the sub process that would otherwise be created automatically. I have tested with the three .activiti files you attached, but it works on my system. Double-clicking either of the subprocesses opens up the correct subprocess you also provided. So I can't really reproduce the problem you have. Do you still experience this problem?
2) Saving the XML didn't work. As I mentioned in the other thread you referred to, there is a difference between the xml that's created when you right click the canvas and export and the one that's created on each save. This is a bug which will be resolved in the next release. For now, you're best off using the automatic option, as this contains the most recent code and doesn't generate the mentioned error boxes.
3) Renaming the filename of a (sub)process doesn't change the title in the tab. You're right, renaming has no effect. We don't do anything to rename the name of diagram, which is what you see in the tab. If you wish, you can edit it by hand. In the .activiti file, change the name attribute of the <piSmiley Very Happyiagram /> tag, which is probably on the second line of the file.

rashmis
Champ in-the-making
Champ in-the-making
For point (1) I will try to find out what I am missing… anyways, thanks a lot for the replies Smiley Happy .