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

Admin console

At this point Gjallar has very few administration UIs (if any in fact) and relies on two "code consoles" - one for Process administrators and one for global administrators. The only difference today is what "self" is mapped to in the console - in a Process console "self" refers to the Process (Q2Process). In the global admin console it refers to the top model (Q2Model).

Global admin

Make someone global admin

"Add a user as global administrator"
self addAdministrator: (self findUser: 'peal').

"Add a user as a process administrator for a given process"
(self findProcessNamed: 'Support') addAdministrator: (self findUser: 'peal')

Create a process

"Create a new process by cloning an existing prototype"
mp := self createProcess: 'My process' fromPrototypeNamed: 'Simple prototype'.

"Find and add a user as process administrator, can be several.
This also of course gives that user access to the Process and imports the user into the Process for visibility."
mp addAdministrator: (self findUser: 'peal')

Create user

"Create a user, default password is the same as the username"
user := self newUser: 'peal'.
"Add more info"
user person email: 'someone@gjallar.se'; firstName: 'Per' lastName: 'Alfredsson'.

"Give a user access to a process, also imports the user into the Process for visibility."
user addProcess: (self findProcessNamed: 'Support').

Save a process prototype

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

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

Process admin

Give access to user

"Give a user access to this process"
user := self model findUser: 'peal'.
user addProcess: self

Define workflow

"Define workflow for the process."

"Create a new workflow"
flow := self newWorkflow.
flow name: 'Workflow'.

"Look up or create stages"
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'.
supplier := flow stageNamed: 'In work at supplier'.

"Mark some stages as closed stages"
solved isClosed: true.
rejected isClosed: true.

"Look up or create transitions"
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.

Edit workflow

"Remove or rename stages and transitions."
flow := self workflow.

"Remove stage"
flow removeStageNamed: 'Apple'.

"Look up stage and remove a transition" 
stage := flow stageNamed: 'Banana'.
stage removeTransitionNamed: 'Close'

"Rename stage (or transition)"
(flow stageNamed: 'Banana') renameFrom: 'Banana' to: 'Orange'

Forms

Create an extra form:
form := self newFormNamed: 'Case work tracking'.
form label: 'Case work tracking'.
form newInteger label: 'In house (hours)';
  description: 'Number of hours spent working inhouse on the case'.
form newInteger 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 a form:
self removeForm: (self findFormNamed: 'Case work tracking').

Change the label of the last field in the first form:
(forms first fields last) label: 'A new label'

Change the label of the last field in the first form:
(forms first fields last) label: 'A new label'

Example replacing a field in a form with a new one. The values for the old field will still hang around in cases since fields use their UUIDs as key.
f := forms second.
fi := Q2SelectionField new.
fi label: 'Responsible'; selector: #responsible; description: 'The user that is responsible for the case.'; useCompletion: true.
f fields removeAt: 4.
f addField: fi before: (f fields at: 4)