Export into Documents
Target Document will be overwritten!
The content of your target document will be removed and replaced according to the export package and your mapping.
To select a target document start an export at an EA package which has not been configured for export or import before. Right-click the package in the project browser (not a model root) and select Specialize > LemonTree.Connect Polarion > Import/Export to Polarion
The package configuration dialog offers the options to select an available space and document.

On export all elements contained in the cofigured package and matching a mapping rule of the selected mapping xml will be placed inside the selected document according to their hierarchy in EA.
Workitems which are part of the document in Polarion but are not in the export scope of the selected package will be removed from the document.
Warning
Mapping an EA type to the Polarion type heading is not recommended on export. Reason being that heading is a special type which is usually not part of the workitem-type-enum.xml in the polarion project configuration.
Info
Document export uses the Recycle Bin instead of custom solution Obsolete Items.
Minimum Polarion user permissions to allow exporting to documents have to be configured in Polarion.

Changing a Document's status on export
To trigger document state transitions during document exports, workflow actions can be configured in:
%appdata%\LieberLieber\LemonTree.Connect.Polarion\config.json
ActionStartId specifies an action that transitions the document out of its current status at the start of the export.
ActionEndId specifies an action that transitions the document from the previously set state to its target status once the export finishes.
An valid example for the workflow configuration seen in the screenshot below would be:
"EnableWorkflow": true,
"ActionStartId": "publish",
"ActionEndId": "rework",

Workflow for document export
On document export Worklfow configuration is optional:
If workflow actions are not configured, document content is generated and the following is logged to EA System Output:
Document Worflow - enabled: True ('', '')
Create: [Workitems] - Ok
Create: [Document] - None: Create document - Workflow is not configured or enabled.
If workflow actions are configured and executed successfully, document state transitions are triggered before and after document content generation and following is logged to EA System Output:
Document Worflow - enabled: True ('ActionStartId', 'ActionEndId')
Create: [Workitems] - Ok
Create: [Document] - None: Create document - Workflow is enabled.
Create: [Document] - Ok: Create document - Document workflow executed successfully.
If workflow actions are configured but document state transitions not available, the workflow actions are skipped, document content generation still completes and the following is logged to EA System Output:
Document Worflow - enabled: True ('ActionStartId', 'ActionEndId')
Create: [Document] - Error: Create document - Document workflow action id 'ActionStartId' not found.
Create: [Document] - Error: Create document - cannot start document worklflow (result state: ActionNotFound).
Create: [Workitems] - Ok
Create: [Document] - None: Create document - Workflow is enabled.
Create: [Document] - Error: Create document - Document workflow action id 'ActionEndId' not found.
Create: [Document] - Ok: Create document - Document workflow executed successfully.