| Author | 
		  Message
		 | 
		
		  | jfplata | 
		  
		    
			  
				 Posted: Mon May 19, 2003 8:08 am    Post subject: Terminate Process Instance Via XML | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 12 May 2003 Posts: 2
  
  | 
		  
		    
			  
				I am trying to terminate a process instance using the XML interface that Workflow provides. I am sending a ProcessInstanceTerminate message. My XML message looks like this:
 
 
<?xml version="1.0" standalone="yes"?>
 
 <WfMessage>
 
 <WfMessageHeader>
 
 </WfMessageHeader>
 
 <ProcessInstanceTerminate>
 
    <ProcInstName>TEST</ProcInstName>
 
 </ProcessInstanceTerminate>
 
 </WfMessage>
 
 
I need to know if my request was successful or not. I thought that by using ProcessInstanceTerminate, workflow will send a reply back to the queue that you specified when you send the message however I haven't received any replies. I also specify <ResponseRequired>Yes</ResponseRequired> in the XML message but I still don't get a reply. I changed my application so it waits at least 30 seconds before checking the Reply to Queue but I just get a 2033 error (No more messages). Has anyone tried to terminate a process instance and received a reply back from Workflow? _________________ Jorge Plata
 
IBM Certified Solutions Expert - MQSeries Workflow | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jmac | 
		  
		    
			  
				 Posted: Mon May 19, 2003 8:35 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC 
  | 
		  
		    
			  
				I have done this successfully many times.  I am not certain what could be wrong.
 
 
Can you give us more information.  Re is queue defined?  Does instance actually terminate?
 
 
What version of MQWF _________________ John McDonald
 
RETIRED | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jfplata | 
		  
		    
			  
				 Posted: Mon May 19, 2003 10:01 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 12 May 2003 Posts: 2
  
  | 
		  
		    
			  
				The instance is actually terminated but I don't receive any responses. As far as the reply to Queue, it is defined. I also have a program that Starts a process instance via XML and I specify a Reply to Queue and it works fine, I get a response. For the terminate process instance request I am using the same reply to queue (just for now). You said that you have done this many times, did you receive a response when the instance is terminated (obviously if you requested one)? And when the terminate instance failed did you receive a response? _________________ Jorge Plata
 
IBM Certified Solutions Expert - MQSeries Workflow | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jmac | 
		  
		    
			  
				 Posted: Mon May 19, 2003 10:24 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC 
  | 
		  
		    
			  
				Jorge:
 
 
I will run some samples later today...
 
 
Have you checked that you are setting the ReplyToQ/Qmgr in the MQ header?
 
 
I will post the results of my tests later today _________________ John McDonald
 
RETIRED | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | vennela | 
		  
		    
			  
				 Posted: Mon May 19, 2003 12:42 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India 
  | 
		  
		    
			  
				I did this for you John 
 
 
I am getting the response back nice and clear. All I did is I changed the program in the repository. 
 
 
   
	| Code: | 
   
  
	
 
      MessageInXMLFmt = MessageInXMLFmt + "   <ProcessInstanceTerminate>"  + "\n";
 
      MessageInXMLFmt = MessageInXMLFmt + "      <ProcInstName>CreditRequest</ProcInstName>"  + "\n";
 
      MessageInXMLFmt = MessageInXMLFmt + "   </ProcessInstanceTerminate>"  + "\n"; | 
   
 
 
 
I got this response
 
 
   
	| Code: | 
   
  
	<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 
<!-- This document is generated by a MQSeries Workflow Version 3.4.0 server -->
 
 
<WfMessage>
 
  <WfMessageHeader>
 
    <ResponseRequired>No</ResponseRequired>
 
    <UserContext>I want this data back</UserContext>
 
  </WfMessageHeader>
 
  <ProcessInstanceTerminateResponse>
 
    <ProcessInstance>
 
      <ProcInstID>UAAAAAEACwAAAAAAAAAAAAAAAAABAAHAAAAAAAAAAAAAUA==</ProcInstID>
 
      <ProcInstName>UAAAAAEACwAAAAAAAAAAAAAAAAABAAHAAAAAAAAAAAAAUA==CreditReques
 
t</ProcInstName>
 
      <ProcInstTopLevelName>UAAAAAEACwAAAAAAAAAAAAAAAAABAAHAAAAAAAAAAAAAUA==Cred
 
itRequest</ProcInstTopLevelName>
 
      <ProcInstDescription>Credit request</ProcInstDescription>
 
      <ProcInstState>Deleted</ProcInstState>
 
      <LastStateChangeTime>2003-05-19 20:36:04.084000</LastStateChangeTime>
 
      <LastModificationTime>2003-05-19 20:36:04.084000</LastModificationTime>
 
      <ProcTemplID>UQAAAAEAAcAAAAAAAAAAAABR</ProcTemplID>
 
      <ProcTemplName>CreditRequest</ProcTemplName>
 
      <ProcTemplValidFromDate>2003-05-06 17:12:34.046000</ProcTemplValidFromDate
 
>
 
      <Icon>FMCBPRC</Icon>
 
    </ProcessInstance>
 
  </ProcessInstanceTerminateResponse>
 
</WfMessage>
 
 
 | 
   
 
 
 
 
Jorge:
 
If you have a chance you may look at the sample 'ProcessTemplateCreateAndStartInstance' in the repository on this site and make modifications and see if it helps. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |