ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | jawe List | August 2004 Index

<--  Date Index  --> <--  Thread Index  -->

problems setting ParticipantType attribute


Hello all:

First of all I didn`t know to whom should I`ve addressed this e-mail then I 
send it to all developers. Sorry if it disturbed any of you.

We're using JaWE to design the workflow processes and the tool has been 
fantastic. However, we're having a little problem (that we hope you can 
easily help us to solve):

We're trying to make the "New Participant" dialog shows with its values 
filled. We were able to set the Name, Id and Description attributes, but we 
can't find a way to set the "ParticipantType" attribute. We also notice that 
we should set the "ParticipantType - Type" attribute with the "choiceName" 
value (eg: "Organizational unit", instead of "ORGANIZATIONAL_UNIT"), and that 
could be a problem for us, since we're from Brazil and translated the 
software to portuguese (and we also have some clients in Argentina and 
Uruguay), and we'll have to set the attribute with the "locale-dependent" 
value (the choiceName). As soon as I finish the translation I can send it to 
you to include it as another idiom for JaWE.

The code we wrote to try setting the values is as follows. Please, let us 
know if we're doing something wrong here.
-------------------------
// the code below should be on method 
"insertParticipantAndArrangeParticipants" of the 
org.enhydra.jawe.WorkflowManager class

if (parUO!=null) {
         Object[] insert = new Object[]{par};
         ...
} else {
         parUO=(org.enhydra.jawe.xml.elements.Participant)
            wfp.generateNewElement();
         // show dialog for entering initial participant data
         // here our modifications starts
         parUO.set("Description", "theDescriptionThatWeWant");
         parUO.set("Id", "theIdWeWant");
         parUO.set("Name", "theNameWeWant");
         // the code above works just fine!         
        ParticipantType pt = new ParticipantType();         
        // first, we tried this (with "HUMAN", in uppercase), but it didn't 
work. then, we tried as follows        
       ((ParticipantType)parUO.get("ParticipantType")).set("Type", "Human");
        // but that didn't work either. then, we tried this
         pt = (ParticipantType)parUO.get("ParticipantType");
         pt.set("Type", "Human");
         parUO.set("ParticipantType", pt);         
         // but when the dialog appears, we notice that it didn't work (name, 
id and description were set; participanttype was not)
         /* to test our code, we printted the values below, and got "Human" 
and "HUMAN". So far, so good. But when the dialog appears, none of the 
choices of the ParticipantType is selected). */
         System.out.println("string do partType: " + 
((ParticipantType)parUO.get("ParticipantType")).toString());
         System.out.println("Valor do partType: " + 
((ParticipantType)parUO.get("ParticipantType")).toValue());

/* So we tried a different approach: to show just the ParticipantType. Here 
is what we do: */         
         Window w=graph.getEditor().getWindow();
         XMLElementDialog de=new XMLElementDialog((JDialog)w,
                                                  
ResourceManager.getLanguageDependentString("DialogNewParticipant"));
         // our window, showing just the ParticipantType: none selected here, 
even with the code above showing the correct values!!!
         
de.editXMLElement(((ParticipantType)parUO.get("ParticipantType")).getPanel(), 
true, false);
         // if we didn't select any choice, we get "Human" / "RESOURCE_SET" 
with these two lines
         // if we select Human, we get the exactly same values as the 
previous print showed us: "Human" / "HUMAN"
         System.out.println("string do partType: " + 
((ParticipantType)parUO.get("ParticipantType")).toString());
         System.out.println("Valor do partType: " + 
((ParticipantType)parUO.get("ParticipantType")).toValue());
         /* the strange thing is that we get the New Participant dialog as we 
want if we choose "Human" in the previous dialog, but we still get the same 
values printed (as if we had setted those values correctly before!!)  */
         de.editXMLElement(parUO.getPanel(),true,false);
-------------------------

Thanks in advance. We'll be looking forward for your reply.

Best regards,
Gheller

Luiz Felipe M. Gheller
gheller@xxxxxxxxxxx

AG&M Soluções em Informática Ltda.
Av. Protásio Alves, 74/6 - Bairro Rio Branco
Porto Alegre - RS - Brazil
www.agem.com.br
agem@xxxxxxxxxxx

















<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.