Package org.dom4j.tree

Examples of org.dom4j.tree.DefaultElement


    public void esbToJBpmAndBack() throws Exception
    {
        SAXReader reader = new SAXReader();
        Document document = reader.read(this.getClass().getResourceAsStream("/" + PROCESS_DEF_XML));
        Element element = document.getRootElement();
        DefaultElement bpmToEsbVars = (DefaultElement) element.element("start-state").element("transition").element("action").element("bpmToEsbVars");
        DefaultElement esbToBpmVars = (DefaultElement) element.element("start-state").element("transition").element("action").element("esbToBpmVars");
       
        String helloWorldTokenScope  = "Hello world token scope";
        String helloWorldGlobalScope = "Hello world process-instance scope";
        TestJBPMVariable objectTokenScope = new TestJBPMVariable("Object token scope") ;
        TestJBPMVariable objectGlobalScope = new TestJBPMVariable("Object global scope") ;
       
        Token token = processInstance.getRootToken();
        processInstance.getContextInstance().createVariable("v1", helloWorldTokenScope, token);
        processInstance.getContextInstance().createVariable("g2", helloWorldGlobalScope);
        processInstance.getContextInstance().createVariable("h3", objectTokenScope, token);
        processInstance.getContextInstance().createVariable("i4", objectGlobalScope);
        ExecutionContext executionContext = new ExecutionContext(token);
       
        JBpmObjectMapper mapper = new JBpmObjectMapper();
        Message message = mapper.mapFromJBpmToEsbMessage(bpmToEsbVars, Boolean.FALSE, executionContext);
       
        //Setting up return mapping for the callback service.
        EsbActionHandler esbActionHandler = new EsbActionHandler();
        EPR epr = esbActionHandler.createReplyTo(esbToBpmVars.asXML(), Boolean.FALSE, executionContext);
        String esbToBpmXml = epr.getAddr().getExtensionValue(Constants.ESB_TO_BPM_VARS_TAG);
       
        //Obtaining the VariableMap that is going to be set callback command
        Map<String,Object> variableMap = mapper.mapFromEsbMessageToJBpmMap(message, esbToBpmVars.asXML());
        logger.info(variableMap);
        //Let's make sure that what we put in is going to make it roundtrip.
        assertEquals(helloWorldTokenScope, variableMap.get("x1"));
        assertEquals(helloWorldGlobalScope,variableMap.get("x2"));
    }
View Full Code Here


            {
                final Object delegate = actionDelegation.getInstance();
                if (delegate instanceof EsbActionHandler)
                {
                    final EsbActionHandler handler = (EsbActionHandler)delegate;
                    final DefaultElement esbToBpmVars = handler.esbToBpmVars;
                    if (esbToBpmVars != null)
                    {
                        try
                        {
                            return  new JBpmObjectMapper().mapFromEsbMessageToJBpmMapping(esbMessage, esbToBpmVars.asXML());
                        }
                        catch (final ConfigurationException e)
                        {
                            throw new CallbackException(e.getMessage(), e);
                        }
View Full Code Here

    }

    public void endNode() {
        try {
            if (!children) {
                Element element = new DefaultElement((String)elementStack.pop());
                for (int i = 0; i < attributes.getLength(); ++i) {
                    element.addAttribute(attributes.getQName(i), attributes.getValue(i));
                }
                writer.write(element);
                attributes.clear();
                children = true;   // node just closed is child of node on top of stack
                started = true;
View Full Code Here

    }

    public void endNode() {
        try {
            if (!children) {
                Element element = new DefaultElement((String)elementStack.pop());
                for (int i = 0; i < attributes.getLength(); ++i) {
                    element.addAttribute(attributes.getQName(i), attributes.getValue(i));
                }
                writer.write(element);
                children = true;   // node just closed is child of node on top of stack
                started = true;
            } else {
View Full Code Here

        {
            element = root.addElement( ERROR_RESPONSE_TAG );
        }
        else
        {
            element = new DefaultElement( ERROR_RESPONSE_TAG );
        }
       
        // RequestID
        if ( requestID != 0 )
        {
View Full Code Here

        {
            element = root.addElement( EXTENDED_RESPONSE_TAG );
        }
        else
        {
            element = new DefaultElement( EXTENDED_RESPONSE_TAG );
        }

        ExtendedResponse extendedResponse = ( ExtendedResponse ) getDecorated();

        // LDAP Result
View Full Code Here

         && (subProcessName!=null)
       ) {
      SubProcessResolver subProcessResolver = getSubProcessResolver();
      List attributes = new ArrayList();
      attributes.add(new FlyweightAttribute("name", subProcessName));
      Element subProcessElement = new DefaultElement("sub-process");
      subProcessElement.setAttributes(attributes);
      usedSubProcessDefinition = subProcessResolver.findSubProcess(subProcessElement);
    }

    // create the subprocess
    ProcessInstance subProcessInstance = superProcessToken.createSubProcessInstance(usedSubProcessDefinition);
View Full Code Here

        {
            element = root.addElement( EXTENDED_RESPONSE_TAG );
        }
        else
        {
            element = new DefaultElement( EXTENDED_RESPONSE_TAG );
        }
       
        ExtendedResponse extendedResponse = ( ExtendedResponse ) getDecorated();

        // LDAP Result
View Full Code Here

        {
            element = root.addElement( SEARCH_RESULT_REFERENCE_TAG );
        }
        else
        {
            element = new DefaultElement( SEARCH_RESULT_REFERENCE_TAG );
        }


        // Adding References
        for ( String url : getDecorated().getReferral().getLdapUrls() )
View Full Code Here

        {
            element = root.addElement( DEL_RESPONSE_TAG );
        }
        else
        {
            element = new DefaultElement( DEL_RESPONSE_TAG );
        }
       

        LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(),
            getDecorated().getLdapResult(), getDecorated() );
View Full Code Here

TOP

Related Classes of org.dom4j.tree.DefaultElement

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.