Document
Document type and the document – are abstract objects for a workflow, with their physical meaning undefined within a workflow framework. Document type represents a certain association of documents. Document type and the document may not have physical representation, i. e. they can be purely virtual. Workflow is operating with the document via document class, which realizes interface of IBPWorkflowDocument.
Document type and the document are defined by their identifiers, which are presented as the tuple of three elements: module code, document class name and certain code (as a rule, element code). For example,
array("iblock", "CIBlockDocument", "458")где
- iblock - information blocks module code,
- CIBlockDocument - document class name,
- 458 - information block element ID.
Workflow template is associated to the document type. When the assocation is established, it is determined, whether the workflow to create a new document is going to be lauched automatically.
Workflow always is performed for a specific document. A random number of workflows can be launched for the same document.
Document class shall implement methods of IBPWorkflowDocument interface. This interface contains methods, which are required for the workflow to work with a document.
For the workflow to work with an object, the following must be selected:
- what would be deemed as the document,
- what could be the document type,
- what identifiers the document and document type will have.
Additionally, document class must be implemented in accordance with the IBPWorkflowDocument interface. For the full-fledged handling of a workflow, it is necessary, when creating documents to organize creation and launching of workflows, configured for autorun. An interface to create workflow templates must be connected. Also, users must be provided with an interface to manage launched workflows. Readymade API is available to create the abovelisted features.