Module: process-import

Methods

(static) analyseBPMNFile(bpmn, htmlData, $store) → {Promise.<{processData: {id: string, name: string, description: string, departments: Array, userTasks: UserTaskInfo, htmlData: HtmlInfo}}>}

Analyses a BPMN if

  1. the process exists
  2. if its called processes exist
  3. if user task data exists or needs to be added
Parameters:
Name Type Description
bpmn string | object

the process definition as XML string or BPMN-Moddle Object

htmlData undefined | Map.<String, HtmlInfo>

the html data that was provided alongside the bpmn

$store *

the vuex store to look up processes

Source:
Returns:
  • the process info needed for an import
Type
Promise.<{processData: {id: string, name: string, description: string, departments: Array, userTasks: UserTaskInfo, htmlData: HtmlInfo}}>

(static) getProcessFiles(file) → {Promise.<Array.<ImportInfo>>}

Gets the process from the selected file

Parameters:
Name Type Description
file File

the file the user has selected via the web interface, https://developer.mozilla.org/en-US/docs/Web/API/File

Source:
Throws:
  • if importedFile is empty

    Type
    Error
  • if the given file can not be converted to a bpmn-moddle object (multiple possible reasons)

    Type
    Error
Returns:

the process information gotten through the import

Type
Promise.<Array.<ImportInfo>>

(static) readZipAsync(zipBlob) → {Promise.<Array.<{fileName: string, bpmnFileAsXml: string, htmlData: HtmlInfo}>>}

Read zip files and searches for bpmn files and user tasks for each bpmn file

Parameters:
Name Type Description
zipBlob Blob

zip file containing several bpmn files

Source:
Returns:
  • array containing all the provided information about the contained processes
Type
Promise.<Array.<{fileName: string, bpmnFileAsXml: string, htmlData: HtmlInfo}>>

(inner) readFileAsText(file) → {Promise.<string>}

Async read file with FileReader as text and resolve the returned Promise once the file content is loaded

Parameters:
Name Type Description
file Blob | File

selected bpmn file

Source:
Returns:

Promise containing the content of the file as text

Type
Promise.<string>

Type Definitions

ImportInfo

Type:
  • Object
Properties:
Name Type Attributes Description
fileName String <optional>

the name of the file the user task is (supposed to be) stored in

html String
state String

the current state this html is in (missing|existing|obsolete)

fileName String

name of the file the html of this user task is stored in

implementation String

how the user task is implemented

missingAttributes Boolean

if the fileName and implementation need to be added to the bpmn

bpmnFileAsXml String

the process definition as a string

bpmnFileAsObject Object

the process as a bpmn-moddle-object

htmlData HtmlInfo

the html information provided with the process

Source: