當前位置: 首頁>>代碼示例>>Java>>正文


Java Artifact類代碼示例

本文整理匯總了Java中org.activiti.bpmn.model.Artifact的典型用法代碼示例。如果您正苦於以下問題:Java Artifact類的具體用法?Java Artifact怎麽用?Java Artifact使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Artifact類屬於org.activiti.bpmn.model包,在下文中一共展示了Artifact類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: processArtifacts

import org.activiti.bpmn.model.Artifact; //導入依賴的package包/類
protected void processArtifacts(FlowElementsContainer container,
        BpmnModel model, ArrayNode shapesArrayNode, double containerX,
        double containerY) {
    for (Artifact artifact : container.getArtifacts()) {
        Class<? extends BaseBpmnJsonConverter> converter = convertersToJsonMap
                .get(artifact.getClass());

        if (converter != null) {
            try {
                converter.newInstance().convertToJson(artifact, this,
                        model, container, shapesArrayNode, containerX,
                        containerY);
            } catch (Exception e) {
                LOGGER.error("Error converting {}", artifact, e);
            }
        }
    }
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:19,代碼來源:BpmnJsonConverter.java

示例2: createXML

import org.activiti.bpmn.model.Artifact; //導入依賴的package包/類
private void createXML(FlowElement flowElement, BpmnModel model, XMLStreamWriter xtw) throws Exception {
  
  if (flowElement instanceof SubProcess) {
    
    SubProcess subProcess = (SubProcess) flowElement;
    xtw.writeStartElement(ELEMENT_SUBPROCESS);
    xtw.writeAttribute(ATTRIBUTE_ID, subProcess.getId());
    if (StringUtils.isNotEmpty(subProcess.getName())) {
      xtw.writeAttribute(ATTRIBUTE_NAME, subProcess.getName());
    } else {
      xtw.writeAttribute(ATTRIBUTE_NAME, "subProcess");
    }
    
    if (subProcess instanceof EventSubProcess) {
      xtw.writeAttribute(ATTRIBUTE_TRIGGERED_BY, ATTRIBUTE_VALUE_TRUE);
    }
    
    if (StringUtils.isNotEmpty(subProcess.getDocumentation())) {

      xtw.writeStartElement(ELEMENT_DOCUMENTATION);
      xtw.writeCharacters(subProcess.getDocumentation());
      xtw.writeEndElement();
    }
    
    boolean wroteListener = ActivitiListenerExport.writeListeners(subProcess, false, xtw);
    if (wroteListener) {
      // closing extensions element
      xtw.writeEndElement();
    }
    MultiInstanceExport.writeMultiInstance(subProcess, xtw);
    
    for (FlowElement subElement : subProcess.getFlowElements()) {
      createXML(subElement, model, xtw);
    }
    
    for (Artifact artifact : subProcess.getArtifacts()) {
      createXML(artifact, model, xtw);
    }
    
    xtw.writeEndElement();
    
  } else {
  
    Class<? extends BaseBpmnXMLConverter> converter = convertersToXMLMap.get(flowElement.getClass());
    
    if (converter == null) {
      throw new XMLException("No converter for " + flowElement.getClass() + " found");
    }
    
    converter.newInstance().convertToXML(xtw, flowElement, model);
  }
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:53,代碼來源:BpmnXMLConverter.java

示例3: gatherAllArtifacts

import org.activiti.bpmn.model.Artifact; //導入依賴的package包/類
protected static List<Artifact> gatherAllArtifacts(BpmnModel bpmnModel) {
    List<Artifact> artifacts = new ArrayList<Artifact>();

    for (org.activiti.bpmn.model.Process process : bpmnModel.getProcesses()) {
        artifacts.addAll(process.getArtifacts());
    }

    return artifacts;
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:10,代碼來源:CustomProcessDiagramGenerator.java

示例4: processArtifacts

import org.activiti.bpmn.model.Artifact; //導入依賴的package包/類
protected void processArtifacts(BpmnParse bpmnParse, Collection<Artifact> artifacts, ScopeImpl scope) {
  // associations  
  for (Artifact artifact : artifacts) {
    if (artifact instanceof Association) {
      createAssociation(bpmnParse, (Association) artifact, scope);
    }
  }
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:9,代碼來源:AbstractBpmnParseHandler.java

示例5: convertToBpmnModel

import org.activiti.bpmn.model.Artifact; //導入依賴的package包/類
public void convertToBpmnModel(XMLStreamReader xtr, BpmnModel model, Process activeProcess, 
    List<SubProcess> activeSubProcessList) throws Exception {
  
  this.model = model;
  this.activeProcess = activeProcess;
  
  String elementId = xtr.getAttributeValue(null, ATTRIBUTE_ID);
  String elementName = xtr.getAttributeValue(null, ATTRIBUTE_NAME);
  boolean async = parseAsync(xtr);
  boolean notExclusive = parseNotExclusive(xtr);
  String defaultFlow = xtr.getAttributeValue(null, ATTRIBUTE_DEFAULT);
  boolean isForCompensation = parseForCompensation(xtr);
  
  BaseElement parsedElement = convertXMLToElement(xtr);
  
  if (parsedElement instanceof Artifact) {
    Artifact currentArtifact = (Artifact) parsedElement;
    currentArtifact.setId(elementId);

    if (isInSubProcess(activeSubProcessList)) {
      final SubProcess currentSubProcess = activeSubProcessList.get(activeSubProcessList.size() - 2);
      currentSubProcess.addArtifact(currentArtifact);

    } else {
      this.activeProcess.addArtifact(currentArtifact);
    }
  }
  
  if(parsedElement instanceof FlowElement) {
    
    FlowElement currentFlowElement = (FlowElement) parsedElement;
    currentFlowElement.setId(elementId);
    currentFlowElement.setName(elementName);
    
    if(currentFlowElement instanceof Activity) {
      
      Activity activity = (Activity) currentFlowElement;
      activity.setAsynchronous(async);
      activity.setNotExclusive(notExclusive);
      activity.setForCompensation(isForCompensation);
      if(StringUtils.isNotEmpty(defaultFlow)) {
        activity.setDefaultFlow(defaultFlow);
      }
    }
    
    if(currentFlowElement instanceof Gateway) {
      if(StringUtils.isNotEmpty(defaultFlow)) {
        ((Gateway) currentFlowElement).setDefaultFlow(defaultFlow);
      }
    }
    
    if (activeSubProcessList.size() > 0) {
      activeSubProcessList.get(activeSubProcessList.size() - 1).addFlowElement(currentFlowElement);
    } else {
      this.activeProcess.addFlowElement(currentFlowElement);
    }
  }
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:59,代碼來源:BaseBpmnXMLConverter.java

示例6: convertToXML

import org.activiti.bpmn.model.Artifact; //導入依賴的package包/類
public byte[] convertToXML(BpmnModel model, String encoding) {
  try {

    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    
    XMLOutputFactory xof = XMLOutputFactory.newInstance();
    OutputStreamWriter out = new OutputStreamWriter(outputStream, encoding);

    XMLStreamWriter writer = xof.createXMLStreamWriter(out);
    XMLStreamWriter xtw = new IndentingXMLStreamWriter(writer);

    DefinitionsRootExport.writeRootElement(model, xtw, encoding);
    SignalAndMessageDefinitionExport.writeSignalsAndMessages(model, xtw);
    PoolExport.writePools(model, xtw);
    
    for (Process process : model.getProcesses()) {
      
      if(process.getFlowElements().size() == 0 && process.getLanes().size() == 0) {
        // empty process, ignore it 
        continue;
      }
    
      ProcessExport.writeProcess(process, xtw);
      
      for (FlowElement flowElement : process.getFlowElements()) {
        createXML(flowElement, model, xtw);
      }
      
      for (Artifact artifact : process.getArtifacts()) {
        createXML(artifact, model, xtw);
      }
      
      // end process element
      xtw.writeEndElement();
    }

    BPMNDIExport.writeBPMNDI(model, xtw);

    // end definitions root element
    xtw.writeEndElement();
    xtw.writeEndDocument();

    xtw.flush();

    outputStream.close();

    xtw.close();
    
    return outputStream.toByteArray();
    
  } catch (Exception e) {
    LOGGER.error("Error writing BPMN XML", e);
    throw new XMLException("Error writing BPMN XML", e);
  }
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:56,代碼來源:BpmnXMLConverter.java


注:本文中的org.activiti.bpmn.model.Artifact類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。