Difference in results between stepping through flow and running.

Hello,

I am having an issue with developer/flow. I have put together a process that logs into a server and selects files that are ready to be processed. After processing the data I create a back up of the file and delete it off the server.

When I ‘run’ the process the file is not getting deleted from the server. If I ‘step’ through the entire process the file gets deleted like it should.

Does anyone have any suggestions as to what might cause this?

Thanks for the help!!!

Hi,

I donot find any difference in result , weather u step through or run the service

these are various debugging methods provided when developing the code

Thanks
Maram

Not sure what is wrong there, but you might try looking at your Session object. Different sessions can have different permissions. I noticed this type of session difference between debugging and runtime especially after going through the Broker.

Here is some junk code that you can throw into a java service to give you some (not all) of the Session’s parameters quickly. You can use a temporary explicit exit step after this to see the runtime session information. This code is not production ready. Please look through the code and make sure it won’t mess up your system before running (that is my way of absolving myself from any issues using the code).

I have only ever run this in 6.5, and i don’t have time to troubleshoot this, just know that it meets my private personal utility qualifications which means “it runs on my machine” (grin).

Oh, you will also need to import some or all of these to comile:

com.wm.app.b2b.server.Server
com.wm.app.b2b.server.ThreadManager
com.wm.app.b2b.server.User
com.wm.g11n.util.iContext
com.wm.lang.flow.FlowState
com.wm.util.pool.ObjectPool
java.io.PrintStream

the raw code:

IDataCursor cursor = pipeline.getCursor();
com.wm.app.b2b.server.Session session = Service.getSession();
cursor.insertAfter(“sessionAgeInMilliseconds”,"" + session.getAge());
cursor.insertAfter(“sessionCallCount”,"" + session.getCalls());
IData context = IDataFactory.create();
IDataCursor contextCursor = context.getCursor();
contextCursor.insertAfter(“currency”,session.getIContext().getCurrency());
contextCursor.insertAfter(“encoding”,session.getIContext().getEncoding());
contextCursor.insertAfter(“language”,session.getIContext().getLanguage());
contextCursor.insertAfter(“timeZone”,session.getIContext().getTimeZoneID());
cursor.insertAfter(“context”, context);
contextCursor.destroy();

cursor.insertAfter(“sessionName”,session.getName());
cursor.insertAfter(“sessionId”,session.getSessionID());
cursor.insertAfter(“sessionUser”,session.getUser().toString());

cursor.insertAfter(“sessionValues”,session.toString());

IData values = IDataFactory.create();
IDataCursor valuesCursor = values.getCursor();
String[] keys = session.getValueKeys();
for (int index = 0; index < keys.length;index++) {
String key = “unnamed”;
if (keys[index] != null) {
key = keys[index];
}
Object value = session.get(key);
if (! (value instanceof FlowState)) {
valuesCursor.insertAfter(key,value);
}
if (value instanceof FlowState) {
FlowState flow = (FlowState)value;
IData flowState = IDataFactory.create();
IDataCursor flowStateCursor = flowState.getCursor();
flowStateCursor.insertAfter(“isIncremental”,"" + flow.isIncremental());
//make into array of packages containing nodes
// flowStateCursor.insertAfter(“namespace”,"" + flow.getNamespace());
flowStateCursor.insertAfter(“pipeline”,flow.getPipeline());
flowStateCursor.insertAfter(“error”,flow.getError());
flowStateCursor.insertAfter(“exceptionPath”,flow.getExceptionPath());
flowStateCursor.insertAfter(“isDone”,"" + flow.isDone());
flowStateCursor.insertAfter(“lastFlowElement”,flow.last());
flowStateCursor.insertAfter(“ignoreTimeouts”,"" + flow.getIgnoreTimeouts());
flowStateCursor.insertAfter(“exit”,flow.getExit());
flowStateCursor.insertAfter(“current”,flow.current());
flowStateCursor.insertAfter(“currentPath”,flow.currentPath());
flowStateCursor.insertAfter(“hasMoreNodes”,"" + flow.hasMoreNodes());
flowStateCursor.insertAfter(“stateValues”,flow.getStateValues());
//flowStateCursor.insertAfter(“parent”,flow.getParent());
valuesCursor.insertAfter(key + " (com.wm.lang.flow.FlowState [probably a running trace])",flowState);
flowStateCursor.destroy();
}
}
cursor.insertAfter(“values”, values);
valuesCursor.destroy();
cursor.destroy();

Thanks for the reply. I was able to do a work around for the time being. I ended up putting a login and logout around the delete step. This seemed to have fixed the problem. If I get some time I will use the code you sent me. Thanks for the help!!!

I have faced a similar scenario too. I am using log4j for logging and when I run the service it works fine but when I step through a process it does not seem to be writing anything to the log file.

I read somewhere that when you debug a flow service the calling service is different to the service you are invoked. I don’t remember completely what that concept is about. If someone can throw a light on it, it would be great.

Ram Challuri

I learned a new thing…thanks