XmlRpcWorkflowManagerClient implements WorkflowManagerClient { public Metadata getWorkflowInstanceMetadata(String wInstId) throws XmlRpcException, IOException { Vector argList = new Vector(); argList.add(wInstId); Metadata met; Map instMetHash = (Map) client.execute( "workflowmgr.getWorkflowInstanceMetadata", argList); met = new Metadata(); met.addMetadata(instMetHash); return met; } 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();  }
@Test public void testGetWorkflowInstanceMetadata() { try { repo.addWorkflowInstance(testWrkInst); } catch (InstanceRepositoryException e) { fail(e.getMessage()); } String testWrkInstId = testWrkInst.getId(); assertNotNull(testWrkInstId); WorkflowInstance WInst = null; try { WInst = repo.getWorkflowInstanceById(testWrkInstId); } catch (InstanceRepositoryException e) { fail(e.getMessage()); } assertNotNull(WInst); Metadata met; met = WInst.getSharedContext(); assertNotNull(met); assertNotNull(met.getMap()); assertEquals(2, met.getMap().keySet().size()); assertNotNull(met.getAllMetadata("key1")); assertEquals(3, met.getAllMetadata("key1").size()); assertNotNull(met.getAllMetadata("key2")); assertEquals(2, met.getAllMetadata("key2").size()); boolean checkVal1 = false, checkVal2 = false, checkVal3 = false; for (String val : met.getAllMetadata("key1")) { if (val.equals("val1")) { checkVal1 = true; } else if (val.equals("val2")) { checkVal2 = true; } else if (val.equals("val3")) { checkVal3 = true; } } assert (checkVal1 && checkVal2 && checkVal3); boolean checkVal4 = false, checkVal5 = false; for (String val : met.getAllMetadata("key2")) { if (val.equals("val4")) { checkVal4 = true; } else if (val.equals("val5")) { checkVal5 = true; } } assertTrue(checkVal4 && checkVal5); }