Examples of Created XML Documents

This example is based on the following scenario. WebFlow WS00000000 runs in SAP System A, starts workflow WS99999999 in SAP System B and waits for feedback. The text test WebFlow is written into the import parameter Question for the workflow to be started. Once workflow WS99999999 is successfully executed, the export parameter Answer contains the text test successful .

The following XML documents are created by the system.

1. XML document to start workflow WS99999999

<?xml version="1.0" ?>
<WfMessage Version="SAP.1.0">
 <WfMessageHeader>
  <Request>
   <ResponseRequired>Yes</ResponseRequired>
  </Request>
    <Key>HTTP://www.xyz.com/scripts/wgate/wf_handler/!?~protocol=01&~localkey=WS99999999</Key>
    <Operation>CreateProcessInstance</Operation>
 </WfMessageHeader>
 <WfMessageBody>
  <CreateProcessInstance>
    <Key>HTTP://www.xyz.com/scripts/wgate/wf_handler/!?~protocol=01&~localkey=WS999999999</Key>
    <ObserverKey>http://www.abc.com/scripts/wgate/wf_handler/!?~protocol=01&~localkey=000000111669</ObserverKey>
   <ContextData>
    <QUESTION>test WebFlow</QUESTION>
   </ContextData>
   <StartImmediately>Yes</StartImmediately>
  </CreateProcessInstance>
 </WfMessageBody>
</WfMessage

2. http reply as XML document when workflow is WS99999999 started

<?xml version="1.0" ?>
<WfMessage Version="SAP.1.0">
 <WfMessageHeader>
  <Response />
   <Key>HTTP://www.xyz.com/scripts/wgate/wf_handler/!?~protocol=01&~localkey=WS99999999</Key>
  <Operation>CreateProcessInstance</Operation>
 </WfMessageHeader>
 <WfMessageBody>
  <CreateProcessInstance>
    <ProcessInstanceKey>000000112606</ProcessInstanceKey>
  </CreateProcessInstance>
 </WfMessageBody>
</WfMessage>

3. XML reply document after completion of workflow WS99999999

<?xml version="1.0" ?>
<WfMessage Version="SAP.1.0">
 <WfMessageHeader>
  <Request>
   <ResponseRequired>Yes</ResponseRequired>
  </Request>
    <Key>http://www.xyz.com/scripts/wgate/wf_handler/!?~protocol=01&~localkey=000000111669</Key>
    <Operation>ProcessInstanceStateChanged</Operation>
 </WfMessageHeader>
 <WfMessageBody>
  <ProcessInstanceStateChanged>
    <Key>http://www.xyz.com/scripts/wgate/wf_handler/!?~protocol=01&~localkey=000000111669</Key>
    <ProcessInstanceKey>http://www.xyz.com/scripts/wgate/wf_handler/!?~protocol=01&~localkey=000000112625</ProcessInstanceKey>
   <State>closed.completed</State>
   <ResultData>
     <ANSWER>test successful</ANSWER>
   </ResultData>
  </ProcessInstanceStateChanged>
 </WfMessageBody>
</WfMessage>