I Need help to create/insert NetBeans BPEL activities

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

I Need help to create/insert NetBeans BPEL activities

ztarek77
Hi,
I'm glad to enjoy the Netbeans SOA Forum and hope finding solution to my questions.
I want to create/insert BPEL activities in a BPEL process. I can read a bpel file and get the process activities till now.

Hereafter is my main :

    public static void main(String[] args) throws IOException, BadLocationException, Exception {
        // TODO Auto-generated method stub      
        File bpelFile = new File("models/ProcessTest.bpel");          
        FileInputStream fis = new FileInputStream(bpelFile);
        myCatalogModel calg= new myCatalogModel();
        Lookup lookup = Lookups.fixed(new Object[]{bpelFile, calg.loadPlainDocument(fis),
                   calg});
        ModelSource source = new ModelSource(lookup,true);
        //BpelModelFactoryImpl factory = new BpelModelFactoryImpl();
        BpelModelFactory factory = Lookup.getDefault().lookup(BpelModelFactory.class);
        BpelModel model = factory.getModel(source);      
        BpelBuilderImpl bpelBuilder = new BpelBuilderImpl((BpelModelImpl) model);        
        Assign asg=  bpelBuilder.createAssign();
        asg.setName("Assign1");
        Sequence seq= (Sequence) bpelBuilder.getModel().getProcess().getActivity().getChildren().get(0);
        seq.setActivity(asg, 0);
}

But when i try to create a new bpel activity like for example an "Assign" activity in the above code, the compiler throws an exception caused by the line
Assign asg=  bpelBuilder.createAssign();

Exception in thread "main" java.lang.UnsupportedOperationException: setAttribute access not supported.
    at org.netbeans.modules.xml.xam.dom.ReadOnlyAccess.setAttribute(ReadOnlyAccess.java:159)
    at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent.setAttribute(AbstractDocumentComponent.java:483)
    at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent.setAttributeQuietly(AbstractDocumentComponent.java:277)
    at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent.setAttribute(AbstractDocumentComponent.java:124)
    at org.netbeans.modules.bpel.model.impl.BpelEntityImpl.setAttribute(BpelEntityImpl.java:340)
    at org.netbeans.modules.bpel.model.impl.AttributeAccess.setAttribute(AttributeAccess.java:1048)
    at org.netbeans.modules.bpel.model.impl.AttributeAccess.setBpelAttribute(AttributeAccess.java:232)
    at org.netbeans.modules.bpel.model.impl.BpelEntityImpl.setBpelAttribute(BpelEntityImpl.java:405)
    at org.netbeans.modules.bpel.model.impl.NamedElementImpl.setName(NamedElementImpl.java:61)
    at org.netbeans.modules.bpel.model.impl.services.DefaultNameService.postDispatch(DefaultNameService.java:74)
    at org.netbeans.modules.bpel.model.impl.BpelModelImpl.postInnerEventNotify(BpelModelImpl.java:647)
    at org.netbeans.modules.bpel.model.impl.BpelEntityImpl.postEvent(BpelEntityImpl.java:858)
    at org.netbeans.modules.bpel.model.impl.BpelEntityImpl.<init>(BpelEntityImpl.java:92)
    at org.netbeans.modules.bpel.model.impl.BpelContainerImpl.<init>(BpelContainerImpl.java:51)
    at org.netbeans.modules.bpel.model.impl.ExtensibleElementsImpl.<init>(ExtensibleElementsImpl.java:44)
    at org.netbeans.modules.bpel.model.impl.NamedElementImpl.<init>(NamedElementImpl.java:42)
    at org.netbeans.modules.bpel.model.impl.ActivityImpl.<init>(ActivityImpl.java:49)
    at org.netbeans.modules.bpel.model.impl.AssignImpl.<init>(AssignImpl.java:56)
    at org.netbeans.modules.bpel.model.impl.BpelBuilderImpl.createAssign(BpelBuilderImpl.java:189)
    at Mytestpackage.MainTestClass.main(MainTestClass.java:59)


Could you please give me some hint about this problem, or a sample of code so i can create/insert BPEL activities.


Thank you very much in advance.