Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • OnSuccess: Bei einer erfolgreichen Dokumentgenerierung.

  • OnError: Falls während der Dokumentgenerierung ein Fehler auftritt, z.B. eine fehlerhafte Template-Id angegeben wird.

  • OnCancel: Wenn der Benutzer die Dokumentgenerierung z.B. über den Forms-Dialog abbricht.

  • OnExit: Nach Beendigung der Dokumentgenerierung, hierbei ist es egal, ob alles erfolgreich durchlief oder nicht.

Ablauf

Der Ablauf der Commands ist Abhängig vom Status der Dokumentgenerierung:

  • Erfolg:
    OnSuccess, dann OnExit

  • Fehler:
    OnError, dann OnExit

  • Abbruch:
    OnCancel, dann OnExit

  • Bei Fehler in OnSuccess:

  • OnError, dann OnExit

Bei Fehler in OnError, OnCancel, OnExit:

  • Sofortiger Abbruch

Beispiel:

Code Block
languagexml
<primedocsConnect>
  <Template Id="30b55516-80b5-41d7-801b-b31d6da376ac" />
  <Forms>
    <Value Key="Subject">Hello Connect</Value>
  </Forms>
  <Commands>
    <OnSuccess>
      <SaveFile FilenameFileName="\\MyServer\share\organization\...\documentxyz.docx"
                Overwrite="true"
                CreateFolder="true">
          <Document />
        </>SaveFile>
    </OnSuccess>
  </Commands>
</primedocsConnect>

In diesem Beispiel wird ein Dokument mit der Vorlage 30b55516-80b5-41d7-801b-b31d6da376ac mit dem Subject “Hello Connect” generiert.
Nach der erfolgreichen Dokumentgenerierung wird das Dokument über den SaveFile-Command in einen Ordner abgespeichert.

...

Code Block
languagexml
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="primedocsConnect">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Template">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="TagFilter">
								<xs:complexType>
									<xs:sequence>
										<xs:element maxOccurs="unbounded" name="Tag" type="xs:string" />
									</xs:sequence>
									<xs:attribute name="AllowTemplatePicker" type="xs:boolean" use="optional" />
								</xs:complexType>
							</xs:element>
						</xs:sequence>
						<xs:attribute name="Id" type="xs:string" use="optional" />
						<xs:attribute name="Version" type="xs:string" use="optional" />
					</xs:complexType>
				</xs:element>
				<xs:element name="DocumentLanguage">
					<xs:complexType>
						<xs:attribute name="Code" type="xs:string" use="required" />
					</xs:complexType>
				</xs:element>
				<xs:element name="Author">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="Profile">
								<xs:complexType>
									<xs:attribute name="Id" type="xs:string" use="required" />
									<xs:attribute name="ThemeId" type="xs:string" use="optional" />
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="Forms">
					<xs:complexType>
						<xs:sequence>
							<xs:element minOccurs="0" maxOccurs="unbounded" name="Value" type="ValueElement" />
							<xs:element minOccurs="0" maxOccurs="unbounded" name="Object" type="ObjectElement" />
							<xs:element minOccurs="0" maxOccurs="unbounded" name="ObjectCollection" type="ObjectCollectionElement" />
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="Data">
					<xs:complexType>
						<xs:sequence>
							<xs:element minOccurs="0" maxOccurs="unbounded" name="Value" type="ValueElement" />
							<xs:element minOccurs="0" maxOccurs="unbounded" name="Object" type="ObjectElement" />
							<xs:element minOccurs="0" maxOccurs="unbounded" name="ObjectCollection" type="ObjectCollectionElement" />
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="Commands">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="OnSuccess">
								<xs:complexType>
									<xs:sequence>
										                                        <xs:element name="SaveFile" minOccurs="0" maxOccurs="1" type="CommandSaveFileElement" />
										<xs:element name="OpenFile" minOccurs="0" maxOccurs="1" type="CommandOpenFileElement" />
										                                     <xs:element name="InvokeProcessOpenFile" minOccurs="0" maxOccurs="1" type="CommandInvokeProcessElementCommandOpenFileElement" />
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							
                                        <xs:element name="InvokeProcess" minOccurs="OnError0">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="InvokeProcess" minOccurs="0" maxOccurs=" maxOccurs="1" type="CommandInvokeProcessElement" />
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="OnExit">
                                        <xs:element name="InvokeUrl" minOccurs="0" maxOccurs="1" type="CommandInvokeUrlElement" />
									<xs:complexType>
									<xs:sequence>
										<xs:element name="InvokeProcess" minOccurs="0" maxOccurs="1" type="CommandInvokeProcessElement" />
									<</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="OnCancelOnError">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="InvokeProcessSaveFile" minOccurs="0" maxOccurs="1" type="CommandInvokeProcessElementCommandSaveFileElement" />
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<!-- Data / Forms Element Types -->

	<xs:complexType name="ValueElement">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="Key" type="xs:string" use="required" />
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="ObjectElement">
		<xs:sequence>
			<xs:element maxOccurs="unbounded" name="Value" type="ValueElement" />
		</xs:sequence>
		<xs:attribute name="Key" type="xs:string" use="required" />
	</xs:complexType>

	<xs:complexType name="ObjectCollectionElement">
		<xs:sequence>
			<xs:element maxOccurs="unbounded" name="Item">
				<xs:complexType>
					<xs:sequence>
						<xs:element maxOccurs="unbounded" name="Value" type="ValueElement" />
					</xs:sequence>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="Key	<xs:element name="InvokeProcess" minOccurs="0" maxOccurs="1" type="CommandInvokeProcessElement" />
                                        <xs:element name="InvokeUrl" minOccurs="0" maxOccurs="1" type="CommandInvokeUrlElement" />										
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="OnExit">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="SaveFile" minOccurs="0" maxOccurs="1" type="CommandSaveFileElement" />
										<xs:element name="InvokeProcess" minOccurs="0" maxOccurs="1" type="CommandInvokeProcessElement" />
                                        <xs:element name="InvokeUrl" minOccurs="0" maxOccurs="1" type="CommandInvokeUrlElement" />										
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="OnCancel">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="SaveFile" minOccurs="0" maxOccurs="1" type="CommandSaveFileElement" />
										<xs:element name="InvokeProcess" minOccurs="0" maxOccurs="1" type="CommandInvokeProcessElement" />
                                        <xs:element name="InvokeUrl" minOccurs="0" maxOccurs="1" type="CommandInvokeUrlElement" />										
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<!-- Data / Forms Element Types -->
	<xs:complexType name="ValueElement">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="Key" type="xs:string" use="required" />
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="ObjectElement">
		<xs:sequence>
			<xs:element maxOccurs="unbounded" name="Value" type="ValueElement" />
		</xs:sequence>
		<xs:attribute name="Key" type="xs:string" use="required" />
	</xs:complexType>
	<xs:complexType name="ObjectCollectionElement">
		<xs:sequence>
			<xs:element maxOccurs="unbounded" name="Item">
				<xs:complexType>
					<xs:sequence>
						<xs:element maxOccurs="unbounded" name="Value" type="ValueElement" />
					</xs:sequence>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="Key" type="xs:string" use="required" />
	</xs:complexType>

    <!-- Command Types -->
    <xs:complexType name="CommandSaveFileElement">
        <xs:sequence>
            <xs:element name="Document" minOccurs="0" maxOccurs="1" type="DocumentElement" />
            <xs:element name="Report" minOccurs="0" maxOccurs="1" />
        </xs:sequence>
        <xs:attribute name="FileName" type="xs:string" use="optional" />
        <xs:attribute name="field-FileName" type="xs:string" use="optional" />
        <xs:attribute name="Overwrite" type="xs:boolean" use="optional" />
        <xs:attribute name="CreateFolder" type="xs:boolean" use="optional" />
    </xs:complexType>
    <xs:complexType name="CommandOpenFileElement">
        <xs:attribute name="FileName" type="xs:string" use="optional" />
        <xs:attribute name="field-FileName" type="xs:string" use="optional" />
    </xs:complexType>
    <xs:complexType name="CommandInvokeProcessElement">
        <xs:sequence>
            <xs:element name="Arguments" minOccurs="0" maxOccurs="1" type="ElementWithFieldSupport" />
        </xs:sequence>
        <xs:attribute name="Name" type="xs:string" use="required" />
    </xs:complexType>
    <xs:complexType name="CommandInvokeUrlElement">
        <xs:sequence>
            <xs:element name="Step" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="Request">
                            <xs:complexType>
                                <xs:sequence>
                                    <xs:element name="Url"  minOccurs="0" maxOccurs="1" type="ElementWithFieldSupport" />
                                    <xs:element name="Body" minOccurs="0" type="ElementWithFieldSupport" />
                                    <xs:element name="Header" minOccurs="0" maxOccurs="unbounded" type="CommandInvokeUrlElementRequestHeaderOrFormElement" />
                                </xs:sequence>
                                <xs:attribute name="Method" type="xs:string" use="required" />
                            </xs:complexType>
                        </xs:element>
                        <xs:element name="MultipartFormDataRequest" minOccurs="0" maxOccurs="1">
                            <xs:complexType>
                                <xs:sequence>
                                    <xs:element name="File">
                                        <xs:complexType>
                                            <xs:sequence>
                                                <xs:element name="Document" minOccurs="0" maxOccurs="1" type="DocumentElement" />
                                                <xs:element name="Report" minOccurs="0" maxOccurs="1" />
                                            </xs:sequence>
                                            <xs:attribute name="Name" type="xs:string" use="optional" />
                                            <xs:attribute name="ContentType" type="xs:string" use="optional" />
                                            <xs:attribute name="FileName" type="xs:string" use="optional" />
                                            <xs:attribute name="field-FileName" type="xs:string" use="optional" />
                                        </xs:complexType>
                                    </xs:element>
                                    <xs:element name="Url" type="ElementWithFieldSupport" />
                                    <xs:element name="Header" maxOccurs="unbounded" minOccurs="0"  type="CommandInvokeUrlElementRequestHeaderOrFormElement" />
                                    <xs:element name="FormData" maxOccurs="unbounded" minOccurs="0" type="CommandInvokeUrlElementRequestHeaderOrFormElement" />
                                </xs:sequence>
                            </xs:complexType>
                        </xs:element>
                        <xs:element name="Response" minOccurs="0" maxOccurs="1">
                            <xs:complexType>
                                <xs:sequence>
                                    <xs:element name="Property" maxOccurs="unbounded" minOccurs="0">
                                        <xs:complexType>
                                            <xs:attribute name="Name" type="xs:string" use="required" />
                                            <xs:attribute name="JsonPath" type="xs:string" use="optional" />
                                            <xs:attribute name="XPath" type="xs:string" use="optional" />
                                        </xs:complexType>
                                    </xs:element>
                                </xs:sequence>
                            </xs:complexType>
                        </xs:element>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="CommandInvokeUrlElementRequestHeaderOrFormElement">
        <xs:attribute name="Name" type="xs:string" use="required" />
        <xs:attribute name="Value" type="xs:string" use="optional" />
        <xs:attribute name="field-Value" type="xs:string" use="requiredoptional" />
	    </xs:complexType>

	    <!-- CommandCommon TypesElements -->
    	<xs:complexType name="CommandSaveFileElementElementWithFieldSupport">
		<xs:attribute name="Filename" type        <xs:simpleContent>
            <xs:extension base="xs:string" use="required" />
		>
                <xs:attribute name="Overwritefield-Content" type="xs:booleanstring" use="optional" />
		<xs:attribute name="CreateFolder" type="xs:boolean" use="optional" />
	            </xs:complexType>extension>
 	<xs:complexType name="CommandOpenFileElement">
		<xs:attribute name="Filename" type="xs:string" use="required" />
	       </xs:simpleContent>
    </xs:complexType>

	    <xs:complexType name="CommandInvokeProcessElementDocumentElement">
		<xs:attribute name="Name" type="xs:string" use="required" />
		        <xs:attribute name="ArgumentsConversion" type="xs:string" use="optional" />
	    </xs:complexType>

</xs:schema>