Calling protocols automatically

Hello,

I'm looking for a way for a forward a protocol automatically to another. ie. without user intervention.

An example is using a custom filter that checks for a variable. If the variable exists the protocol continues on and if it doesn't another protocol is called automatically.

My intention is to use this for login forms (ie. whether the user has logged in or not).

Thanks!
Answers 10
HP
HP 2008-07-15
You could consider using the "RunProtocol" pilotscript function to force execution of another protocol from within an expression component.
CF
CF 2008-07-15
Hi Chris,

I gave that a try but it doesn't seem to work.

If I understand the runProtocol() correctly, it runs the specified protocol and then returns the data back to calling protocol.

What I need is to "fully move" to the next protocol.
JS
JS 2008-07-15
The easiest way to do this is to actually drag the protocol you want to run into the window of the current protocol and adding an input port onto it. I've attached an example here.

Basically protocol shortcuts work the same way as subprotocol shortcuts. If you update the parent protocol, the shortcut gets updated. It's a pretty simple way of implementing workflow within PP.
comment imagecomment image
HP
HP 2008-07-16
I'm not sure that June's method is going to be the answer to "fully move" to another protocol, either, since it would behave to the user much like the RunProtocol method would (but much easier to view and understand).

If you told us more details about how you're using this, it might be clearer. How are your users calling these protocols? Solely through Web Port, or do you have some other web framework that serves forms generated by Pipeline Pilot? One option you might consider is using runjob.pl to initiate your form-creation protocols, since that will automatically redirect users to a login page if they are not yet authenticated.
HP
HP 2008-07-17
It might be a bit ambitious to call this "workflow." If you mean a sequential and synchronous execution of protocols in a single CPU process, then I guess you might be right. But for typical uses of the term "workflow," I wouldn't be quite so bold. PP is great and flexible and solves world hunger and all, but its "workflow" capabilities aren't really there.

IMO, the main attraction to workflow is the ability for an arbitrary automated business process to hibernate and be resurrected and continue at any time when new information becomes available. I don't really see how you could accomplish this very well in PP without some sort of external framework to help execute the right protocols at the right time.

And IIRC, components are resolved as required at initialization time, so if you don't have data entering a component for a particular run of the protocol, it wouldn't ever have to get the full xml content for that component.
CF
CF 2008-07-17
Well, the how is what's in contention. I'll explain...

What I want is a persistent login. I have a set of 5 protocols, A calls B, B calls C, etc. Protocol D displays an HTML page of compound names, and clicking on one calls protocol E which displays information on that compound. This information is restricted, however, and requires the user to log in to my database.

The persistent auth details need to be stored in protocol D. Since I can't back-add properties I am using filters in Protocol D.

Filter 1 checks if a compound name is specified:
No --> Display the list of compounds (the "default" when protocol is first called)
Yes --> Recalls protocol D (See below)

The "yes" case calls another filter
Filter 2 checks if login details are present:
No --> login form presented (will again call protocol D when submitted)
Yes --> forward to protocol E ****** Here is the protocol forwarding! ******

The flow for protocol D is therefore:
Display compound list
Login
Call protocol E

This is all done through Web Port. I'm not sure how to utilize runjob.pl to accomplish this (if possible). Any help would be appreciated.

Thanks!
JS
JS 2008-07-17
quote:
Originally posted by WvH:
quote:
It's a pretty simple way of implementing workflow within PP.


June,

Thanks for this, it has been staring me in the face all the time and I did not see it. One question though: Are all protocol shortcuts resolved when loading the top protocol? If I have shortcuts to multiple protocols, the protocol that is loaded in memory can become prohibitively huge. If shortcuts are only resolved when actually called this would not happen.


I believe that they are only resolved when actually called, but don't quote me on that.
JS
JS 2008-07-17
quote:
Originally posted by Chris F.:
It might be a bit ambitious to call this "workflow." If you mean a sequential and synchronous execution of protocols in a single CPU process, then I guess you might be right. But for typical uses of the term "workflow," I wouldn't be quite so bold. PP is great and flexible and solves world hunger and all, but its "workflow" capabilities aren't really there.


Right, and real "workflow" within PP has been requested for at least the past five years, possibly more. I guess protocol flow would have been a better term.
HP
HP 2008-07-17
quote:
It's a pretty simple way of implementing workflow within PP.


June,

Thanks for this, it has been staring me in the face all the time and I did not see it. One question though: Are all protocol shortcuts resolved when loading the top protocol? If I have shortcuts to multiple protocols, the protocol that is loaded in memory can become prohibitively huge. If shortcuts are only resolved when actually called this would not happen.
HP
HP 2008-07-17
It looks like June's initial suggestion might be a simple way to solve this. You have one login form, whose submission results in execution of a protocol ("D"). That protocol will initially verify the login credentials. If they're bad, then it writes out another login form. If they're good, then it writes out the protocol E report. Would that work?

Also, what do you mean by "I can't back-add properties"?

As for runjob, I had thought that would be a good way for you to automatically take advantage of the built-in authentication and cookie management. But, it sounds like you're talking about a database login that is independent of a domain login, so I don't think you'd gain anything by trying to use runjob.pl. There was another discussion on this forum about using runjob, though, and Andrew LeBeau gave some pointers on how to take advantage of it. But it is a much more manual (and undocumented) process than using Web Port.