Re: [Orgmode] Business process diagrams in org-mode

2010-11-16 Thread Eric S Fraga
Bart Bunting b...@bunting.net.au writes:

 Hi Eric,

 Thanks very much for the suggestion!

 I'm not familiar with dot but will invest some time to see if I can get
 my head around it.  

 This sounds like a good solution.  Perhaps just writing directly in dot
 will solve my problem.

Possibly, although as it is possibly nicer to work with org tables, and
because my train was delayed 45 minutes on the way to work this morning,
here (attached as an org file with babel emacs lisp code) is one attempt
at a solution.

There is one bug in this code: for some reason, the dot code generated
by the emacs lisp code gets embedded in an org EXAMPLE block.  Not sure
why but I have to do something else now...  I'll try to come back to
this later.

Oh, I also changed your table so that each next step takes up a column
entry in the table.  This is not ideal but I didn't want to bother
parsing the actual table entries.

* preamble
#+TITLE: businessprocess.org
#+AUTHOR:Eric S Fraga
#+EMAIL: e.fr...@ucl.ac.uk
#+DATE:  2010-11-15 Mon
#+DESCRIPTION: cf. 
#+KEYWORDS: 
#+LANGUAGE:  en
#+OPTIONS:   H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t :t
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LINK_UP:   
#+LINK_HOME: 
#+XSLT: 

* The problem

Look at [[gnus:nnmaildir%2BUCL:lists#87bp5sacnf@bunting.net.au][this email]].

* the table

#+tblname: processtable 
| Step| Description | Next Steps  |   |
|-+-+-+---|
| Begin   | Begin the process   | Choice1 |   |
| Choice1 | Decide if we are big or small.  | Big | Small |
| Big | If we are big then do big things| End |   |
| Small   | If we are small then figure out if we are really small or possibly big. | ReallySmall | Big   |
| ReallySmall | Yes we are really small | End |   |
| End | The end.| |   |
|-+-+-+---|

* the elisp code

#+source: esf/business-process
#+begin_src emacs-lisp :results value raw :exports results
(defun esf/generate-business-process-graph (table name file)
  (let ((entries (nthcdr 2 table))
	(output (format digraph %s { name))
	)
(message Initial: %s\n table)
(message Entries: %s\n entries)
;; we need to do two iterations through the table, one to define
;; the nodes and then one to connect them.
(setq savedentries entries)		;for second iteration
(while entries
  (let ((entry (first entries)))
	(if (listp entry)
	(let ((step (first entry))
		  (description (nth 1 entry)) )
	  (setq output  (format %s\n  %s [label=\%s\]; output step description))
	  )
	  )
	(setq entries (cdr entries))
	)
  )
(setq entries savedentries)
(while entries
  (let ((entry (first entries)))
	(if (listp entry)
	(let ((from (first entry))
		  (nextsteps (cdr (cdr entry))) )
	  (message Nextsteps: %s\n nextsteps)
	  (while nextsteps
		(let ((to (first nextsteps)))
		  (if to 
		  (if (not (string= to ))
			  (setq output (format %s\n  %s - %s; output from to
		  (setq nextsteps (cdr nextsteps))
		  )
		)
	  )
	  )
	(setq entries (cdr entries))
	)
  ) ; end while entries left
(format #+begin_src dot :results file :file %s :exports results
%s
}
,#+end_src\n file output)
)
  )
(esf/generate-business-process-graph table name file)
#+end_src

* the graph
#+call: esf/business-process(table=processtable, file=business.pdf, name=process)

#+results: esf/business-process(table=processtable, file=business.pdf, name=process)
#+begin_src dot :results file :file business.pdf :exports results
digraph process {
  Begin [label=Begin the process];
  Choice1 [label=Decide if we are big or small.];
  Big [label=If we are big then do big things];
  Small [label=If we are small then figure out if we are really small or possibly big.];
  ReallySmall [label=Yes we are really small];
  End [label=The end.];
  Begin - Choice1;
  Choice1 - Big;
  Choice1 - Small;
  Big - End;
  Small - ReallySmall;
  Small - Big;
  ReallySmall - End;
}
#+end_src


HTH,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.3 (release_7.3.74.gb5907)
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org

Re: [Orgmode] Business process diagrams in org-mode

2010-11-16 Thread Thomas S. Dye


On Nov 16, 2010, at 6:35 AM, Eric S Fraga wrote:


Bart Bunting b...@bunting.net.au writes:


Hi Eric,

Thanks very much for the suggestion!

I'm not familiar with dot but will invest some time to see if I can  
get

my head around it.

This sounds like a good solution.  Perhaps just writing directly in  
dot

will solve my problem.


Possibly, although as it is possibly nicer to work with org tables,  
and
because my train was delayed 45 minutes on the way to work this  
morning,
here (attached as an org file with babel emacs lisp code) is one  
attempt

at a solution.

There is one bug in this code: for some reason, the dot code generated
by the emacs lisp code gets embedded in an org EXAMPLE block.  Not  
sure

why but I have to do something else now...  I'll try to come back to
this later.

Oh, I also changed your table so that each next step takes up a column
entry in the table.  This is not ideal but I didn't want to bother
parsing the actual table entries.

businessprocess.org
HTH,
eric


Hi Eric,

Neat!  This gets rid of the #+begin_example ... #+end_example for me:

#+call: esf/business-process[:results value raw](table=processtable,  
file=business.pdf, name=process) :results value raw


All the best,
Tom


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Business process diagrams in org-mode

2010-11-16 Thread Eric S Fraga
Thomas S. Dye t...@tsdye.com writes:

[...]

 Hi Eric,

 Neat!  This gets rid of the #+begin_example ... #+end_example for me:

 #+call: esf/business-process[:results value raw](table=processtable, 
 file=business.pdf, name=process) :results value raw

 All the best,
 Tom


Thanks.

Trying with [] and appended options individually shows that the latter
is the key!  Thanks.  I keep getting confused about which options are
actually used (i.e. between the ones in the definition of the source
function and the ones in the actual call, and for the latter whether in
[] or appended).

Thanks again,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.3 (release_7.3.78.g9b811)

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Business process diagrams in org-mode

2010-11-15 Thread Eric S Fraga
Bart Bunting b...@bunting.net.au writes:

 Hi All,

 This is a little bit of a vague question but was hopeing that someone
 may have some pointers.

 I am trying to create some business processes with both textual
 descriptions of the process in a table format with step numbers and
 descriptions etc.  I was hopeing to be able to automagicaly convert the
 tabular format into a business process diagram.

 I was wondering if anyone has done this in the past using org-mode and
 bable some how?

 As I am blind I can't successfully create such diagrams using drawing
 software.  It occurred to me though that it should (could) be possible
 to create diagrams from sufficient information in a table structure.

 The diagrams are the usual flow chart style of thing with steps and descision
 points causing the flow to branch to another point.  I thought that if
 we had something like the following it may be possible to generate a
 diagram.



 | Step| Description   
   | Next Steps   |
 |-+-+--|
 | Begin   | Begin the process 
   | Choice1  |
 | Choice1 | Decide if we are big or small.
   | Big,Small|
 | Big | If we are big then do big things  
   | End  |
 | Small   | If we are small then figure out if we are really small or 
 possibly big. | ReallySmall, Big |
 | ReallySmall | Yes we are really small   
   | End  |
 | End | The end.  
   |  |
 |-+-+--|


 This would represent a process where we start, make a choice if we are big or 
 small.  If we are big we do big things and end.  If we are small we make  a 
 choice if we are really small or actually big.  If we decide we are actualy 
 big then we go back to the big step.  If not we go on to the end.


 Anyway just thought I'd ask in case someone had a suggestion how this could 
 be done using org-mode.

 Cheers

 Bart

 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Bart,

others have already pointed you to some code I wrote to convert tables
into GANTT charts using tikz in LaTeX.  For this problem, however, I
would suggest that converting a table to dot format (cf. graphviz [1])
might be more appropriate.  dot will generate quite nice graphs or
trees.  tikz can do it as well but you might find it easier with dot.

The one issue will be parsing your /Next Steps/ column.  You might find
it easier to have next steps be a variable number of columns, one for
each step for a particular step with empty entries for those that don't
have many next steps.  I hope that makes some sort of sense...

The table above would be converted to something like:

#+begin_src dot
digraph process {
  begin [label=Begin the process];
  choice1 [label=Decide if we are big or small];

  begin - choice1;

  ...
}
#+end_src

I can't help with this at the moment (swamped at work) unfortunately but
have a look at my GANTT code and see if that can give you a start.  I'll
have more time in a couple of weeks hopefully.

HTH,
eric

Footnotes: 
[1]  http://www.graphviz.org/

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.3 (release_7.3.78.ge04ba)

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Business process diagrams in org-mode

2010-11-15 Thread Bart Bunting
Hi Eric,

Thanks very much for the suggestion!

I'm not familiar with dot but will invest some time to see if I can get
my head around it.  

This sounds like a good solution.  Perhaps just writing directly in dot
will solve my problem.

Cheers

Bart

  On Mon, 15 Nov 2010 11:25:12 +, Eric S Fraga ucec...@ucl.ac.uk wrote:
 Bart Bunting b...@bunting.net.au writes:
 
  Hi All,
 
  This is a little bit of a vague question but was hopeing that someone
  may have some pointers.
 
  I am trying to create some business processes with both textual
  descriptions of the process in a table format with step numbers and
  descriptions etc.  I was hopeing to be able to automagicaly convert the
  tabular format into a business process diagram.
 
  I was wondering if anyone has done this in the past using org-mode and
  bable some how?
 
  As I am blind I can't successfully create such diagrams using drawing
  software.  It occurred to me though that it should (could) be possible
  to create diagrams from sufficient information in a table structure.
 
  The diagrams are the usual flow chart style of thing with steps and 
  descision
  points causing the flow to branch to another point.  I thought that if
  we had something like the following it may be possible to generate a
  diagram.
 
 
 
  | Step| Description 
  | Next Steps   |
  |-+-+--|
  | Begin   | Begin the process   
  | Choice1  |
  | Choice1 | Decide if we are big or small.  
  | Big,Small|
  | Big | If we are big then do big things
  | End  |
  | Small   | If we are small then figure out if we are really small or 
  possibly big. | ReallySmall, Big |
  | ReallySmall | Yes we are really small 
  | End  |
  | End | The end.
  |  |
  |-+-+--|
 
 
  This would represent a process where we start, make a choice if we are big 
  or small.  If we are big we do big things and end.  If we are small we make 
   a choice if we are really small or actually big.  If we decide we are 
  actualy big then we go back to the big step.  If not we go on to the end.
 
 
  Anyway just thought I'd ask in case someone had a suggestion how this could 
  be done using org-mode.
 
  Cheers
 
  Bart
 
  ___
  Emacs-orgmode mailing list
  Please use `Reply All' to send replies to the list.
  Emacs-orgmode@gnu.org
  http://lists.gnu.org/mailman/listinfo/emacs-orgmode
 
 Bart,
 
 others have already pointed you to some code I wrote to convert tables
 into GANTT charts using tikz in LaTeX.  For this problem, however, I
 would suggest that converting a table to dot format (cf. graphviz [1])
 might be more appropriate.  dot will generate quite nice graphs or
 trees.  tikz can do it as well but you might find it easier with dot.
 
 The one issue will be parsing your /Next Steps/ column.  You might find
 it easier to have next steps be a variable number of columns, one for
 each step for a particular step with empty entries for those that don't
 have many next steps.  I hope that makes some sort of sense...
 
 The table above would be converted to something like:
 
 #+begin_src dot
 digraph process {
   begin [label=Begin the process];
   choice1 [label=Decide if we are big or small];
 
   begin - choice1;
 
   ...
 }
 #+end_src
 
 I can't help with this at the moment (swamped at work) unfortunately but
 have a look at my GANTT code and see if that can give you a start.  I'll
 have more time in a couple of weeks hopefully.
 
 HTH,
 eric
 
 Footnotes: 
 [1]  http://www.graphviz.org/
 
 -- 
 : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
 : using Org-mode version 7.3 (release_7.3.78.ge04ba)

-- 

Bart Bunting

URSYS Pty. Ltd 
13 Burwood Rd.  Burwood  NSW  2134  Australia
Ph.   +61 2 8745 2811
Fax  +61 2 8745 2828

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Business process diagrams in org-mode

2010-11-13 Thread Bart Bunting
Hi All,

This is a little bit of a vague question but was hopeing that someone
may have some pointers.

I am trying to create some business processes with both textual
descriptions of the process in a table format with step numbers and
descriptions etc.  I was hopeing to be able to automagicaly convert the
tabular format into a business process diagram.

I was wondering if anyone has done this in the past using org-mode and
bable some how?

As I am blind I can't successfully create such diagrams using drawing
software.  It occurred to me though that it should (could) be possible
to create diagrams from sufficient information in a table structure.

The diagrams are the usual flow chart style of thing with steps and descision
points causing the flow to branch to another point.  I thought that if
we had something like the following it may be possible to generate a
diagram.



| Step| Description 
| Next Steps   |
|-+-+--|
| Begin   | Begin the process   
| Choice1  |
| Choice1 | Decide if we are big or small.  
| Big,Small|
| Big | If we are big then do big things
| End  |
| Small   | If we are small then figure out if we are really small or 
possibly big. | ReallySmall, Big |
| ReallySmall | Yes we are really small 
| End  |
| End | The end.
|  |
|-+-+--|


This would represent a process where we start, make a choice if we are big or 
small.  If we are big we do big things and end.  If we are small we make  a 
choice if we are really small or actually big.  If we decide we are actualy big 
then we go back to the big step.  If not we go on to the end.


Anyway just thought I'd ask in case someone had a suggestion how this could be 
done using org-mode.

Cheers

Bart

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Business process diagrams in org-mode

2010-11-13 Thread Thomas S. Dye

Aloha Bart,

On Nov 13, 2010, at 3:59 PM, Bart Bunting wrote:


Hi All,

This is a little bit of a vague question but was hopeing that someone
may have some pointers.

I am trying to create some business processes with both textual
descriptions of the process in a table format with step numbers and
descriptions etc.  I was hopeing to be able to automagicaly convert  
the

tabular format into a business process diagram.

I was wondering if anyone has done this in the past using org-mode and
bable some how?

As I am blind I can't successfully create such diagrams using drawing
software.  It occurred to me though that it should (could) be possible
to create diagrams from sufficient information in a table structure.

The diagrams are the usual flow chart style of thing with steps and  
descision

points causing the flow to branch to another point.  I thought that if
we had something like the following it may be possible to generate a
diagram.



| Step|  
Description 
 | Next  
Steps   |
|- 
+ 
-+ 
--|
| Begin   | Begin the  
process   |  
Choice1  |
| Choice1 | Decide if we are big or  
small.  | Big,Small|
| Big | If we are big then do big  
things| End  |
| Small   | If we are small then figure out if we are really  
small or possibly big. | ReallySmall, Big |
| ReallySmall | Yes we are really  
small |  
End  |
| End | The  
end. 
|  |
|- 
+ 
-+ 
--|



This would represent a process where we start, make a choice if we  
are big or small.  If we are big we do big things and end.  If we  
are small we make  a choice if we are really small or actually big.   
If we decide we are actualy big then we go back to the big step.  If  
not we go on to the end.



Anyway just thought I'd ask in case someone had a suggestion how  
this could be done using org-mode.


Cheers

Bart


This is certainly possible.  Eric Fraga has generated GANTT charts  
from an Org-mode table.  His approach uses an emacs-lisp helper  
function to convert the table to tikz code, and also a LaTeX  
stylesheet to define some tikz elements.  A similar approach might  
work for you.


Eric's post to the list is here:
http://lists.gnu.org/archive/html/emacs-orgmode/2010-10/msg00553.html

hth,
Tom

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Business process diagrams in org-mode

2010-11-13 Thread John Hendy
Hi Bart,


I think should be possible. I'm probably not the one but I think the PGF
TikZ package should work out alright. Eric Fraga from this mailing list
created a gantt chart in TikZ from a table and it makes me think that this
should definitely be possible. You could define some block shapes before
hand and tell TikZ what shape/color to make the node diagram based on the
table perhaps?

Here's a link where Eric provided his code:
http://article.gmane.org/gmane.emacs.orgmode/31824

http://article.gmane.org/gmane.emacs.orgmode/31824The code was based of
this TikZ mailing list code:
http://osdir.com/ml/tex.pgf.user/2007-07/msg7.html

http://osdir.com/ml/tex.pgf.user/2007-07/msg7.htmlHope that helps a
little. Eric might be able to advise a bit further? I don't know that I'd
say anything off the shelf exists, but perhaps in looking at his code it
could be done. I don't know the elisp well enough to help you further.


Good luck!
John

On Sat, Nov 13, 2010 at 7:59 PM, Bart Bunting b...@bunting.net.au wrote:

 Hi All,

 This is a little bit of a vague question but was hopeing that someone
 may have some pointers.

 I am trying to create some business processes with both textual
 descriptions of the process in a table format with step numbers and
 descriptions etc.  I was hopeing to be able to automagicaly convert the
 tabular format into a business process diagram.

 I was wondering if anyone has done this in the past using org-mode and
 bable some how?

 As I am blind I can't successfully create such diagrams using drawing
 software.  It occurred to me though that it should (could) be possible
 to create diagrams from sufficient information in a table structure.

 The diagrams are the usual flow chart style of thing with steps and
 descision
 points causing the flow to branch to another point.  I thought that if
 we had something like the following it may be possible to generate a
 diagram.



 | Step| Description
 | Next Steps   |

 |-+-+--|
 | Begin   | Begin the process
 | Choice1  |
 | Choice1 | Decide if we are big or small.
  | Big,Small|
 | Big | If we are big then do big things
  | End  |
 | Small   | If we are small then figure out if we are really small or
 possibly big. | ReallySmall, Big |
 | ReallySmall | Yes we are really small
 | End  |
 | End | The end.
  |  |

 |-+-+--|


 This would represent a process where we start, make a choice if we are big
 or small.  If we are big we do big things and end.  If we are small we make
  a choice if we are really small or actually big.  If we decide we are
 actualy big then we go back to the big step.  If not we go on to the end.


 Anyway just thought I'd ask in case someone had a suggestion how this could
 be done using org-mode.

 Cheers

 Bart

 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Business process diagrams in org-mode

2010-11-13 Thread John Hendy
On Sat, Nov 13, 2010 at 8:51 PM, Thomas S. Dye t...@tsdye.com wrote:

 Aloha Bart,


 This is certainly possible.  Eric Fraga has generated GANTT charts from an 
 Org-mode table.  His approach uses an emacs-lisp helper function to convert 
 the table to tikz code, and also a LaTeX stylesheet to define some tikz 
 elements.  A similar approach might work for you.

 Eric's post to the list is here:
 http://lists.gnu.org/archive/html/emacs-orgmode/2010-10/msg00553.html


Ha! We were typing at the same time. Great minds think alike I guess... or
perhaps great minds to make gantt charts from tables get referenced?

John



 hth,
 Tom

 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode



 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode