need flow service steps to get disable steps as an output

Hi All!

need a flow service steps ,this flow service takes full qualified path of the flow service, need to check the which steps are disable and should give the output of disable steps and position of passing flow service

can any one help me to achieve this …scenario…

regards
anil kumar

I highly recommend NOT interacting directly with the Flow.xml files created during development until you have gained more experience and really, really understand what you are doing.

Are you being asked to create a utility to identify disabled steps in a Flow?

Mark

I agree with Mark that you’ll want to be cautious about doing this. This isn’t “normal” stuff that wM will support should you run into trouble.

That said, there is a way to do this–if you’re okay with using undocumented/unsupported services and APIs. There are a couple of ways to do this: one is to traverse services and determine what services it calls (its references); the other is for a known service, determine what services call it (its dependents).

For a references-based approach:

  • Use the WmValidate package available from Advantage as a model. It has services that traverse all services to identify missing references. You can leverage that to identify disabled dependents if desired.

  • Instead of looking for missing references, you want to see if the calling step is enabled, right? For a given service, you can use wm.server.ns.dependency:getReferences. This returns all the references that the given service has. You can traverse this list to determine which paths are enabled.

  • To get the details of a path, you need to get the pathNodes of the FLOW step. This can be done using wm.server.ns.dependency:getPathNodes. This accepts an nsName and a path. It returns a list of pathNode objects.

  • You can pass the 0th entry of the pathNode list to a custom Java service. This service does this:
    IDataCursor idc = pipeline.getCursor();
    com.wm.data.IDataPortable e = (com.wm.data.IDataPortable)IDataUtil.get(idc, “stepNode”);
    idc.destroy();
    IDataUtil.merge(e.getAsData(), pipeline);
    This gets all the properties of the FLOW step into the pipeline.

  • In the properties you’ll find a var named disabled if the step is disabled. If not present, the step is enabled.

For a dependents-based approach:

  • You’ll probably be looking for which services call a specific service or services. Use wm.server.ns.dependency:getDependent or getDependents for this. This will return a list of dependents and their paths.

  • For each dependent and path, get the details of the path as described above.

Obviously there are a lot of details left out but hopefully this is enough to get you started.

The one downside of this approach is that it will only work for enabled packages–all the work is done using wM-supplied facilities which work with the in-memory representation of everything.

HTH.