From: <bsc...@us...> - 2012-02-09 13:09:36
|
Revision: 12524 http://unicore.svn.sourceforge.net/unicore/?rev=12524&view=rev Author: bschuller Date: 2012-02-09 13:09:26 +0000 (Thu, 09 Feb 2012) Log Message: ----------- add resume feature to workflow instance; add 'details' element to GetWAStatus Modified Paths: -------------- workflow/trunk/common/src/main/java/org/chemomentum/common/api/workflow/WFClient.java workflow/trunk/common/src/main/java/org/chemomentum/common/impl/workflow/WorkflowManagementClient.java workflow/trunk/common/src/main/java/org/chemomentum/common/ws/WorkflowManagement.java workflow/trunk/common/src/main/schema/WorkAssignment.xsd workflow/trunk/common/src/main/schema/workflow.xsd Modified: workflow/trunk/common/src/main/java/org/chemomentum/common/api/workflow/WFClient.java =================================================================== --- workflow/trunk/common/src/main/java/org/chemomentum/common/api/workflow/WFClient.java 2012-02-09 11:52:11 UTC (rev 12523) +++ workflow/trunk/common/src/main/java/org/chemomentum/common/api/workflow/WFClient.java 2012-02-09 13:09:26 UTC (rev 12524) @@ -1,6 +1,7 @@ package org.chemomentum.common.api.workflow; import java.util.List; +import java.util.Map; import org.chemomentum.common.ws.ITrace; import org.chemomentum.workflow.xmlbeans.StatusType; @@ -60,6 +61,13 @@ public void abort()throws Exception; /** + * resume workflow execution (when it has been held) + * @param parameters - parameters to pass to the workflow engine + * (may be null if no parameters should be passed) + */ + public void resume(Map<String,String>parameters)throws Exception; + + /** * Get the endpoint reference of the WS-resource to which * this client talks and that reflects the state of the workflow. */ Modified: workflow/trunk/common/src/main/java/org/chemomentum/common/impl/workflow/WorkflowManagementClient.java =================================================================== --- workflow/trunk/common/src/main/java/org/chemomentum/common/impl/workflow/WorkflowManagementClient.java 2012-02-09 11:52:11 UTC (rev 12523) +++ workflow/trunk/common/src/main/java/org/chemomentum/common/impl/workflow/WorkflowManagementClient.java 2012-02-09 13:09:26 UTC (rev 12524) @@ -2,19 +2,22 @@ import java.util.Arrays; import java.util.List; +import java.util.Map; import org.chemomentum.common.api.workflow.WFClient; import org.chemomentum.common.api.workflow.WorkflowWrapper; import org.chemomentum.common.ws.WorkflowManagement; import org.chemomentum.workflow.xmlbeans.AbortWorkflowRequestDocument; import org.chemomentum.workflow.xmlbeans.DetailedStatusDocument; +import org.chemomentum.workflow.xmlbeans.DetailedStatusDocument.DetailedStatus; +import org.chemomentum.workflow.xmlbeans.ParameterDocument.Parameter; +import org.chemomentum.workflow.xmlbeans.ResumeWorkflowRequestDocument; +import org.chemomentum.workflow.xmlbeans.StatusType.Enum; import org.chemomentum.workflow.xmlbeans.SubmitWorkflowDocument; import org.chemomentum.workflow.xmlbeans.SubmitWorkflowType; import org.chemomentum.workflow.xmlbeans.SubmittedWorkflowDocument; import org.chemomentum.workflow.xmlbeans.WorkflowResourcePropertiesDocument; import org.chemomentum.workflow.xmlbeans.WorkflowStatusDocument; -import org.chemomentum.workflow.xmlbeans.DetailedStatusDocument.DetailedStatus; -import org.chemomentum.workflow.xmlbeans.StatusType.Enum; import org.w3.x2005.x08.addressing.EndpointReferenceType; import de.fzj.unicore.uas.client.BaseUASClient; @@ -107,5 +110,20 @@ return getResourcePropertiesDocument().getWorkflowResourceProperties().getStorageEPR(); } + /** + * resume the workflow (if it is held) + */ + public void resume(Map<String,String>params)throws Exception{ + ResumeWorkflowRequestDocument req=ResumeWorkflowRequestDocument.Factory.newInstance(); + req.addNewResumeWorkflowRequest(); + if(params!=null && !params.isEmpty()){ + for(Map.Entry<String,String>e: params.entrySet()){ + Parameter p=req.getResumeWorkflowRequest().addNewParameter(); + p.setName(e.getKey()); + p.setStringValue(e.getValue()); + } + } + workflow.resume(req); + } } Modified: workflow/trunk/common/src/main/java/org/chemomentum/common/ws/WorkflowManagement.java =================================================================== --- workflow/trunk/common/src/main/java/org/chemomentum/common/ws/WorkflowManagement.java 2012-02-09 11:52:11 UTC (rev 12523) +++ workflow/trunk/common/src/main/java/org/chemomentum/common/ws/WorkflowManagement.java 2012-02-09 13:09:26 UTC (rev 12524) @@ -15,6 +15,8 @@ import org.chemomentum.workflow.xmlbeans.JobReferenceEnumerationDocument; import org.chemomentum.workflow.xmlbeans.LocationMapperAddressDocument; import org.chemomentum.workflow.xmlbeans.OutputFilesDocument; +import org.chemomentum.workflow.xmlbeans.ResumeWorkflowRequestDocument; +import org.chemomentum.workflow.xmlbeans.ResumeWorkflowResponseDocument; import org.chemomentum.workflow.xmlbeans.StorageEPRDocument; import org.chemomentum.workflow.xmlbeans.SubmissionTimeDocument; import org.chemomentum.workflow.xmlbeans.SubmitWorkflowDocument; @@ -123,5 +125,13 @@ @WebMethod(action="http://www.chemomentum.org/workflow/WorkflowManagement/AbortWorkflowRequest") public AbortWorkflowResponseDocument abort(AbortWorkflowRequestDocument workflow) throws Exception ; + /** + * Operation for resuming a held workflow + * + * @throws Exception + */ + @WebMethod(action="http://www.chemomentum.org/workflow/WorkflowManagement/ResumeWorkflowRequest") + public ResumeWorkflowResponseDocument resume(ResumeWorkflowRequestDocument workflow) throws Exception ; + } Modified: workflow/trunk/common/src/main/schema/WorkAssignment.xsd =================================================================== --- workflow/trunk/common/src/main/schema/WorkAssignment.xsd 2012-02-09 11:52:11 UTC (rev 12523) +++ workflow/trunk/common/src/main/schema/WorkAssignment.xsd 2012-02-09 13:09:26 UTC (rev 12524) @@ -120,12 +120,13 @@ </xsd:sequence> </xsd:complexType> </xsd:element> + <xsd:element name="GetWorkAssignmentStatusResponse"> <xsd:complexType> <xsd:sequence> <xsd:element name="StatusResult" type="wa:StatusType" /> - <xsd:element ref="callback:ExecutionResources" - minOccurs="0" /> + <xsd:element ref="callback:ExecutionResources" minOccurs="0" /> + <xsd:element name="DetailMessage" type="xsd:string" minOccurs="0"/> </xsd:sequence> </xsd:complexType> </xsd:element> Modified: workflow/trunk/common/src/main/schema/workflow.xsd =================================================================== --- workflow/trunk/common/src/main/schema/workflow.xsd 2012-02-09 11:52:11 UTC (rev 12523) +++ workflow/trunk/common/src/main/schema/workflow.xsd 2012-02-09 13:09:26 UTC (rev 12524) @@ -118,6 +118,32 @@ <xsd:complexType/> </xsd:element> + + <!-- + resume a workflow + --> + <xsd:element name="ResumeWorkflowRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element ref="wf:Parameter" minOccurs="0" maxOccurs="unbounded"/> + <xsd:any namespace="##other" processContents="lax"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:element name="ResumeWorkflowResponse"> + <xsd:complexType/> + </xsd:element> + + <xsd:element name="Parameter"> + <xsd:complexType> + <xsd:simpleContent> + <xsd:extension base="xsd:string"> + <xsd:attribute name="name" type="xsd:string"/> + </xsd:extension> + </xsd:simpleContent> + </xsd:complexType> + </xsd:element> <!-- The resource properties of the workflow factory service @@ -170,7 +196,7 @@ <xsd:element name="StorageEPR" type="wsa:EndpointReferenceType"/> <!-- - The resource properties of a workflow + The resource properties of a workflow instance --> <xsd:element name="WorkflowResourceProperties"> <xsd:complexType> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |