Skip to content

Dumping Ground Ticket #15

@FelixMZ2018

Description

@FelixMZ2018

A ticket for all helpers that make life easier

Workflow.updateAndReturnNewElement(updateFn(updateFnParams)){
returns {workflow: newWorkflow, element: newlyAddedElement}
}
monkey patch:

  static updateWorkflowAndReturnChangedElementId(workflow, fn) {
    const existingIds = GraphTools.getAllElementIds(workflow)
    const newWorkflow = fn(this, arguments)
    const newIds = GraphTools.getAllElementIds(newWorkflow)
    if (existingIds.length < newIds.length) {
      return {
        workflow: newWorkflow,
        changedId: newIds.find(id => !existingIds.includes(id)),
      }
    }
    if (existingIds.length > newIds.length) {
      return {
        workflow: newWorkflow,
        changedId: existingIds.find(id => !newIds.includes(id)),
      }
    }
  }
static validateFlow(workflow,flowId){
}

Workflow.validate does not work when gradually building a workflow, (e.g adding a new phase then connecting one end at a time

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions