# Process Control Interface

The Process control is used to send requests to and receive callbacks from another business process. The Process control is typically used to call a subprocess from a parent process.

The following are the Process control methods:

    package com.bea.control;

    import com.bea.control.ServiceProxy;
    import com.bea.control.Control;
    import com.bea.control.ControlException;
    import com.bea.wli.control.dynamicProperties.ProcessControlPropertiesDocument;
    import java.net.URI;

    /**
     * The process control is used to call a sub-process from a parent process.
     * Sub-process callbacks are routed to the caller process. The sub-process must
     * be in the same domain as the caller. The invocation is dispatched
     * internally over RMI without going through http. If the target process is
     * versioned, the actual version invoked depends on
     * the version strategy of the caller (as specified by the jpd:version annotation).
     *
     * The process control runtime properties can be configured externally through
     * dynamic properties and xquery selectors.
     */
    public interface ProcessControl extends Control, ServiceProxy, Asynchronous
    {
        /**
         * Manual control over conversation ID
         * @param conversationID
         */
        public void setConversationID(String conversationID);

        /**
         * Returns the conversation ID currently associated with this
         * control or null.
         * @return conversation id
         */
        public String getConversationID();

        /**
         * Manual control over the target uri.
         * @param uri
         * @throws ControlException if the caller process has "tightly-coupled" versioning semantics.
         */
        public void setTargetURI(URI uri) throws ProcessControlException;

        /**
         * Returns the target URI or null if not assigned.
         * @return target uri
         */
        public URI getTargetURI();

        /**
         * Sets credential information.
         * @param username
         */
        public void setUsername(String username);

        /**
         * Sets credential information.
         * @param password
         */
        public void setPassword(String password);

        /**
         * Gets credential information.
         * @return username
         */
        public String getUsername();

        /**
         * Resets the conversational state of the proxy; this could result
         * in dropping an existing conversation.
         */
        public void reset();

        /**
         * Sets the dynamic properties for the control
         * @param props the dynamic properties for the control
         */
        void setProperties(ProcessControlPropertiesDocument props) throws ProcessControlException;

        /**
         * Returns the current control properties. Note that this
         * does not include username/password.
         * @return the properties
         */
        ProcessControlPropertiesDocument getProperties();
    }

### Sample Sub-Classed Process Control

The following code shows an example of a sub-classed control. This code was automatically created by the control wizard based on a business process used in the WebLogic Integration samples.

    package FunctionDemo;

    /**
     * @jc:location
     uri="/ApplicationIntegration/FunctionDemo/CustomerMgmt.jpd"
     * @editor-info:link source="CustomerMgmt.jpd" autogen="true"
     */
    public interface CustomerMgmtPControl extends
    com.bea.control.ProcessControl, com.bea.control.ControlExtension
    {
        public interface Callback
        {
            /**
             * @common:message-buffer enable="true"
             */
            public void sendSummary(java.lang.String summary);
        }

        /**
         * @jc:conversation phase="start"
         */
        public void getCustomerInfo(java.lang.String firstName,
     java.lang.String lastName, java.lang.String email);
    }