Index

mmo-workflow

1 symbol · generated 30 Sep 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
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
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:161

Get the config of the workflow

get config() set config(value)
Type
array

readonly

accessormmo-workflow.jhs:183

Get the readonly of the workflow

get readonly() set readonly(value)
Type
boolean

Methods18

block()

mmo-workflow.jhs:209

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:256

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:309

Get the content by id

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

loadStep(value, show)

mmo-workflow.jhs:435

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:473

Update the validity of the workflow

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

isValid()

mmo-workflow.jhs:545

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:556

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:597

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:617

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:636

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:668

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>