XmlRpcWorkflowManagerClient implements WorkflowManagerClient { @Override public WorkflowInstance getWorkflowInstanceById(String wInstId) throws XmlRpcException, IOException, RepositoryException { Vector argList = new Vector(); argList.add(wInstId); Map workflowInstance = (Map) client.execute( "workflowmgr.getWorkflowInstanceById", argList); return XmlRpcStructFactory .getWorkflowInstanceFromXmlRpc(workflowInstance); } XmlRpcWorkflowManagerClient(URL url); @Override boolean refreshRepository(); @Override String executeDynamicWorkflow(List<String> taskIds, Metadata metadata); List getRegisteredEvents(); WorkflowInstancePage getFirstPage(); @Override WorkflowInstancePage getNextPage(WorkflowInstancePage currentPage); @Override WorkflowInstancePage getPrevPage(WorkflowInstancePage currentPage); WorkflowInstancePage getLastPage(); @Override WorkflowInstancePage paginateWorkflowInstances(int pageNum,
            String status); @Override WorkflowInstancePage paginateWorkflowInstances(int pageNum); List getWorkflowsByEvent(String eventName); Metadata getWorkflowInstanceMetadata(String wInstId); @Override synchronized boolean setWorkflowInstanceCurrentTaskStartDateTime(
            String wInstId, String startDateTimeIsoStr); @Override double getWorkflowCurrentTaskWallClockMinutes(String workflowInstId); @Override double getWorkflowWallClockMinutes(String workflowInstId); @Override synchronized boolean stopWorkflowInstance(String workflowInstId); @Override synchronized boolean pauseWorkflowInstance(String workflowInstId); @Override synchronized boolean resumeWorkflowInstance(String workflowInstId); @Override synchronized boolean setWorkflowInstanceCurrentTaskEndDateTime(
            String wInstId, String endDateTimeIsoStr); @Override synchronized boolean updateWorkflowInstanceStatus(
            String workflowInstId, String status); @Override synchronized boolean updateWorkflowInstance(WorkflowInstance instance); @Override synchronized boolean updateMetadataForWorkflow(
            String workflowInstId, Metadata metadata); @Override boolean sendEvent(String eventName, Metadata metadata); boolean clearWorkflowInstances(); WorkflowTask getTaskById(String taskId); @Override WorkflowCondition getConditionById(String conditionId); @Override WorkflowInstance getWorkflowInstanceById(String wInstId); Workflow getWorkflowById(String workflowId); Vector getWorkflows(); int getNumWorkflowInstancesByStatus(String status); int getNumWorkflowInstances(); Vector getWorkflowInstancesByStatus(String status); Vector getWorkflowInstances(); @Override URL getWorkflowManagerUrl(); @Override void setWorkflowManagerUrl(URL workflowManagerUrl); @Override void close();  }
@Ignore @Test public void testGetNullWorkflowInstances() throws RepositoryException, XmlRpcException, IOException, InterruptedException { Thread.sleep(3000); WorkflowInstance instance = wmc.getWorkflowInstanceById("1234"); assertThat(instance, is(nullValue())); }
@Test public void testGetWorkflowInstanceById() throws XmlRpcException, IOException, RepositoryException { List<WorkflowInstance> workflowlist = wmc.getWorkflowInstances(); assertThat(workflowlist, is(not(nullValue()))); assertThat(workflowlist.size(), is(not(0))); WorkflowInstance instance = wmc.getWorkflowInstanceById(workflowlist.get(0).getId()); assertThat(instance, is(not(nullValue()))); }