Package org.uengine.contexts

Examples of org.uengine.contexts.OfficeDocumentInstance


  public Map getMappedResult(ProcessInstance instance) throws Exception{
   
   
   
    Map mappedResult = new HashMap();
    OfficeDocumentInstance officeDocInst = instance==null ? (OfficeDocumentInstance)(getVariableForOfficeDocumentInstance().getDefaultValue()) : (OfficeDocumentInstance)(getVariableForOfficeDocumentInstance().get(instance, ""));

/*    InputStream officeDocDefXMLInputStream = ProcessDefinitionFactory.getInstance(instance.getProcessTransactionContext()).getResourceStream(officeDocInst.getDocumentDefId());
    OfficeDocumentDefinition officeDocDef = (OfficeDocumentDefinition) GlobalContext.deserialize(officeDocDefXMLInputStream, OfficeDocumentDefinition.class);
    List fieldList = officeDocDef.getFieldList();
    final Map fieldListHT = new HashMap();
    new ForLoop(){

      public void logic(Object target) {
        FieldDescriptor fd = (FieldDescriptor)target;
        fieldListHT.put(fd.getName(), fd);
      }
     
    }.run(fieldList);*/
   
   
    Map valueMap = new HashMap();
    if(officeDocInst==null) return valueMap;
   
    valueMap = officeDocInst.getValueMap();
    if(valueMap==null && officeDocInst.getFilePath()!=null){
      officeDocInst.loadValueMap();
      mappedResult = officeDocInst.getValueMap();
    }
   
    MappingContext mappingContext = getMappingContext();
   
    ParameterContext[] params = mappingContext.getMappingElements();//getVariableBindings();
View Full Code Here


  }
 
  protected void afterComplete(ProcessInstance instance) throws Exception {

    // load up the OfficeDocumentInstance
    OfficeDocumentInstance officeDocumentInstance = (OfficeDocumentInstance) getVariableForOfficeDocumentInstance().get(instance, "");
    if(officeDocumentInstance.getFilePath()==null) throw new UEngineException("You didn't write any document.");
   
    ParameterContext[] params = getMappingContext().getMappingElements();
    for (int i = 0; i < params.length; i++) {
      ParameterContext param = params[i];
View Full Code Here

        e.printStackTrace();
      }
    } 
   
    if(variable.getType() == OfficeDocumentInstance.class){
      OfficeDocumentInstance metaValue = (OfficeDocumentInstance)(variable.getDefaultValue());
     
      if(metaValue.getDocumentDefId()==null)
        variableNode.add(createRecord("No form template is set", null, isSource));;
     
      String formDefId = ProcessDefinition.splitDefinitionAndVersionId(metaValue.getDocumentDefId())[0];
      try {
       
        InputStream is = ProcessDesigner.getClientProxy().showObjectDefinitionWithDefinitionId(formDefId);
       
        OfficeDocumentDefinition odd = (OfficeDocumentDefinition) GlobalContext.deserialize(is, OfficeDocumentDefinition.class);
View Full Code Here

TOP

Related Classes of org.uengine.contexts.OfficeDocumentInstance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.