Workspace deliver and accept flow entries , help! [resolved]
![]()
sam detweiler (12.5k●6●195●201)
| asked Feb 04 '14, 3:23 p.m.
retagged Feb 04 '14, 4:54 p.m. by Sonia Dimitrov (271●5●9)
in my migration utility, I need to remap the flow entrys to point to local server artifacts.
getAcceptSources() and getFlowtargets() make sense.
I can manage those lists..
then there is get default/current AcceptFlow(), and get default/current Deliverflow().
no problem..
but set is ?
+
Indicates that the specified entry is the current one for the workspace for this direction (Accept or Deliver).
setCurrent(IFlowEntry entry)
setDefault(IFlowEntry entry)
Indicates that the specified entry is the default one for the workspace for this direction (Accept or Deliver).
what is the 'for this direction'? the flow TABLE contains both. as per above..
|
Accepted answer
![]()
The part about direction is not applicable at the moment. Flow targets are considered bi-directional and will not restrict users from delivering or accepting. If you're flowing to a target and have permission, you can deliver or accept. There are no one way flows. Accept flows are not used at the moment to enforce direction.
sam detweiler selected this answer as the correct answer
Comments great, thanks.. I'll comment out my accept flow support. I have a followup question.
but the handle is invalid for this repository, and an exception is thrown. I haven't tried to look at the product source yet for the workspace editor Can you post the exception that you're getting and maybe a snippet of your code? That might help determine why it didn't work.
thanks for making me look closer.. I was trying to use the workspace handle instead of the flownode entry.
(never ignore the requirement for an explicit cast!)
I can't ask the 200 developers to fix my mistake.
sorry, I must be blind.. where is save workspace?
I can see load, create, delete, but no save. I would have expected it to be on the workspacemanager..
seems this is built in.. you change the description and the workspace gets updated..
same with the flowtable..
one more small question..
if there is only 1 flow entry, is it required to set current and default?
The Eclipse workspace editor has its own notion of a working copy. When the user saves, the necessary operations are performed on the workspace to give the user a feeling of editing and saving a workspace as a transaction.
thanks.. the workspace I am looking at has one target stream. and its set as current and default. the stream handle is not valid, cause it is on a repository we cannot connect to. ![]()
there is ONE flowentry for delivertargets
List<IFlowEntry> targets = (List<IFlowEntry>)dev_flowtable.deliverTargets();
// loop thru the tagets, if any
for(int i=0; i<targets.size();i++)
(there is a bug here in dev_flowtable.deliverTargets(), the second time thru the loop
it returns null instead of an empty List<> after I have deleted the only flowentry.
this causes the shorthand
for(IFlowEntry target:dev_flowtable.deliverTargets()){}
to cause a null pointer exception when the table is empty. .
(same for acceptsources)
AND, when u delete the ONLY flowentry, the current/default are reset to empty
BEFORE u can process them ..
my code does
fixup the targets
fixup the sources
fixup default
fixup current
default and current are always not set by the time my code gets there.
they ARE set on the way in. this is a bad side effect.
I 'think' the only way out of this is to
read the old entries, figure out how they map
ADD a new flowentry(s),
figure out what should be new/current from the old to the new
set the current and default,
then REMOVE the bad flowentry(s).
on the other hand, if there is only ONE flowentry, then by default is MUST BE current and default
so the analogous config should be done (set them, you removed them when they were the only, and the only was removed)
dev_flowtable.removeDeliverFlow(target.getFlowNode());
I don't see how removing the last flow table entry causes #deliverTargets() to return null. You might want to open a bug report about this and state platform and the JVM version that you're using. This might be something specific to your configuration. The #deliverTargets() method calls Collections#unmodifiableList(..) and if the deliverTargets list was null then that would NPE.
I am still having trouble setting current/default
Can you provide a snippet of your code where you set the current or default flow entry or even the exception message? It's hard to tell if there's anything wrong with your code without looking at it or seeing the error.
showing 5 of 12
show 7 more comments
|
2 other answers
![]()
hopefully one last question.
I have two eclipse configurations. one with the 3.0.1 p2, one with the 4.0.4 p2
using 3.x to look at a workspace on 3.x I see (default)(current)
using 3.x to look at a copy of the workspace after a duplicate on system upgraded to 4.x I see (default)
then I replicate the workspace to another 4.0.4 system, and in the fixup, current is not set, but default is.
I debugged into the flowtable, dev_flowtable.setDefault(newnode);
and I see it is added to the 'defaults' list.
later when I use the workspace editor, (default) is not shown.
if I set it manually in the editor, and then save, close the editor, open editor,
'default' is not shown again.
if I sent both default and current manually.. only '(current)' is shown.
is this a UI bug? or a known change of behavior?
if I look at a workspace created on the end system, both (current) and (default) are shown.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.