Visa denna sidaEditera denna sidaLås denna sidaLänkar till denna sidaBilagor till denna sidaHistorik för denna sidaSwikins toppSenaste ändringarSök i SwikinHjälpguide

Default objects

When a fresh Gjallar system is installed it has a few user accounts already created:
There is also a few other objects created:

Note: see Q2Model>>initializeBasics

At this point you need to login as "root" and start creating your own Processes (and/or Process prototypes, users etc) using the Admin Console which is a simple but useful administration mechanism by which you enter Smalltalk script snippets and run them in the server.

Below is a selection of useful snippets you can use.

Administration scripts

When using the Admin Console available to the builtin user "root" (or to any user that has been given global administration rights as below) the scripts are run in the context of the top domain object (Q2Model).
"Create a new user, by default the password will be the same as the username. Also add personal information."
user := self newUser: 'loke'.
user person email: 'loke@valhall.org'; firstName: 'Loke' lastName: 'Evil'.

"Add a user as a global Gjallar administrator."
self addAdministrator: (self findUserNamed: 'loke').

"Create a new Process by copying en existing prototype."
myproc := self createProcess: 'My process' fromPrototypeNamed: 'Simple prototype'.

"Assign a user as an administrator of a selected Process. This also gives that user access to the Process."
(self findProcessNamed: 'My process') addAdministrator: (self findUserNamed: 'loke')

"Give a user access to a Process, this also imports the user into the Process for visibility."
(self findUserNamed: 'loke') addProcess: (self findProcessNamed: 'Some other process').

"Create a new Process prototype from scratch"
self addProcessPrototype: (self newProcessPrototype: 'Support prototype').

"Create a Process prototype from an existing process"
self addProcessProtype: ((self findProcessNamed: 'My process') copyPrototype name: 'New prototype')

"Define the workflow graph for a Process - login as one of the users you assigned as Process administrator and use their Process admin console. The messages below lookup or create components if they are missing, so this script can be run multiple times without having to recreate the Workflow completely."

"Get the workflow object from the Process"
flow := self workflow.
flow name: 'Workflow'.

"Lookup or create stages and reference them using temporary variables"
new := flow stageNamed: 'New'.
inwork := flow stageNamed: 'In work'.
inactive := flow stageNamed: 'Inactive'.
reopened := flow stageNamed: 'Reopened'.
rejected := flow stageNamed: 'Rejected'.
solved := flow stageNamed: 'Solved'.
waiting := flow stageNamed: 'Waiting for user response'.

"Mark a sub selection of stages as being closed."
solved isClosed: true.
rejected isClosed: true.

"Lookup or create transitions between stages"
new transition: 'Start working' to: inwork.
new transition: 'In work at supplier' to: supplier.
supplier transition: 'Work from supplier' to: inwork.
inwork transition: 'Supplier quit working' to: supplier.
inwork transition: 'Work paused' to: inactive.
inactive transition: 'Solved from inactive' to: solved.
solved transition: 'Reopen case' to: reopened.
reopened transition: 'Solved from reopened' to: solved.
reopened transition: 'Continue work from reopened' to: inwork.
inwork transition: 'Rejected from work' to: rejected.
new transition: 'Wait for more info' to: waiting.
waiting transition: 'Continue working' to: inwork.


"Remove or rename stages or transitions"
flow := self workflow.
flow removeStageNamed: 'Apple'.
stage := flow stageNamed: 'Banana'.
stage removeTransitionNamed: 'Close'
(flow stageNamed: 'Banana') renameFrom: 'Banana' to: 'Orange'

"Create a new workflow - do NOT do this if you have created cases!"
self workflow: (Q2Workflow process: self)

"Create an extra form with three fields"
form := Qself newFormNamed: 'Work tracking'.
form label: 'Work tracking'.

form newText label: 'In house (hours): '; description: 'Number of hours spent working inhouse on the case'

form newText label: 'Travelling (hours): '; description: 'Number of hours spent travelling'.

form newText label: 'Additional information: '; multiline: true;
  description: 'Describe any more information regarding time spent.'.


"Remove an existing Form."
self removeForm: (self findFormNamed: 'Work tracking').