Skip to main content
1-Visitor
July 11, 2013
Question

Workflow routing based on an attribute.

  • July 11, 2013
  • 1 reply
  • 4096 views

I have a workflow for a WTReferenceDocument soft type object. I also have custom attributes for the object. Once the workflow has started, I would at some point like to route the workflow based on the value of the attribute. How would I write the Routing expression in the conditional connector. Case in point, the possible values for the attribute are "Tim, Tom, Barry or Steve", The name of the attribute "Judge" and the object is a soft type of the WTReferenceDocument called. Summons.

1 reply

1-Visitor
July 11, 2013

In decision robot, make "Routing type" as 'Condotional' and in expression section get the value of that attribute.

Then based on that value, set the value of "result" as the path to be selected.

1-Visitor
July 11, 2013

Hi Manishkumar,

That is what I want to do however I don't know how the code should look like and how do I call the attribute (IBA) of the PBO in the expression section.

Regards,

1-Visitor
July 12, 2013

Hi Tshepo,

You can write following method in your workflow helper class:

-------------------------

public String getIBAValue(WTReferenceDocument objDoc,

String ibaName) {

wt.iba.value.IBAHolder holdProblemReport = (wt.iba.value.IBAHolder) objDoc;

com.ptc.core.lwc.server.LWCNormalizedObject orderHolderProblemReport = null;

String ibaValue = "";

try {

orderHolderProblemReport = new com.ptc.core.lwc.server.LWCNormalizedObject(

(wt.fc.Persistable) holdProblemReport, null, wt.util.WTContext

.getContext().getLocale(), null);

orderHolderProblemReport.load(ibaName);

ibaValue = (String) orderHolderProblemReport

.get(ibaName);

} catch (wt.util.WTException e) {

e.printStackTrace();

}

return ibaValue;

}

-------------------------

Call above method in expression section as below:

------

WTReferenceDocument pbo = (WTReferenceDocument)primaryBusinessObject;

ext.util.WF_Helper objHelper = new ext.util.WF_Helper();

String IBAValue = objHelper.getIBAValue(pbo, "IBA_internal_name");

------

Let me know if the answer was helpful or it is still not clear.

Regards,

Manish