Package org.apache.ode.bpel.common

Examples of org.apache.ode.bpel.common.CorrelationKey


            OProcess.OProperty property = cset.declaration.properties.get(i);
            propValues[i] = getBpelRuntimeContext().readProperty(variable, property);
            propNames[i] = property.name.toString();
        }

        CorrelationKey ckeyVal = new CorrelationKey(cset.declaration.getId(), propValues);
        getBpelRuntimeContext().writeCorrelation(cset,ckeyVal);
    }


            OProcess.OProperty property = cset.declaration.properties.get(i);
            propValues[i] = readProperty(variable, property);
            propNames[i] = property.name.toString();
        }

        CorrelationKey ckeyVal = new CorrelationKey(cset.declaration.getId(), propValues);
        writeCorrelation(cset, ckeyVal);
    }

        try {
            selectors = new Selector[_opick.onMessages.size()];
            int idx = 0;
            for (OPickReceive.OnMessage onMessage : _opick.onMessages) {
                CorrelationKey key = null; // this will be the case for the
                // createInstance activity

                PartnerLinkInstance pLinkInstance = _scopeFrame.resolve(onMessage.partnerLink);
                if (onMessage.matchCorrelation == null && !_opick.createInstanceFlag) {
                    // Adding a route for opaque correlation. In this case,
                    // correlation is on "out-of-band" session-id
                    String sessionId = getBpelRuntimeContext().fetchMySessionId(pLinkInstance);
                    key = new CorrelationKey(-1, new String[] { sessionId });
                } else if (onMessage.matchCorrelation != null) {
                    if (!getBpelRuntimeContext().isCorrelationInitialized(
                            _scopeFrame.resolve(onMessage.matchCorrelation))) {
                        // the following should really test if this is a "join"
                        // type correlation...

    _processInst = processInst;
        _correlator = correlator;
    }
 
  public CorrelationKey getCorrelationKey() {
    return new CorrelationKey(_correlationKey);
  }

         */
        public void run() {
            Selector selector;
            try {
                PickResponseChannel pickResponseChannel = newChannel(PickResponseChannel.class);
                CorrelationKey key;
                PartnerLinkInstance pLinkInstance = _scopeFrame.resolve(_oevent.partnerLink);
                if (_oevent.matchCorrelation == null) {
                    // Adding a route for opaque correlation. In this case correlation is done on "out-of-band" session id.
                    String sessionId = getBpelRuntimeContext().fetchMySessionId(pLinkInstance);
                    key = new CorrelationKey(-1, new String[] {sessionId});
                } else {
                    if (!getBpelRuntimeContext().isCorrelationInitialized(_scopeFrame.resolve(_oevent.matchCorrelation))) {
                        throw new FaultException(_oevent.getOwner().constants.qnCorrelationViolation,"Correlation not initialized.");
                    }
                    key = getBpelRuntimeContext().readCorrelation(_scopeFrame.resolve(_oevent.matchCorrelation));

    public void setCorrelatorId(String correlatorId) {
        _jobDetail.put("correlatorId", correlatorId);
    }
   
    public CorrelationKey getCorrelationKey() {
        return new CorrelationKey((String) _jobDetail.get("ckey"));
    }

 
  private ProcessInstanceDAO createProcessInstance(ProcessDAO process, CorrelatorDAO corr) throws SAXException, IOException {
    ProcessInstanceDAO pi = null;
    String[] actions = { "action1","action2" };
    String[] correlationKeys = { "key1", "key2" };
    CorrelationKey key1 = new CorrelationKey(1,correlationKeys);
    CorrelationKey key2 = new CorrelationKey(2,correlationKeys);
    CorrelationKey[] corrkeys = {key1,key2};
    QName[] names = { new QName(TEST_NS,"name1"), new QName(TEST_NS,"name2") };

        pi = process.createInstance(corr);
   

        ArrayList<CorrelationKey> correlationKeys = new ArrayList<CorrelationKey>();
        if (_correlationKeys != null) {
        if (_correlationKeys.indexOf("^") > 0) {
            for (StringTokenizer tokenizer = new StringTokenizer(_correlationKeys, "^"); tokenizer.hasMoreTokens();) {
                String corrStr = tokenizer.nextToken();
                correlationKeys.add(new CorrelationKey(corrStr));
            }
            return correlationKeys;
        } else correlationKeys.add(new CorrelationKey(_correlationKeys));
        }
        return correlationKeys;
    }

    _processInst = processInst;
        _correlator = correlator;
    }
 
  public CorrelationKey getCorrelationKey() {
    return new CorrelationKey(_correlationKey);
  }

   
    public Collection<ProcessInstanceDAO> findInstance(CorrelationKey key, boolean wait) {
        ArrayList<ProcessInstanceDAO> result = new ArrayList<ProcessInstanceDAO>();
        for (ProcessInstanceDAO instance : _instances.values()) {
            for (CorrelationSetDAO corrSet : instance.getCorrelationSets()) {
                CorrelationKey value = corrSet.getValue();
                if (value != null) {
                    if (value.equals(key)) result.add(instance);
                }
            }
        }
        return result;
    }

TOP

Related Classes of org.apache.ode.bpel.common.CorrelationKey

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.