WebMethods 61 Developer New User Frustrations

the biggest thing that pisses me off is that when you copy and paste a service, it pastes the service but does NOt open it… .many a time i have made changes to the original service i was trying to copy thinking i was working on the copy only to realize after getting PRD errors that i changed the original… very annoying especially when you’re trying to debug an issue in PRD by stepping thru the pipeline… im used to it by now but this caused plenty of headaches at first…

overall the new developer is MUCH better than the old one…

Disabled line gets enabled

Ex.

  1. SEQUENCE
    2) BRANCH
    3) MAP

Now
Step1) disable the line 3
Step2) disable the line 1
Step3) enable the line 1

Result: Line 3) gets enabled as well! (I do not want the line to be enabled)

Ramendu,

I actually prefer this behavior. If you enable or disable a sequence, I think everything in that sequence should be affected. If not, what does it mean to disable/enable a sequence if its contents are not affected?

Mark

Mark,
Yes, you’d have grounds to complain if this wasn’t the case.
Also, enabling child flow steps by enabling the parent sequence isn’t new to Developer 6.1.

Nick Faiz

I think Ramendu was suggesting undo/redo feature at sequence level (atleast for the specific session)
I think it would come with significant performance/memory penalty if wM decides to implement it. Interesting though! I wished many times for that feature.

Hi Guys,

This thread has been very helping to learn about the flow steps in developer. I am confused about how to implement the following scenario and still it is on investigation …if any of you can help …it would be greatly appreciated.

For example …

Flow Service 1 starts :
try

some conditional …EXIT( from flow ) step


catch


Flow Service 1 ends

Flow service 2 starts :


invoke Flow service 1


Flow service 2 ends.

Flow service 3 starts :


invoke Flow service 2


Flow service 3 ends.

Now the question is:

When my conditional EXIT step executes in flow service 1, it has the ability to come out from the current running flow (its flow service 1). But I want to come out from all the parent flow services, too and stop the execution of it completely.

The only solution what i know is to develop a java service with a single statement ‘System.exit()’. I have not tried it though.

If any of you know the better solution in webMethods itself, i request you to share the same with me.

Regards,
Nilesh

Nilesh,

If you call System.exit(0);, the JVM will exit, stopping the whole IS. I assume this is not the desired action. Instead, try nesting your try/catch blocks so that the “exception” trickles up to the highest level. Make sure you signal “failure” so that the upper-level catch statement is reached. I just tried this and it worked.

Tate

Flow Service 1 starts :
try

some conditional …EXIT( from flow ) step


catch


Flow Service 1 ends

Flow service 2 starts :


try
invoke Flow service 1
catch
EXIT from flow, failure


Flow service 2 ends.

Flow service 3 starts :


try
invoke Flow service 2
catch
EXIT from flow, failure


Flow service 3 ends.

Hi Tate

Thanks for your response. Let me try this and update you.

What I believe is if i exit with signal failure …i will not be getting the lastError in pipeline of the top level service. But that is my assumption. First let me try the solution given by you.

Regards,
Nilesh

Hi Tate,
I tried and its working exactly the way you explained.

But when I say ‘Exit from flow’ with failure, it overrides the lastError object.

So my purpose is not getting served with this solution. My exact requirement is when some exception/error occurs in the low level (in our example, service 1), i dont want to execute any further steps and want to come out of the all the parent flows.

If we exit with failure, i am not getting the actual exception as lastError.

If I repeat my example:

Flow Service 1:
START
|–TRY
|-- MAP step
|-- INVOKE divideInts (divide by zero to create excpetion …)
|–CATCH
|-- INVOKE lastError
|-- EXIT from FLOW with Failure (failure msg: ‘Exiting …’)

Flow Service 2:
START
|–TRY
|-- MAP step
|-- INVOKE Flow Service 1
|–CATCH
|-- INVOKE lastError

Flow service 3:
START
|-- MAP step
|-- INVOKE Flow service 2
|-- MAP step

While executing Flow service 3, it gives me lastError in the pipeline with error message ‘Exiting …’. and exception type as ‘FlowException’.

I need the actual exception details as: ‘Arithmetic Exception’ and exception type as ‘ServiceException’.

That is also true, in this scenario, my actual exception is available but it is under lastError/pipeline/lastError/…exception details …

Is there any way to stop the complete flow when exception in service 1 ?

Regards,
Nilesh

In order for this to work the way you want, you will need to have the try/catch sequences in the very FIRST flow service.

All calls should be made to sub-flows without any try/catch blocks. This will percolate the errors all the way out for you.

There are instances however, where you will not want this. If this is the case, then you can bury catch blocks under the very first calling flow but be aware that the first catch block catches the error and proceeds to continue.

This can be handy if you are trying to connect and disperse data across multiple systems and in the event of an error, can move to the next processing step without issue.

HTH

Ray

Ray,

Thanks for the prompt response.
I did the same what you said. We have the scenario, where we need to handle the exceptions in sub flows. The other option is also a better one.

But in that case, i have to remove TRY/CATCH from my both the flow services (i.e. flow service 1 & 2). Then only the actual exception in flow service 1 will propagate till flow service 3.

One more trouble is, in either case, I am not able to exit from all the flows. In any of these cases, (with or without try/catch in any or all the flow services), when I say ‘EXIT’ in flow 1, it has the ability to exit from that flow only. But it will continue the execution till the last step of flow 3 or till some other exception.

I guess, there is no mechanism in webMethods to exit from all the parent flows while calling exit in sub flow.

Regards,
Nilesh

Nilesh,

Catching the error wasn’t mentioned as a requirement in your first email–you just said you wanted to stop. :slight_smile:

I’ve found it useful to code a java service that does nothing but throw a ServiceException, the type most often generated by IS. You can pass it whatever message you want. Instead of calling “exit from flow,” you can call your java service, passing in whatever came from getLastError. In this way, execution is stopped and the contents of the exception can by bubbled up.

And no, I don’t know of a “JUST STOP IT ALL!” service in IS. :wink:

Tate

There is a simple solution to this but not recommended, nor is it elegant.

Create only ONE flow service. Within the flow service, you will have the typical outer sequence, set to Success, and two sub-sequences, the first set to failure, the second to DONE.

Now, inside the inner sequence that is set to done, put in ANOTHER sequence, and make it just like the OUTER sequence you have now: set to success. Then, within this new sequence, put two new inner sequences, one set to failure and another following at the same level set to done. Should look like this:

 
SEQUENCE - Success 
   SEQUENCE - Try (failure) 
         SEQUENCE (success) Internal seq 1 
           SEQUENCE - Try (failure 
           SEQUENCE - Catch (done) 
         SEQUENCE (success) Internal seq 2 
           SEQUENCE - Try (failure 
           SEQUENCE - Catch (done) 
   SEQUENCE - Catch (done) 
 

You can place an exit anywhere you need to. In each catch block, use pub.flow:getLastError.

It’ll work… but in my opinion, not the best approach. But it is the only way I’ve found besides using Java.

HTH

Ray

Nilesh,

As Ray suggessted above post it will work and we have used the same logic in some critical instances and also we have built a javaservice which will catch the error from a subflow and will be retrieved from the pipeline and extract it in the main flow using getLastError.in all the subflows catch sequence we just have getLastError and Exit(Flow with signal as ON-FAILURE)

HTH,
RMG.

Hi All,

Just wana add my 2 cents …

In the developer, we can also use the “Event Manager” and filter the type of events (Alarm, Audit, GD, Exception, etc). We can attach to the Event Manager, a Flow Service (jave base or not) that will be fire each time the specific event take place …

In the Pub.Event.Folder, there is a document that has all the state we need to report on (threadid, service, time, error, etc)

Very useful :0)
A+

Tate,
You are absolutely right. My requirement is not to propagate the actual exception to the top level flow. My exact requirement is still to exit from all the parent flow and stop the execution.

Ray,
In your scenario, Where should I implement the logic of service 1 ?

I guess, I should make clear that my exact requirement is to exit from the all the parent flow services when there is any error/exception in the child flow.

If I fit your solution in my requirement , It may look like:

SEQUENCE - Success
–|SEQUENCE - Try (failure)
----|SEQUENCE (success) - Internal seq 1
------|SEQUENCE - Try (failure)
--------|INVOKE FLOW SERVICE 1
------|SEQUENCE - Catch (done)
----|SEQUENCE (success) - Internal seq 2
------|SEQUENCE - Try (failure)
--------|INVOKE FLOW SERVICE 2
------|SEQUENCE - Catch (done)
–|SEQUENCE - Catch (done)

But my logic is such like that I cannot make two seperate calls for service 1 & 2 from the top flow. I have to call service 1 internally from service 2.

I have to process data from top level flow in service 2 and then pass the results to service 1 and then again the results of the service 1 , i have to process and after massaging I have to return results to the top level flow.

Regards,
Nilesh

Nilesh,

Then I would put the SECOND inner try/catch block with in the first inner’s try block like this:

 
 
SEQUENCE - Success     
    SEQUENCE - Try (failure)           
 
           SEQUENCE (success) Internal seq 1             
                SEQUENCE - Try (failure             
 
                     SEQUENCE (success) Internal seq 2             
                             SEQUENCE - Try (failure             
                             SEQUENCE - Catch (done)     
 
                SEQUENCE - Catch (done)           
 
 
    SEQUENCE - Catch (done)  
 

It’s a bit confusing. The nice thing about this is that in each “sub” catch block, you run pub.flow:getLastError and then you can parse through the errors to determine if it is a correctable error.

Also, you can use a repeat function that is set to repeat on error, so if you do get an error, you can evaluate, make changes to the pipeline values and reprocess.

HTH,

Ray

Ray,

Your second example will definitely work for me. I can achieve my requirements done, if I implement the way you said.

Only concern is, ( I should not say concern, but i don’t have proper word for it, bear with me), your second example points toward coding the whole logic in a single flow service, doesn’t it ?

Would you say it would be easily readable or maintainable ?
Don’t we have any other option if we divide the logic according to the tasks it has to perform in a couple of flow services ?

Regards,
Nilesh

Nilesh,

I can’t say that I would keep it in one or create several sub-flows.

You stated what you wanted and I gave it to you. So, to accomplish your particular task in FLOW, I gave you the scenario above.

There have been a couple of interjections for the use of java. You can do this easily.

Either, take a look at the java API docs, or, conversely, if you have the EDI package installed, look for a service called invoke.

This java service invoke I think also exists in the PSUtilities package.

In any case, it allows you to pass in the necessary parameters to a java service and invoke the service in a java flow.

Then, further leveraging the java API, You can perform an IDataUtil.merge. This will merge the output of the invoke service in case there is an error.

I’m really glossing over this because I do not have the code sitting directly in front of me at the moment.

It is not something to take lightly in any case because your architect starts small and you start building on that. It is far better to build a solid foundation than to pitch a tent and build walls around it.

In any case, I hope you find something that will work.

Also, you could use the broker to pub/sub to processes, evaluate the results and take action accordingly. You could easily patternize the work using broker and IS component.

Easy to say, much harder to do.

HTH,

Ray

Hi Ray,

Definitely I can find the solution that will work. Well I would say, I found it and it’s working fine. But it is a little bit tricky. I was looking for the better one.

I implemented it as the following:

Flow 1:

MAP: …
CONDITION turns TRUE to exit from the flow.
Set variable status = fail
exit from flow.


Flow 2:

MAP: …
invoke FLOW 1 :
check status …
if fail …
exit from flow

flow 3

MAP …
invoke Flow 2
check status …
if fail,
exit from flow …

In this way, I can exit from all the parent flows while calling ‘exit from flow’ in flow 1.

I do know adding extra branch steps, its not good at performance point of view.

Hi All,

I really appreciate for your time and all the help get from all you to find out the better solution.

Regards,
Nilesh