Re: Activity scope variables

Gianfranco Boccalon <[email protected]> Thu, 11 Aug 2005 15:35:38 +0200
Newsgroups gmane.comp.java.enhydra.shark
Message-ID <[email protected]>
Hello Monique,

I try to explain what I need:
I'm writing a web application with a framework that supports "actions" 
(like Struts). I present to the user a TO-DO list, that is a list of 
activities (Shark activities) that i produce making some queries to 
Shark through the API.
When the user selects one of this activities for completion , I have to 
start one action, and I'd like to put the name of this action in a 
variable local to the activity (so not in the application, but in the XPDL).
This parameter may be ACTION_NAME, for example. This is the reason I'm 
asking for the same parameter with different values for different 
activities.

You're right when you say that I can use the id of the activity to make 
this task (in this case I make the association between the activity and 
the action directly in my application), but I'm evaluating and 
investigating about Shark's features for using it in my application, so 
I prefer to know all the options I have for solving my problem.

Thanks
Gianfranco

Monique Maker ha scritto:

> Hello Gianfranco,
>
> Sorry, it seems I misunderstood you.
>
> It is difficult to imagine why you will need different values of one 
> and the same variable at different steps (activities) of your process, 
> while these values are not managed by the workflow process. Please 
> explain your problem in more details.
>
> Meanwhile, I can suggest several "solutions":
> - Use a tool agent to do the tasks for you (this seems inappropriate 
> in your case but you may re-think);
> - As you know the process and the assignment, you can identify (a 
> lillte tricky) the activity by its _definition_ ID and you will not 
> need the "identification" variable anymore.
>
> Probably I will be able to propose more appropriate solution if I know 
> your problem in more details.
>
> Regards,
> Monique
>
> Gianfranco Boccalon wrote:
>
>> Hi Monique,
>> thanks for your reply.
>>
>> You gave me an alternative way if I use a JavaToolAgent, but there is 
>> an alternative if I dont use any agent ?
>> Suppose for example that I ask to shark (with Java code) for the 
>> activities that my user have to complete, and analizing some 
>> parameter of the activity I execute different tasks to complete the 
>> activity. All this through the Shark API, called by my code.
>>
>> What do you suggest in this case ?
>>
>> Gianfranco
>>
>>
>>
>> Monique Maker ha scritto:
>>
>>> Hello Gianfranco,
>>>
>>> You can change the value of some variable during the process 
>>> execution if it is appropriate in your case. I think that you cannot 
>>> define variables for activity or set different value for a 
>>> process-level variable for each activity in process definition 
>>> design time.
>>>
>>> However, it seems that you need to send some parameters to a tool 
>>> via JavaToolAgent. In this case you can do something else: you are 
>>> not forced to use only WRD as actual parameters - supply for the 
>>> corresponding parameter a hardcoded value, instead of WRD:
>>> - Define your tool, lets say with the following parameters: param1, 
>>> param2, myVariableConstant;
>>> - Define appropriate workflow application to call this tool;
>>> - At each call to the corresponding workflow application supply 
>>> someting like:
>>>  = activity1: WRD1, WRD2, "I want it in this way";
>>>  = activity1: WRD3, WRD4, "I want it in that way";
>>>  = activity1: WRD5, WRD6, "I want it in some other way";
>>>
>>> Unfortunately, this solution has some limitations:
>>> - you cannot use the corresponding paramer in "out" mode;
>>> - you can supply only simple values - string, integer, date, ... 
>>> There is no way to supply some user-defined Java objects.
>>>
>>> Regards,
>>> Monique
>>>
>>> Gianfranco Boccalon wrote:
>>>
>>>> Is it possible to have "Activity" scoped variables, accessible by 
>>>> Java code ?
>>>> I need to associate some parameters to some activities, but I dont 
>>>> find how to in the documentation.
>>>> I can define the parameters as "process parameters", and use them 
>>>> through the process context, but i'd like to use the same name for 
>>>> these parameters with different values for different activities.
>>>>
>>>> Some suggestions ?
>>>>
>>>> Regards
>>>> Gianfranco Boccalon
>>>>
>>>>
>>>>
>>>
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>>
>>> -- 
>>> You receive this message as a subscriber of the [email protected] 
>>> mailing list.
>>> To unsubscribe: mailto:[email protected]
>>> For general help: mailto:[email protected]?subject=help
>>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>>>  
>>>
>>
>
>------------------------------------------------------------------------
>
>
>--
>You receive this message as a subscriber of the [email protected] mailing list.
>To unsubscribe: mailto:[email protected]
>For general help: mailto:[email protected]?subject=help
>ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>  
>
gianfranco.boccalon.vcf (text/x-vcard, 282 B)
begin:vcard
fn:Gianfranco Boccalon
n:Boccalon;Gianfranco
org:Engineering Ingegneria Informatica S.p.A.
adr:;;Corso Stati Uniti 23/I;Padova;PD;35127;Italy
email;internet:[email protected]
tel;work:049/8692508
x-mozilla-html:TRUE
url:http://www.eng.it
version:2.1
end:vcard
message-footer.txt (text/plain, 271 B)
--
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws