Re: Re: Activity scope variables

[email protected] Thu, 11 Aug 2005 10:16:51 -0400
Newsgroups gmane.comp.java.enhydra.shark
Message-ID <OF3D9825DE.268C7422-ON8525705A.004D1696-8525705A.004E727F@intellicare.com>
Hi,

I faced a very similar situation and so had to think about it. The way i 
understand the problem, the process has several activities some of which 
are executed by Struts Actions. So which Action is executed depends on 
which activity the process is currently on and you want to avoid doing 
this mapping in the application (which is how I did it) but want it done 
in the xpdl itself. 

So (if I have the problem right..?) one way would be to have a wrd in the 
xpdl which is a Map which maps activity names to Action names. While 
executing a process, this activity name has to be extracted and then the 
wrd map can tell you which Action is involved (just place a toolagent 
activity right before the Struts Action activity which will decides this).

hth,
Geeta

Monique Maker <[email protected]> wrote on 08/11/2005 09:54:05 AM:

> Hello Gianfranco,
> 
> OK, this is a completely different picture :-) Now I understand that
> you need to set some WRD (Workflow Relevant Data) when the user 
> finishes his or her work. But I still cannot understand why you 
> insist this variable value to be private for the corresponding activity.
> 
> If you need this value somewhere later in your process, the best 
> solution is to ... set it as activity result :-) Note that if the 
> variable in question is not existing in the XPDL definition, the 
> value will not be passed further in the proces and you will not be 
> notified on this fact in any way.
> 
> Best Regards,
> Monique
> 
> Gianfranco Boccalon wrote:
> > 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
> >> 
> >>
> > 
> 
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> 
> 
> --
> 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

> 
> CONFIDENTIALITY NOTICE:This email is intended solely for the person 
> or entity to which it is addressed and may contain confidential 
> and/or protected health information.  Any duplication, 
> dissemination, action taken in reliance upon, or other use of this 
> information by persons or entities other than the intended recipient
> is prohibited and may violate applicable laws.  If this email has 
> been received in error, please notify the sender and delete the 
> information from your system.  The views expressed in this email are
> those of the sender and may not necessarily represent the views of 
> IntelliCare.
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