Index

mmo-workflow

1 symbol · generated 5 Oct 2026

element

mmo-workflow

mmo-workflow.jhs:1

Workflow element to display a workflow

<mmo-workflow readonly step></mmo-workflow>
Extends
CustomElement
1. Config explanation: the configuration is an array of elements the type of the elements is defined by the `type` property: - title: - type: 'title' - id: {string} the element's id - class: {string} (css class) - icon: {string} - level: {int} header's level (default 2) - text: {string} - html: - type: 'html' - id: {string} the element's id - class: {string} (css class) - text: {string} html - step: - type: 'step' - id: {string} the element's id - label: {string} (step label) - readonly: {boolean} (true if the step is read only, false if it's not) is current step in readonly mode ? - view: {string} view id to load - completed: {?boolean} if null, step has not begun - error: {boolean} - path: {string} the basepath for the given view - info - type: 'info' - id: {string} the element's id - label: {string} (step label) - view: {string} view id to load - path: {string} the basepath for the given view - validation: - type: 'validation' - id: {string} - label: {string} - view: {string} view id to load - path: {string} the basepath for the given view View MUST declare a function validate(): bool telling if the validation process is done: <script>this.validate = function() {return false;}</ script>

Index

readonlyif true, the workflow is readonly
stepthe current step of the workflow
ViewDefault static readonly accessor
data accessorGet the data of the workflow
config accessorGet the config of the workflow
readonly accessorGet the readonly of the workflow
entity readonly accessorGet the entity of the workflow
step accessorGet the step of the workflow
constructor()
init()
block()Freeze the workflow while something is running: the buttons refuse clicks and the shell shows it.
unblock()Give the workflow back to the user (block).
save()Save the workflow
loadEntityFromUrl(path, collection, entityClass)Load an entity from the parameters in the url
setValidated()Set the validated of the workflow
getContentById(id)Get the content by id
next()Go to the next step
previous()Go to the previous step
goto(index)Go to a step clicked in the stepper: unlike next/previous, a validation already passed is shown rather than skipped, so that its state can be read.
loadStep(value, show)Show one step: its view is rendered the first time it is reached, then kept.
updateValidity(step)Update the validity of the workflow
stepOf(node)The step whose view holds a node.
isValid()Whether the workflow can be validated as it stands.
renderTimeline(root, content)Render the timeline of the workflow
renderTitle(root, content)Render one title entry of the stepper: a heading between two steps.
renderHtml(root, content)Render one html entry of the stepper: a free block, for a note or a summary.
renderStep(root, content)Render a step/info item in the stepper
renderValidation(root, content, valid)Render a validation item in the stepper

Attributes2

Properties6

config

accessormmo-workflow.jhs:164

Get the config of the workflow

get config() set config(value)
Type
array

readonly

accessormmo-workflow.jhs:186

Get the readonly of the workflow

get readonly() set readonly(value)
Type
boolean

Methods20

block()

mmo-workflow.jhs:212

Freeze the workflow while something is running: the buttons refuse clicks and the shell shows it.

block()
returnsvoid

loadEntityFromUrl(path, collection, entityClass)

mmo-workflow.jhs:259

Load an entity from the parameters in the url

loadEntityFromUrl(path, collection, entityClass)
pathstring- The path to store the entity in data
collectionstring- The entity's collection
entityClassstring- The entity's class

getContentById(id)

mmo-workflow.jhs:321

Get the content by id

getContentById(id)
idstring- The id of the content
returnsElementThe content

goto(index)

mmo-workflow.jhs:454

Go to a step clicked in the stepper: unlike next/previous, a validation already passed is shown rather than skipped, so that its state can be read.

goto(index)
indexnumber- the step's index in the config
returnsvoid
workflow.goto(6);

loadStep(value, show)

mmo-workflow.jhs:466

Show one step: its view is rendered the first time it is reached, then kept.

loadStep(value, show = true)
valuestring- the step's id
show = trueboolean- false to prepare the view without showing it
returnsvoid

updateValidity(step)

mmo-workflow.jhs:504

Update the validity of the workflow

updateValidity(step = null)
step = nullnumber- The step
returnsbooleanThe validity

stepOf(node)

mmo-workflow.jhs:593

The step whose view holds a node.

stepOf(node)
nodeNode
returns?numbernull when no step's view holds it
workflow.stepOf(event.target)

isValid()

mmo-workflow.jhs:604

Whether the workflow can be validated as it stands.

isValid()
returnsbooleantrue when every step the workflow has been through is valid

renderTimeline(root, content)

mmo-workflow.jhs:615

Render the timeline of the workflow

renderTimeline(root, content)
rootHTMLUListElement- The stepper <ul> element
contentarray- The content of the workflow

renderTitle(root, content)

mmo-workflow.jhs:656

Render one title entry of the stepper: a heading between two steps.

renderTitle(root, content)
rootHTMLElement- the stepper
contentobject- the entry: text, icon, level
returnsHTMLElement

renderHtml(root, content)

mmo-workflow.jhs:676

Render one html entry of the stepper: a free block, for a note or a summary.

renderHtml(root, content)
rootHTMLElement- the stepper
contentobject- the entry: text, id, and a tone class
returnsHTMLElement

renderStep(root, content)

mmo-workflow.jhs:695

Render a step/info item in the stepper

renderStep(root, content)
rootHTMLUListElement- The stepper <ul> element
contentobject- The content config
returnsHTMLLIElementThe created <li>

renderValidation(root, content, valid)

mmo-workflow.jhs:729

Render a validation item in the stepper

renderValidation(root, content, valid)
rootHTMLUListElement- The stepper <ul> element
contentobject- The content config
validboolean- The validity
returnsHTMLLIElementThe created <li>