public void storeStepData(URI workflowURI,String key,String stepId,Object data){
  WorkflowStepData dataRecord=getWorkflowStepData(workflowURI,stepId,key);
  boolean created=false;
  if (dataRecord == null) {
    dataRecord=new WorkflowStepData();
    dataRecord.setId(URIUtil.createId(WorkflowStepData.class));
    dataRecord.setWorkflowId(workflowURI);
    dataRecord.setStepId(stepId);
    dataRecord.setLabel(key);
    created=true;
  }
  dataRecord.setData(GenericSerializer.serialize(data));
  if (created) {
    _dbClient.createObject(dataRecord);
    _log.info(String.format("Created WorkflowStepData for %s %s %s",workflowURI,stepId,key));
  }
 else {
    _dbClient.updateObject(dataRecord);
    _log.info(String.format("Updated WorkflowStepData for %s %s %s",workflowURI,stepId,key));
  }
}

public void storeStepData ( URI workflowURI , String key , String stepId , Object data ) { WorkflowStepData dataRecord = getWorkflowStepData ( workflowURI , stepId , key ) ; boolean created = false ; if ( dataRecord == null ) { dataRecord = new WorkflowStepData ( ) ; dataRecord . setId ( URIUtil . createId ( WorkflowStepData . class ) ) ; dataRecord . setWorkflowId ( workflowURI ) ; dataRecord . setStepId ( stepId ) ; dataRecord . setLabel ( key ) ; created = true ; } dataRecord . setData ( GenericSerializer . serialize ( data ) ) ; if ( created ) { _dbClient . createObject ( dataRecord ) ; _log . info ( String . format ( "Created WorkflowStepData for %s %s %s" , workflowURI , stepId , key ) ) ; } else { _dbClient . updateObject ( dataRecord ) ; _log . info ( String . format ( "Updated WorkflowStepData for %s %s %s" , workflowURI , stepId , key ) ) ; } }
saves data on behalf of a step . the workflow uri and at least a stepid or key ( or both ) must be supplied . note : the steporworkflow argument must be either a valid workflowuri ( obtained when the workflow is created ) the data is available until the workflow is destroyed .
