Package Subset0268

Examples of Subset0268.DocumentRoot


        DroolsFactoryImpl.init();
        BpsimFactoryImpl.init();
        Resource resource = createResource(uri);
        Bpmn2Factory factory = Bpmn2Factory.eINSTANCE;
        Definitions definitions = factory.createDefinitions();
        DocumentRoot docummentRoot = factory.createDocumentRoot();
        docummentRoot.setDefinitions(definitions);
        resource.getContents().add(docummentRoot);

        return definitions;
    }
View Full Code Here


     * @generated
     */
    protected T doSwitch(int classifierID, EObject theEObject) {
        switch (classifierID) {
        case Bpmn2Package.DOCUMENT_ROOT: {
            DocumentRoot documentRoot = (DocumentRoot) theEObject;
            T result = caseDocumentRoot(documentRoot);
            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
View Full Code Here

    public Definitions createAndInitResource(URI uri) {
        Resource resource = createResource(uri);
        Bpmn2Factory factory = Bpmn2Factory.eINSTANCE;
        Definitions definitions = factory.createDefinitions();
        DocumentRoot docummentRoot = factory.createDocumentRoot();
        docummentRoot.setDefinitions(definitions);
        resource.getContents().add(docummentRoot);

        return definitions;
    }
View Full Code Here

   * @param defintion
   */
  public void save(Definitions defintion){
    ResourceSet resourceSet = getResourceSet();
    Bpmn2Resource resource = (Bpmn2Resource) resourceSet.getResource(URI.createFileURI("d:\\node_template.bpmn"), true);
    DocumentRoot documentRoot = (DocumentRoot) resource.getContents().get(0);
    documentRoot.setDefinitions(defintion);
    try {
      resource.save(null);
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here

   * @param uri
   */
  public void save(Definitions definitions,URI uri){
    ResourceSet resourceSet = getResourceSet();
    Bpmn2Resource resource = (Bpmn2Resource) resourceSet.getResource(uri, true);
    DocumentRoot documentRoot = (DocumentRoot) resource.getContents().get(0);
    documentRoot.setDefinitions(definitions);
    try {
      resource.save(null);
    } catch (IOException e) {
      e.printStackTrace();
      throw new FixFlowException(ExceptionCode.EXCEPTION_DEFAULT,e);
View Full Code Here

    if (contents.isEmpty() || !(contents.get(0) instanceof DocumentRoot)) {
      TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(resource);

      if (domain != null) {
        final DocumentRoot docRoot = FACTORY.createDocumentRoot();
        final Definitions definitions = FACTORY.createDefinitions();
//        definitions.setId(EcoreUtil.generateUUID());
        ModelUtil.setID(definitions,resource);
        Collaboration collaboration = FACTORY.createCollaboration();
//        collaboration.setId(EcoreUtil.generateUUID());
        ModelUtil.setID(collaboration,resource);
        Participant participant = FACTORY.createParticipant();
//        participant.setId(EcoreUtil.generateUUID());
        ModelUtil.setID(participant,resource);
        participant.setName("Internal");
        collaboration.getParticipants().add(participant);
        definitions.getRootElements().add(collaboration);

        domain.getCommandStack().execute(new RecordingCommand(domain) {
          @Override
          protected void doExecute() {
            docRoot.setDefinitions(definitions);
            resource.getContents().add(docRoot);
          }
        });
        return;
      }
View Full Code Here

TOP

Related Classes of Subset0268.DocumentRoot

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.