Manual:Extension/Workflows/Activity/EditPage: Difference between revisions

No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 2: Line 2:
The ''EditWikiPage'' activity appends content to an existing wiki page.  
The ''EditWikiPage'' activity appends content to an existing wiki page.  
{| class="wikitable" style=""
{| class="wikitable" style=""
! colspan="2" style="background-color:rgb(234, 236, 240);text-align:center;" |'''Short profile'''
! colspan="2" style="background-color:rgb(234, 236, 240);text-align:center;" class="" |'''Short profile'''
|-
|-
| style="" |Name
| style="" |Name
Line 22: Line 22:
Each input property can provide a default value if no other value is set by the workflow.
Each input property can provide a default value if no other value is set by the workflow.
{| class="wikitable" style="width:100%;"
{| class="wikitable" style="width:100%;"
! style="background-color:rgb(234, 236, 240);text-align:center;" |Name of property
! style="background-color:rgb(234, 236, 240);text-align:center;" class="" |Name of property
!Source
! style="background-color:rgb(234, 236, 240);text-align:center;" class="" |Description
! style="background-color:rgb(234, 236, 240);text-align:center;" |Description
!Possible values
!Possible values
! style="background-color:rgb(234, 236, 240);text-align:center;" |Type
! style="background-color:rgb(234, 236, 240);text-align:center;" class="" |Type
|-
|-
| style="" |<code>title</code>
| style="" |<code>title</code>
|<nowiki>-</nowiki>
| style="" |Name of the wiki page that will be edited by this activity.
| style="" |Name of the wiki page that will be edited by this activity.
|
|
Line 35: Line 33:
|-
|-
|<code>user</code>
|<code>user</code>
|  -
|Name of user that will be shown as making the edit.
|Name of user that will be shown as making the edit.
|Default value: ''MediaWiki default''
|Default value: ''MediaWiki default''
Line 41: Line 38:
|-
|-
|<code>content</code>
|<code>content</code>
|  -
|Content that will be added to the wiki page.
|Content that will be added to the wiki page.
|
|
Line 47: Line 43:
|-
|-
|<code>mode</code>
|<code>mode</code>
|  -
|How the content is added to the wiki page.  
|How the content is added to the wiki page.  
|
|
Line 56: Line 51:
|-
|-
|<code>minor</code>
|<code>minor</code>
|  -
|The edit will be marked as ''major'' or ''minor'' revision.
|The edit will be marked as ''major'' or ''minor'' revision.
|
|
Line 66: Line 60:
=== Output properties ===
=== Output properties ===
{| class="wikitable" style="width:100%;"
{| class="wikitable" style="width:100%;"
! style="background-color:rgb(234, 236, 240);text-align:center;" |Name of property
! style="background-color:rgb(234, 236, 240);text-align:center;" class="" |Name of property
!Source
! style="background-color:rgb(234, 236, 240);text-align:center;" class="" |Description
! style="background-color:rgb(234, 236, 240);text-align:center;" |Description
! style="background-color:rgb(234, 236, 240);text-align:center;" class="" |Type
! style="background-color:rgb(234, 236, 240);text-align:center;" |Type
|-
|-
|<code>revisionId</code>
|<code>revisionId</code>
| -
|The revision ID of the edited page.  
|The revision ID of the edited page.  
|string
|string
|-
|-
|<code>timestamp</code>
|<code>timestamp</code>
| -
|The revision time of the edited page.
|The revision time of the edited page.
|int
|timestamp
|}
|}


== Usage ==
== Element ==
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<bpmn:task id="Activity_18egh9o" name="Edit page">
<bpmn:task id="Activity_18egh9o" name="Edit page">
Line 97: Line 88:
<bpmn:property name="timestamp"/>
<bpmn:property name="timestamp"/>
</bpmn:task>
</bpmn:task>
</syntaxhighlight>
== Example ==
In this example, when the workflow runs on any wikipage, The page Testpage1 is appended with the text  <code><username of initiator> read the page.</code><syntaxhighlight lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:wf="http://hallowelt.com/schema/bpmn/wf">
    <bpmn:process id="EditWikiPage-Workflow" isExecutable="false">
        <bpmn:extensionElements>
            <wf:context>
                <wf:contextItem name="pageId"/>
            </wf:context>
        </bpmn:extensionElements>
        <bpmn:startEvent id="TheStart">
            <bpmn:outgoing>FromTheStartToEditWikiPage</bpmn:outgoing>
        </bpmn:startEvent>
        <bpmn:sequenceFlow id="FromTheStartToEditWikiPage" sourceRef="TheStart" targetRef="EditWikiPage" />
      <bpmn:task id="EditWikiPage" name="Edit page">
    <bpmn:extensionElements>
<wf:type>edit_page</wf:type>
</bpmn:extensionElements>
<bpmn:property name="title" default="Testpage1" validation="required"/>
<bpmn:property name="user" default="{{{initiator}}}" validation="existing-user"/>
<bpmn:property name="content" default="{{{initiator}}} read the page"/>
<bpmn:property name="mode" default="append"/> <!-- ALlowed: append, replace, prepend -->
<bpmn:property name="minor" default="0"/>
<!-- Output properties -->
<bpmn:property name="revisionId"/>
<bpmn:property name="timestamp"/>
  <bpmn:incoming>FromTheStartToEditWikiPage</bpmn:incoming>
  <bpmn:outgoing>FromEditWikiPageToTheEnd</bpmn:outgoing>
</bpmn:task>
        <bpmn:sequenceFlow id="FromEditWikiPageToTheEnd" sourceRef="EditWikiPage" targetRef="TheEnd" />
        <bpmn:endEvent id="TheEnd">
            <bpmn:incoming>FromEditWikiPageToTheEnd</bpmn:incoming>
        </bpmn:endEvent>
    </bpmn:process>
</bpmn:definitions>
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 13:24, 25 October 2023

Description

The EditWikiPage activity appends content to an existing wiki page.

Short profile
Name EditWikiPage
Async Yes
BPMN type bpmn:Task
BPMN Extension Element "wf:type" edit_page

Properties

Input properties

Each input property can provide a default value if no other value is set by the workflow.

Name of property Description Possible values Type
title Name of the wiki page that will be edited by this activity. string
user Name of user that will be shown as making the edit. Default value: MediaWiki default string
content Content that will be added to the wiki page. string
mode How the content is added to the wiki page.
  • append: Content is added at the end of the page.
  • replace: Content replaces all existing page content.
  • prepend: Content is added at the beginning of the page.
string
minor The edit will be marked as major or minor revision.
  • 1 (=minor revision)
  • 0 (=major revision)
int

Output properties

Name of property Description Type
revisionId The revision ID of the edited page. string
timestamp The revision time of the edited page. timestamp

Element

<bpmn:task id="Activity_18egh9o" name="Edit page">
    <bpmn:extensionElements>
		<wf:type>edit_page</wf:type>
	</bpmn:extensionElements>
	<bpmn:property name="title" default="Some page" validation="required"/>
	<bpmn:property name="user" default="Mediawiki default" validation="existing-user"/>
	<bpmn:property name="content" default="This is my test at editing"/>
	<bpmn:property name="mode" default="append"/> <!-- ALlowed: append, replace, prepend -->
	<bpmn:property name="minor" default="1"/>
	<!-- Output properties -->
	<bpmn:property name="revisionId"/>
	<bpmn:property name="timestamp"/>
</bpmn:task>

Example

In this example, when the workflow runs on any wikipage, The page Testpage1 is appended with the text <username of initiator> read the page.

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:wf="http://hallowelt.com/schema/bpmn/wf">
    <bpmn:process id="EditWikiPage-Workflow" isExecutable="false">
        <bpmn:extensionElements>
            <wf:context>
                <wf:contextItem name="pageId"/>
            </wf:context>
        </bpmn:extensionElements>
        <bpmn:startEvent id="TheStart">
            <bpmn:outgoing>FromTheStartToEditWikiPage</bpmn:outgoing>
        </bpmn:startEvent>
        <bpmn:sequenceFlow id="FromTheStartToEditWikiPage" sourceRef="TheStart" targetRef="EditWikiPage" />
       <bpmn:task id="EditWikiPage" name="Edit page">
    <bpmn:extensionElements>
		<wf:type>edit_page</wf:type>
	</bpmn:extensionElements>
	<bpmn:property name="title" default="Testpage1" validation="required"/>
	<bpmn:property name="user" default="{{{initiator}}}" validation="existing-user"/>
	<bpmn:property name="content" default="{{{initiator}}} read the page"/>
	<bpmn:property name="mode" default="append"/> <!-- ALlowed: append, replace, prepend -->
	<bpmn:property name="minor" default="0"/>
	<!-- Output properties -->
	<bpmn:property name="revisionId"/>
	<bpmn:property name="timestamp"/>
	  <bpmn:incoming>FromTheStartToEditWikiPage</bpmn:incoming>
	  <bpmn:outgoing>FromEditWikiPageToTheEnd</bpmn:outgoing>
</bpmn:task>
        <bpmn:sequenceFlow id="FromEditWikiPageToTheEnd" sourceRef="EditWikiPage" targetRef="TheEnd" />
        <bpmn:endEvent id="TheEnd">
            <bpmn:incoming>FromEditWikiPageToTheEnd</bpmn:incoming>
        </bpmn:endEvent>
    </bpmn:process>
</bpmn:definitions>




To submit feedback about this documentation, visit our community forum.

No categories assignedEdit

Discussions