Skip to content
March 10, 2013 / Pedro Gabriel

Create a Dynamic View Object

Sometimes you may feel the need to display different data and different attributes depending on the query you are performing for the same View Object. If you are feeling this need you should consider creating a Dynamic View Object. For this purpose, today I am going to show how to create a Dynamic View Object.

There are already some examples of how to create dynamic view objects like Andrejus Baranovskis have done in his blog in ADF Generator for Dynamic ADF BC and ADF UI post. In his case he created a dynamic view object based on a SQL query to the database. In my case I will show how to create a dynamic view object based on some external data (a service, a library that you already developed, and so on).

You can download this example here: DynamicViewObject.

The first step you need to take is to create a View Object. In the View Object creation wizard select the option “Rows populated programmatically, not based on a query”, click “Next” followed by “Finish”. And then expose it at the application model.

For now you have created an empty view object with no data but whether you can access in the Data Controls tab.

Next generate the classes for the Application Module.

DynamicVOAppModel

Now it comes the dynamic VO population. In the “AppModuleImpl.java” class create the method that will trigger the VO creation at runtime. Afterwards set this method as a Client Interface in order to call it at the page that uses this VO.

private static final String DYNAMICVO_NAME = "DynamicVO1";
private static final String DYNAMICVO_PATH = "model.viewObjects.DynamicVO1";

public void createDynamicVO(String voType) {
    List dynamicVOAttributes = getDynamicVOAttributes(voType);

    //Get a new View Object Definition.
    ViewDefImpl dynamicVODef = new ViewDefImpl(DYNAMICVO_PATH);

    //Get the current View Object instance.
    ViewObjectImpl dynamicVO = (ViewObjectImpl)findViewObject(DYNAMICVO_NAME);

    //Remove the current View Object instance.
    dynamicVO.remove();

    //Create a new View Object based on the new ViewDefImpl previously created.
    dynamicVO = (ViewObjectImpl)this.createViewObject(DYNAMICVO_NAME, dynamicVODef);

    //Create the attributes for the new ViewDefImpl.
    //The attributes created over the the ViewDefImpl, at this point, get passed to the ViewObjectImpl.
    List readOnlyTaskPayloadItems = createDynamicVOAttributes(dynamicVODef, dynamicVOAttributes);

    //Populates the attributes' values.
    populateDynamicVOAttributes(dynamicVO, dynamicVOAttributes);

    //Set the read only attributes.
    setReadOnlyDynamicVOAttributes(dynamicVODef, readOnlyTaskPayloadItems);
}

The “CreateDynamicVOAttributes” method creates the attributes for the view Object. All attributes must be created as “Updatable” in order to set their values, otherwise you’ll get an error saying that you cannot update read only attributes.

private List createDynamicVOAttributes(ViewDefImpl dynamicVODef, List dynamicVOAttributes) {
    List list = new ArrayList();
    try
    {
        if(dynamicVOAttributes.size() > 0) {
            for(int i = 0; i < dynamicVOAttributes.size(); i++) {
                 DynamicVOAttribute dynamicVOAttribute = dynamicVOAttributes.get(i);                 
                 if (dynamicVOAttribute.isReadOnly())                     
                     list.add(dynamicVOAttribute);                 

                 Class itemClass = getTypeClass(dynamicVOAttribute.getType());                 
                 byte updateable = getByteUpdateable(true);                 
                 AttributeDefImpl attribute = dynamicVODef.addViewAttribute(dynamicVOAttribute.getName(), dynamicVOAttribute.getName(), itemClass);                 
                 attribute.setProperty(AttributeHints.ATTRIBUTE_LABEL, dynamicVOAttribute.getName());
                 attribute.setMandatory(dynamicVOAttribute.isRequired());                 
                 attribute.setUpdateableFlag(updateable);             
            }         
        }         
        dynamicVODef.resolveDefObject();         
        dynamicVODef.registerDefObject();     
    }     
    catch (Exception ex) {         
        ex.printStackTrace();     
    }     
    return list; 
} 

The “populateDynamicVOAttributes” method set the dynamic VO attributes values.

 
private void populateDynamicVOAttributes(ViewObjectImpl dynamicVO, List dynamicVOAttributes) {     
    try     
    {         
        if(dynamicVOAttributes.size() > 0 ) {
            Row notifDinamicaPayloadVORow = dynamicVO.createRow();

            for (int i = 0; i < dynamicVOAttributes.size(); i++)
            {
                DynamicVOAttribute payloadItem = dynamicVOAttributes.get(i);
                notifDinamicaPayloadVORow.setAttribute(payloadItem.getName(), payloadItem.getValue());
            }
            dynamicVO.insertRow(notifDinamicaPayloadVORow);
         }
    }
    catch (Exception ex) {
         ex.printStackTrace();
    }
}

The “setReadOnlyDynamicVOAttributes” set “UpdateableFlag” property to false for read only attributes.

private void setReadOnlyDynamicVOAttributes(ViewDefImpl dynamicVODef, List readOnlyAttributes) {
    try
    {
        for(int i = 0; i < readOnlyAttributes.size(); i++)
        {
            DynamicVOAttribute payloadItem = readOnlyAttributes.get(i);

            byte updateable = getByteUpdateable(false);

            int indexAttribute = dynamicVODef.getAttributeIndexOf(payloadItem.getName());
            AttributeDefImpl attribute = (AttributeDefImpl)dynamicVODef.getAttributeDef(indexAttribute);
            attribute.setUpdateableFlag(updateable);
        }
    }
    catch (Exception ex) {
        ex.printStackTrace();
    }
}

Auxiliar methods.

private Class getTypeClass(int type) {
    Class result;
    switch(type){
       case 0:
         result = Integer.class;
         break;
       case 1:
         result = String.class;
         break;
       case 2:
         result = Date.class;
         break;
       default:
         throw new IllegalArgumentException("Not Suported Type: " +  type);
    }
    return result;
}

private byte getByteUpdateable(boolean updateable) {
    byte result;

    if (updateable)
        result = AttributeDef.UPDATEABLE;
    else
        result = AttributeDef.READONLY;

    return result;
}

Then set the task flow with two pages, one that calls the “createDynamicVOAttributes” (Home page) and other that displays the data filtered (DynamicVO).

DynamicVOTaskFlow

Both Home and DynamicVo pages has the following content:

DynamicVOPages

After dragging and drop the dynamic VO as a Dynamic Form into the page you will get the next result.

DynamicVOAppFinalResult

March 9, 2013 / Pedro Gabriel

Create Declarative Component with Modal

During an ADF application development sometimes you probably find yourself doing the same set of specific components more than once in different pages or even in the same page. If you are facing this issue or already have faced it you should consider using Declarative Components. With declarative components you developed once are use it whenever or wherever you want.

Today I will demonstrate how to develop a declarative component with an inputText that receives the result of searching for data in a modal, and a button to erase the data in the underlying inputText.

CreateDeclarativeComponentImage

You can download this example here: DeclarativeComponents.

First of all create a Generic Application with an ADF ViewController Project . After this you will get a normal ADF project but without the ADF Model Project. Then select to create an ADF Declarative Component and set the following values:

CreateDeclarativeComponent

Don’t forget to check the “Use Custom Component Class” checkbox and setting the desired name. This class exposes the java methods that afterwards can be invoked by the managed bean of the page that consumes this declarative component. In the same window you can set the attributes and methods, but I will make it right after “jspx” page have been created. Then set the following attributes and methods:

CreateDeclarativeComponentAttributes

CreateDeclarativeComponentMethods

In order to know the “Method Signature” for each method inserted you just need to see the component’s documentation, in this case the inputText component. A quick and easy way to do it is to use the provided short cuts. For example drag and drop an inputText, put the cursor over it and press CTRL + D.

Next step the following layout and components to the declarative component:

CreateDeclarativeComponentPage

Then set “CustomComponent.java” class with the following code. Here you can expose all the methods you want to use it later in the consumer page.

package component;

import common.DCUtils;
import java.util.Iterator;
import java.util.List;
import javax.faces.component.UIComponent;
import oracle.adf.view.rich.component.rich.fragment.RichDeclarativeComponent;
import oracle.adf.view.rich.component.rich.input.RichInputText;
import oracle.adf.view.rich.component.rich.output.RichOutputText;

public class CustomComponent extends RichDeclarativeComponent {

    private static final String OUTPUT_TEXT_ATTR_NAME = "outputText_AttributeName";
    private static final String INPUT_TEXT_VALUE = "inputText_Value";

    public CustomComponent() {
    }

    public Object getKeyName() {
        Object result = null;
        try
        {
            RichOutputText inputValue = (RichOutputText)getUIComponent(OUTPUT_TEXT_ATTR_NAME);
            result = inputValue.getValue();
        }
        catch(Exception ex)
        {
            ex.printStackTrace();
        }
        return result;
    }

    public Object getLabel() {
        Object result = null;
        try
        {
            RichInputText inputValue = (RichInputText)getUIComponent(INPUT_TEXT_VALUE);
            result = inputValue.getLabel();
        }
        catch(Exception ex)
        {
            ex.printStackTrace();
        }
        return result;
    }

    public Object getValue() {
        Object result = null;
        try
        {
            RichInputText inputValue = (RichInputText)getUIComponent(INPUT_TEXT_VALUE);
            result = inputValue.getValue();
        }
        catch(Exception ex)
        {
            ex.printStackTrace();
        }
        return result;
    }

    public void setValue(Object value) {
        try
        {
            RichInputText inputValue = (RichInputText)getUIComponent(INPUT_TEXT_VALUE);
            inputValue.setSubmittedValue(value);
            inputValue.setValue(value);
            DCUtils.refreshComponent(inputValue);
        }
        catch (Exception ex)
        {
            ex.printStackTrace();
        }
    }

    public void setValuetDisabled(boolean disabled) {
        try
        {
            RichInputText inputValue = (RichInputText)getUIComponent(INPUT_TEXT_VALUE);
            inputValue.setDisabled(disabled);
            DCUtils.refreshComponent(inputValue);
        }
        catch (Exception ex)
        {
            ex.printStackTrace();
        }
    }

    public void clearValue() {
        try
        {
            RichInputText inputValue = (RichInputText)getUIComponent(INPUT_TEXT_VALUE);
            inputValue.setSubmittedValue(null);
            inputValue.setValue(null);
            DCUtils.refreshComponent(inputValue);
        }
        catch (Exception ex)
        {
            ex.printStackTrace();
        }
    }

    private UIComponent getUIComponent(String componentId) {
        try
        {
            List children = this.getChildren().get(0).getChildren();
            Iterator iterator = children.iterator();

            while (iterator.hasNext())
            {
                UIComponent component = iterator.next();
                if (component.getId().equalsIgnoreCase(componentId))
                    return component;
            }
        }
        catch (Exception ex)
        {
            ex.printStackTrace();
        }
        return null;
    }
}

After this you have finished developing your declarative component. But before using it do the following steps: (1) create an “ADF Library Jar File” deployment plan; (2) include the generated jar in your ADF application. After this whenever you create a page in your ADF application you select your declarative component from the component palette. The consumer page I have created looks like this:

CreateDeclarativeComponentHome

Next you need to implement the methods for each operation of the declarative component. The Home’s managed bean is this:

package view;

import component.CustomComponent;
import javax.faces.event.ActionEvent;
import oracle.adf.view.rich.component.rich.fragment.RichDeclarativeComponent;
import org.apache.myfaces.trinidad.event.ReturnEvent;

public class Home {
    private Object value;
    private Object returnValue;
    private RichDeclarativeComponent customComponent;

public Home() {     }

     public void clearActionListener(ActionEvent actionEvent) {
         //Get CustomComponent class to acess its methods.
         CustomComponent component = (CustomComponent)customComponent;

         //Clears CustomComponent value but not the value passed to the component.
         component.clearValue();

         //You need to reset the value passed to the component,
         //otherwise it won't get cleaned.
         value = null;
    }

    public String searchAction() {
         return "search";
    }

    public void searchReturnListener(ReturnEvent returnEvent) {
         //Get CustomComponent class to acess its methods.
         CustomComponent component = (CustomComponent)customComponent;

         //Set CustomComponent with the new value.
         component.setValue(returnValue);

         //You need to set the value with new returned value,
         //otherwise you won't get it updated.
         value = returnValue;
    }

    public void searchActionListener(ActionEvent actionEvent) {
        // Add event code here with you need to perform previous
        // data computation
    }

    public void setValue(Object value) {
        this.value = value;
    }

    public Object getValue() {
        return value;
    }

    public void setReturnValue(Object returnValue) {
        this.returnValue = returnValue;
    }

    public Object getReturnValue() {
        return returnValue;
    }

    public void setCustomComponent(RichDeclarativeComponent customComponent) {
        this.customComponent = customComponent;
    }

    public RichDeclarativeComponent getCustomComponent() {
        return customComponent;
    }
}

The final result looks like this:

CreateDeclarativeComponentImageResult

November 28, 2012 / Pedro Gabriel

Communication Between Regions without Contextual Events

In most cases making use of Contextual Events in order to gather and send information between ADF regions may become hard to reach what we really want to achieve. In order to overcome this situation, today we will demonstrate how to accomplish ADF Regions’ communication by using ADF default out of the box functionalities.

You can download two slightly different versions of this example here: CommunicationBetweenRegions1, CommunicationBetweenRegions2.

For this example we created three regions, one we called “ParentsRegion” which gathers and publish information from/to the other two regions (“Region A” and “Region B”). The first step is to create ADF Task Flows, one for each region:

Then create the “Managed Beans” for each new ADF Task Flow. In “ParentsRegion” managed bean create new global variables to reference “RegionA” and “RegionB” managed beans. In “RegionA” and “RegionB” make the same but this time to reference “ParentsRegion” managed Bean. The “initFlow” method in “RegionA” and “RegionB” initializes the parent’s region variable. This double reference will allow you to gather and publish information between regions.

package CommunicationBetweenRegions;
import Common.Utils;
import javax.faces.event.ActionEvent;
import oracle.adf.view.rich.component.rich.output.RichOutputText;

public class ParentsRegion {

    private RegionA regionA;
    private RegionB regionB;

    private String yourName;
    private RichOutputText outputTextYourName;

    public void setRegionA(RegionA regionA) {
        this.regionA = regionA;
    }

    public RegionA getRegionA() {
        return regionA;
    }

    public void setRegionB(RegionB regionB) {
        this.regionB = regionB;
    }

    public RegionB getRegionB() {
        return regionB;
    }

    public void commandButtonClean(ActionEvent actionEvent) {
        yourName = null;
        regionA.cleanFirstName();
        regionB.cleanLastName();
    }

    public void commandButtonSubmit(ActionEvent actionEvent) {
        yourName = regionA.getFirstName() + " " + regionB.getLastName();
        Utils.refreshComponent(outputTextYourName);
    }

    public void setYourName(String yourName) {
        this.yourName = yourName;
    }

    public String getYourName() {
        return yourName;
    }

    public void setOutputTextYourName(RichOutputText outputTextYourName) {
        this.outputTextYourName = outputTextYourName;
    }

    public RichOutputText getOutputTextYourName() {
        return outputTextYourName;
    }
}

 

package CommunicationBetweenRegions;

import Common.Utils;

import oracle.adf.view.rich.component.rich.input.RichInputText;

public class RegionA {

    private ParentsRegion parentsRegionManagedBean;

    private String firstName = "";
    private RichInputText inputText_RegionA;

    public void initFlow() {
        this.parentsRegionManagedBean.setRegionA(this);
    }

    public void setParentsRegionManagedBean(ParentsRegion parentsRegionManagedBean) {
        this.parentsRegionManagedBean = parentsRegionManagedBean;
    }

    public ParentsRegion getParentsRegionManagedBean() {
        return parentsRegionManagedBean;
    }

    public void cleanFirstName() {
        this.firstName = "";
        Utils.refreshComponent(inputText_RegionA);
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setInputText_RegionA(RichInputText inputText_RegionA) {
        this.inputText_RegionA = inputText_RegionA;
    }

    public RichInputText getInputText_RegionA() {
        return inputText_RegionA;
    }
}

 

package CommunicationBetweenRegions;

import Common.Utils;

import oracle.adf.view.rich.component.rich.input.RichInputText;

public class RegionB {

    private ParentsRegion parentsRegionManagedBean;

    private String lastName = "";
    private RichInputText inputText_LastName;

    public void initFlow() {
        this.parentsRegionManagedBean.setRegionB(this);
    }

    public void setParentsRegionManagedBean(ParentsRegion parentsRegionManagedBean) {
        this.parentsRegionManagedBean = parentsRegionManagedBean;
    }

    public ParentsRegion getParentsRegionManagedBean() {
        return parentsRegionManagedBean;
    }

    public void cleanLastName() {
        this.lastName = "";
        Utils.refreshComponent(inputText_LastName);
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setInputText_LastName(RichInputText inputText_LastName) {
        this.inputText_LastName = inputText_LastName;
    }

    public RichInputText getInputText_LastName() {
        return inputText_LastName;
    }
}

Next you need to set “RegionA” and “RegionB” ADF Task Flow parameters based on previously created global variables.

Then create the page fragments, drag and drop “RegionA” and” RegionB” into “ParentsRegion” and finally define the input parameters for both regions as shown:

Now at runtime you can gather and clean the information on “RegionA” and “RegionB” while you click on “ParentsRegion” buttons.

Pedro Gabriel

November 27, 2012 / danilo

Call a document in a new tab

A few months ago we had a client requirement where upon some processing a document should open automatically, today we will demonstrate how to do this with a PDF document.

The ADF framework supports a listener that downloads files upon user click, but our approach is to open a file without user interaction. To do so we need to create a HTTP Servlet that opens our file, add servlet mapping in the web.xml file, and create  a taskflow example with navigation between two pages.

Step 1 – Create a HTTP Servlet

To create a new HTTP Servlet in JDeveloper choose HTTP Servlet via New Gallery, define its name and, on the next screen, define the mapping for your servlet. This will be registered on web.xml file.


A new Java class is created for the servlet but we will come back later to this. Now lets create a new taskflow for the servlet. In the property inspector window the URL Invoke field must be url-invoke-allowed, and the URL in URLView must match the pattern defined in web.xml


Step 2 – Create a taskflow example

Now lets create a taskflow to run the example. In our example we have two views with navigation and a method call, that calls our servlet, in between. Our idea is to have a button on our main page that its action is to navigate to another page, the method call is used to execute the servlet.


The Java code in our managed bean to call the servlet is as follows,


public void openDocument() {

byte[] fileInBytes = readFileToByteArray("D:\\work\\examples\\files\\document.pdf");

final String taskflowId="ShowPdfFlow";

String taskflowDocument="/WEB-INF/ShowPdfFlow.xml";
FacesContext fctx = FacesContext.getCurrentInstance();
Map<String, Object> params = new HashMap<String, Object>();
FacesContext ctx = FacesContext.getCurrentInstance();
HttpSession session = (HttpSession)ctx.getExternalContext().getSession(false);
session.setAttribute("documentToOpen", fileInBytes);

String taskflowURL = ControllerContext.getInstance().getTaskFlowURL(false,new TaskFlowId(taskflowDocument,taskflowId), params);
ExtendedRenderKitService erks = Service.getRenderKitService(fctx, ExtendedRenderKitService.class);
StringBuilder script = new StringBuilder();
script.append("window.open(\""+taskflowURL+"\");");
erks.addScript(FacesContext.getCurrentInstance(), script.toString());

}

We are reading a document to a byte[] and store it in session and this will be accessed from our servlet.

Step 3 – Changes to Servlet class

The changes to our servlet class ShowPdfServlet.java is as follows, we are reading the byte[], for the document, from session and write it on the outputstream.


...

byte[] doc = (byte[])request.getSession().getAttribute("documentToOpen");

ByteArrayInputStream bais = new ByteArrayInputStream(doc);
 response.reset();
 response.setBufferSize(DEFAULT_BUFFER_SIZE);
 response.setContentType("application/pdf");
 response.setHeader("Content-Length", String.valueOf(doc.length));
 response.setHeader("Content-Disposition",
 "filename=\"" + "document.pdf" + "\"");

BufferedInputStream input = null;
 BufferedOutputStream output = null;

 try {
 input = new BufferedInputStream(bais, DEFAULT_BUFFER_SIZE);
 output =
 new BufferedOutputStream(response.getOutputStream(), DEFAULT_BUFFER_SIZE);

byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
 int length;
 while ((length = input.read(buffer)) > 0) {
 output.write(buffer, 0, length);
 }

 request.getSession().removeAttribute("documentToOpen");

} finally {
 close(output);
 close(input);
 }

...

The example application is available here for download.

October 29, 2012 / danielsoaresmartins

How to recover stale composite instances and their components

Today we will demonstrate how to recover stale composite instances and their soa components. We had this problem in one of our customer’s production environment when one of the composites was undeployed by mistake. Given that there were no backups of the SOA/BPM database (SOAINFRA scheme) and that there aren’t any recovery scripts from Oracle we had to build our own and at our risk (Oracle does not support this kind of recovery and advises to keep regular backups).

The first step we took was to redeploy the composite which evidently shown all instances as stale. When a composite is deployed all the files are stored in the Metadata Services Repository (MDS) and it is tagged with a unique MDS label. So when we redeployed the composite, even though it was the same version, it was associated with a new MDS label.

You can see the label in the composite distinguished name (Composite DN) using Enterprise Manager in the composite information dialog:

For the undeployed composite we had to check in the stale composite instances (value of the composite_dn column in the composite_instance table of those instances).

The script we created requires some knowledge about the state of the various components we wish to recover, in our case Composites, BPM/BPEL Processes and Human Tasks. Fortunately there was some very useful information in the A-Team’s Soa blog about the state of SOA components namely the COMPOSITE_INSTANCE table for composite instances, the CUBE_INSTANCE table for BPEL/BPM processes, etc. This helped us understand what some of the states meant given that at the database level they are represented by numbers.

After performing a considerable number of tests we were successful in developing a plsql script that recovered the stale instances:

declare 
  -- Script Parameters:
  
  -- Composite Name
  cmpstName VARCHAR2(200) := 'TestZComposite';
  -- Composite Version
  cmpstVersion VARCHAR(20) := '1.2';
  
  -- Composite old distinguished name
  old_composite_dn VARCHAR2(500) := 'default/TestZComposite!1.2*soa_87ad6db9-5a3e-4e9a-8940-f9b2885121b4';
  -- Composite new distinguished name (new mds label => soa_51ea029f-6b84-40b1-af8d-ba9a0fa22a97)
  new_composite_dn VARCHAR2(500) := 'default/TestZComposite!1.2*soa_51ea029f-6b84-40b1-af8d-ba9a0fa22a97';
  -- Composite new MDS label
  new_mds_label VARCHAR2(200) := 'soa_51ea029f-6b84-40b1-af8d-ba9a0fa22a97';  
  
begin
  -- Step 1
  -- update compositedn (new mds label) and reactivate stale composites 
  -- (state 64 = stale, state 0 = running)
  update composite_instance ci
  set ci.composite_dn = new_composite_dn,
      ci.state = CASE
                   WHEN (ci.state is not null and ci.state = 64) 
                     THEN 0
                     ELSE ci.state                    
                 END
  where ci.composite_dn = old_composite_dn; 
  
  -- Step 2
  -- update mds label and compositedn in triggered messages
  update dlv_message dlvm
    set dlvm.composite_label = new_mds_label,
        dlvm.res_subscriber = CASE
                                 WHEN dlvm.res_subscriber IS NOT NULL 
                                     THEN replace(dlvm.res_subscriber, 
                                                  old_composite_dn, 
                                                  new_composite_dn)
                                     ELSE dlvm.res_subscriber                            
                               END
  where dlvm.composite_name = cmpstName and 
        dlvm.composite_revision = cmpstVersion;
  
  -- Step 3
  -- reactivate callbacks and update mds label and compositedn 
  -- (state 3 = stale/cancelled, state 0 = unresolved)
  update dlv_subscription dlv 
  set dlv.composite_label = new_mds_label,
      dlv.subscriber_id = replace(dlv.subscriber_id, old_composite_dn, new_composite_dn),
      dlv.state = CASE
                   WHEN (dlv.state IS NOT NULL AND dlv.state = 3)
                       THEN 0
                       ELSE dlv.state             
                  END
  where dlv.composite_name = cmpstName and
        dlv.composite_revision = cmpstVersion;
  
  -- Step 4
  -- reactivate references and update compositedn 
  -- (state 0 = successful, state 6 = stale)
  update reference_instance t 
  set t.state = 0,
      t.composite_dn = new_composite_dn
  where t.composite_dn = old_composite_dn and t.state = 6;       	
  
  -- Step 5
  -- reactivate bpel/bpmn processes and update compositedn 
  -- (state 1 = open running, state 9 = closed stale)
  update cube_instance cui 
  set   cui.composite_label = new_mds_label,
        cui.state = CASE
                       WHEN (cui.state IS NOT NULL AND cui.state = 9)
                           THEN 1
                           ELSE cui.state             
                     END
  where cui.composite_name = cmpstName and cui.composite_revision = cmpstVersion;
  
  -- Step 6
  -- reactivate human tasks and update compositedn
  UPDATE WFTASK TBL_NOTFS
    SET  TBL_NOTFS.STATE = CASE
                         WHEN (TBL_NOTFS.VERSIONREASON ='TASK_VERSION_REASON_INITIATED') 
                              THEN 'ASSIGNED'
                         WHEN (TBL_NOTFS.VERSIONREASON ='TASK_VERSION_REASON_WITHDRAWN') 
                              THEN 'WITHDRAWN'
                         WHEN (TBL_NOTFS.VERSIONREASON ='TASK_VERSION_REASON_REASSIGNED') 
                              THEN 'ASSIGNED'
                         WHEN (TBL_NOTFS.VERSIONREASON ='TASK_VERSION_REASON_ALERTED') 
                              THEN 'ALERTED'
                         WHEN (TBL_NOTFS.VERSIONREASON ='TASK_VERSION_REASON_SUSPENDED') 
                              THEN 'SUSPENDED'
                         WHEN (TBL_NOTFS.VERSIONREASON ='TASK_VERSION_REASON_ERROR') 
                              THEN 'ERRORED'
                         WHEN (TBL_NOTFS.VERSIONREASON ='TASK_VERSION_REASON_COMPLETED') 
                              THEN NULL
                         ELSE TBL_NOTFS.STATE                            
                       END,
         TBL_NOTFS.COMPOSITEDN = new_composite_dn,
         TBL_NOTFS.MDSLABEL = new_mds_label
   WHERE TBL_NOTFS.TASKDEFINITIONNAME is not null
     AND TBL_NOTFS.STATE = 'STALE'
     AND TBL_NOTFS.COMPOSITENAME= cmpstName
     and TBL_NOTFS.COMPOSITEVERSION = cmpstVersion;
  
end;

This script worked for us, however if you wish to apply it, I recommend you test it in controlled environment to make sure it works for you. For instance the composite we recovered didn’t have Mediator or Business Rules components, so if yours does you probably have to add additional instructions to the script in order to recover those components.

Best regards,
Daniel Martins

September 27, 2012 / André de Oliveira Sampaio

Link Consulting @ Oracle OpenWorld 2012

Following an invitation from Oracle, José Afonso Pires, will participate in a discussion panel on the topic “Gaining Victory over SOA and Application Integration Complexity”
Under the scope of this session, link consulting will be presenting a reference case, explaining how the implementation of a SOA governance model with Oracle technology contributes to streamline systems integration, improve the relationship between business and IT, reduce solutions time-to-market and increase the ability of reusing technological assets.
Oracle OpenWorld 2012 is an annual event receiving tens of thousands visitors and including conferences, several sessions, keynotes, etc. This is an event on the most recent IT technology, upgrades, tools, strategy, main trends and best practices.
The most important IT specialists in the world will lead the sessions where product and solution demonstrations will be made by some Oracle partners and customers.
 
Learn more about this event in http://www.oracle.com/openworld/
 
Image
September 23, 2012 / manuelcprosa

Link will be at the “5th International SOA, Cloud + Service Technology Symposium”

This September Link Consulting – Tecnologias de Informação, S.A. will be at the “International SOA, Cloud + Service Technology Symposium”, that will be held in London the 24th and 25th September.

This is a professional event, organized by Thomas Erl, one of the most renowned names in the area of Service-Oriented Architecture. Link Consulting was invited to this event to present a business case about SOA Governance, resulting from its deep knowledge and expertise in SOA Governance Oracle tools.

Information Systems have a main role in supporting the business challenges currently faced by energy companies – developing new businesses, fast paced changes in the energy network and in customer relationship. In this context, adopting a SOA approach allows a sustained increase in IT agility and a more effective answer to business requirements.

Following that line, Link Consulting will demonstrate how the implementation of SOA Governance model contributed to speed the integrations between systems, defining a model that closes the gap between businesses and IT, reducing the solutions time-to-market and increasing the ability of reusing IT assets.

 In this presentation, Link Consulting will mention the challenges of defining and implementing the SOA Governance Program, and how the practices and principles of SOA Governance will evolve while the Project is being implemented.

Link Consulting’s approach to SOA Governance is based on a set of methodology steps that define a solid governance model, providing the organizations with the required mechanisms to take the most out of Service-Oriented Architectures.

About “The International SOA, Cloud + Service Technology Symposium”

The “International SOA, Cloud + Service Technology Symposium” is a yearly event that features the top experts and authors from around the world, providing a series of keynotes, talks, demonstrations, and panels, as well as training and certification workshops – all with an emphasis on realizing modern service technologies and practices in the real world.

The International Symposium conference series is governed by Arcitura Education Inc., and is based on a “substance only” philosophy, meaning that selected speaker submissions are judged primarily on their educational and informational value. Any presentations that are selected are chosen to ensure that each session provides in-depth coverage and true value for the most important topics in the “International SOA, Cloud + Service Technology Symposium”.

 Learn more about this event in http://www.servicetechsymposium.com/

badge_02_100x100