[Setools] gjallar creating processes

goran at krampe.se goran at krampe.se
Wed Sep 20 11:08:12 UTC 2006


Hi!

=?ISO-8859-15?B?SGVyYmVydCBL9m5pZw==?= <herbertkoenig at gmx.net> wrote:
> Hello,
> 
> I created a process by
> addProcessPrototype.. and then crateProcess:fromPrototypeNamed:..
> and assigned an administrator.
> 
> Then I created a workflow with several stages, like described in the
> swiki.
> 
> This worked, in that the process console showed all stages lined up
> beside each other.

The console always shows the last object of the expression - exactly
like "print it" does in Squeak. Or perhaps you mean the graphical
"Processes" view?

> Next step was to add transitions like:
> flow := self workflow.
> stage := flow findStage: 'In'.
> "findStageNamed seems to only return the name, not the stage."
> stage transition: 'Check if infos complete' to: 'Check infos'.
> 
> and so on with several transitions.
> 
> This produced a workflow where e.g. the stage 'Check infos' was
> duplicated in the graph. Once hanging under 'In' and once in the
> original position besides 'In'.
> 
> Further transitions from 'Check infos' originate in the original stage
> and all duplicate their destination.
> 
> What am I doing wrong?

Well, not exactly sure but:

First of all #findStageNamed: should do exactly what it says.
#findStage: is old and I just removed it. :) If it can not find a stage
with that EXACT name, then it will return nil.

#stageNamed: on the other hand tries to find a stage - but if it does
not find it it will create a new one. So if you use #stageNamed: like
the example does - make sure you type the names exactly right or you
could accidentally create new stages.

If you check the example you see that I assign the stages to local
variables in the first phase, which I then use below when creating the
transitions. If you want to create transitions in a separate second step
then you will need to lookup the stages like for example:

(flow findStageNamed: 'First stage') transition: 'My transition' to:
(flow findStageNamed: 'Second stage')

If you want to start over (which is dangerous if you have cases created)
then you can use:

	flow := self newWorkflow.

to get a new clean one. It is probably easiest to do it as in the
example - create both stages and transitions (using #stageNamed: and
#transition:to:) in one sweep by using local variables for the stages.
Then take a look in the "Processes" view to see the graph. Adjust by
running it all again using newWorkflow at the top, until you get it
right. :)

regards, Göran


More information about the Setools mailing list