Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic how to add process activity in if-else condition (Read 3787 times)
deepak
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Jun 29th, 2011
how to add process activity in if-else condition
Jul 16th, 2011 at 7:05am
Print Post  
I referred workflowdesigner. But I want to add Process in the diagramview from listbox. When I add the process automatically generate if-else nodes in diagramview. In if-else condition I want to add processes. I can also add the if-else, which conditions multiple times in digramview in between the above true & false conditions.

Please tell me there is any other option.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to add process activity in if-else conditi
Reply #1 - Jul 16th, 2011 at 7:50am
Print Post  
If you are you trying to add new kind of workflow elements that are laid out the same way as "Activity" nodes are, set LayoutTraits[WorkflowItemId] = "Activity" when creating a node from their listbox item.
  
Back to top
 
IP Logged
 
deepak
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Jun 29th, 2011
Re: how to add process activity in if-else conditi
Reply #2 - Jul 16th, 2011 at 10:29am
Print Post  
Please give me the steps to create the new node in listbox.

In this node I want to add the
1.  Process
2.  After adding process add If-else condition
3.  In if part & else part again new Process is   
     inserted.
4.  I drag new condition from the listbox & drop on
     after new Process.

& How to attached the image or file in this blog.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to add process activity in if-else conditi
Reply #3 - Jul 18th, 2011 at 6:08am
Print Post  
Do you mean you need a listbox item that creates several nodes and links with a single drag-and-drop operation?

You can't upload images here. You could add a link to one  on your server or some image hosting site, or email it to support@mindfusion.eu.
  
Back to top
 
IP Logged
 
deepak
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Jun 29th, 2011
Re: how to add process activity in if-else conditi
Reply #4 - Jul 18th, 2011 at 8:34am
Print Post  
Yes. I want to create a new item in listbox. In this item I want to add activity, then If-else & under if-else again activity.
  
Back to top
 
IP Logged
 
deepak
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Jun 29th, 2011
Re: how to add process activity in if-else conditi
Reply #5 - Jul 18th, 2011 at 10:37am
Print Post  
How to set the last node destination point as new node origin point.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to add process activity in if-else conditi
Reply #6 - Jul 18th, 2011 at 11:14am
Print Post  
I think this method does what you described:

Code
Select All
private void CreateProcess(DiagramLink link)
{
	CreateActivity(link);
	DiagramLink lastLink = diagram.Links[diagram.Links.Count - 1];
	CreateIfElse(lastLink);
	lastLink = diagram.Links[diagram.Links.Count - 1];
	CreateActivity(lastLink);
} 



Call it from the switch statement in view_DragDrop:

Code
Select All
case "Process":
	CreateProcess(link);
	break;
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
deepak
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Jun 29th, 2011
Re: how to add process activity in if-else conditi
Reply #7 - Jul 18th, 2011 at 5:21pm
Print Post  
I used the code which you have provided but i am not gettig correct sequence. i need to following sq.

1. Activity

2. under activity If-Else needs to be add &
in If -Else under add activity in ture & false condition

3. flow needs to be complate

When I drag Process(item) from listbox, I need to create a nodes like following diagram.



                            |
                    --------------------
                   |  Process1 = 1      |
                   |  Process2 = 0      |
                    --------------------
                            |
                            |
                           / \
                           \ /
                 1          |          0 
               (True)       |       (False)
                  ----------------------
                 |                          |
                 |                          |
          --------------         --------------
         | Process1 = 1 |       | Process2 = 0 |
          --------------         --------------
                 |                          |
                 |                          |
                  ----------O-----------
                               |      
« Last Edit: Jul 19th, 2011 at 5:38am by deepak »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to add process activity in if-else conditi
Reply #8 - Jul 19th, 2011 at 1:27pm
Print Post  
Code
Select All
private void CreateProcess(DiagramLink link)
{
	CreateActivity(link);
	DiagramLink lastLink = diagram.Links[diagram.Links.Count - 1];
	CreateIfElse(lastLink);
	DiagramLink trueLink = diagram.Links[diagram.Links.Count - 3];
	DiagramLink falseLink = diagram.Links[diagram.Links.Count - 2];
	CreateActivity(trueLink);
	CreateActivity(falseLink);
} 



Even better, change the various Create methods to return some objects describing the just created workflow elements. For example CreateIfElse could return an object with TrueLink and FalseLink properties that give you direct references to the links, so you don't have to rely on the links order within the collection.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint