Integrating Office for the web with document workflow processes¶
This documentation is for an upcoming feature and may undergo dramatic changes prior to final release. Pre-release features are available in the Test environment only.
Hosts can integrate Office for the web into workflow processes, so that users can use UI directly in Office for the web to manage documents in a workflow.
For example, consider a host that caters to customers in the education field. The host may provide a way for students to submit documents as part of an assignment. With the Office for the web workflow features, hosts can configure Office for the web to display a Submit button directly in the Office for the web UI that, when activated, will display host-specific UI allowing the student to submit the document.
Supporting workflows in Office for the web¶
In Office for the web, documents participating in workflows display a button that takes the place of the Share button. The button’s text is specific to the WorkflowType.
Office for the web workflow button text
In Office for the web, the Assign and Submit workflow types are mutually exclusive. Only one of the two workflow types should be set for a given document session.
Much like Share, when clicked, the workflow button can either navigate to a URL in a new browser tab/window or send a message to the host frame.
To navigate to a URL, set the WorkflowUrl property to the URL that Office for the web should navigate to.
To post a message to the host frame instead, set the WorkflowPostMessage property to
true. When clicked,
Office for the web will send the
UI_Workflow message to the host frame. The message includes the type of workflow that
the document is participating in.
Office for the web will always save the latest copy of the document to the host when the workflow UI is activated. This ensures that the host always has the latest copy of the document in order to use it in the workflow.
WOPI clients, including Office for the web, do not understand what the workflow is and how it behaves. In other words, when you use the WorkflowUrl or WorkflowPostMessage properties, Office for the web will display the workflow button and behave appropriately when triggered. However, if, for example, you wish to prevent a user from submitting the same document multiple times, you must handle that in your own UI. In other words, Office for the web and other WOPI clients do not know anything about the workflow process except that the document is participating in a workflow so that the appropriate UI can be displayed. This provides the WOPI host great flexibility in their workflows, but the host is also responsible for managing the workflow as a whole.