123
Points
Questions
2
Answers
15
-
Hi,
You would have to still manually connect to an IAgileSession as you would with any other SDK program. However, you can do this by coding your credentials, or by having the URL use the HttpServletRequest to fetch the user who is logged in and launched the PX.
For configuring the PX, You specify the page of your web app in the “Process Extension” node of the Java Admin Client. When launched form ACtions menu, Agile will suffix thje URL configured with object information so the web app can determine what object the URL PX was launched from.
Example
http://[HOST]/MyWebApp/RunThisServlet?agile.classID=2472552&agile.1047=DEVIATION123&agile.userName=dmcdonald01&ContextType=Deviation&ContextName=DEVIATION
Only part of URL specified in Admin Client is http://[HOST]/MyWebApp/RunThisServlet but Agile will throw on the rest.
Then in your web app:
private String getResponse(HttpServletRequest request) throws Exception {
String response = new String();
URL = "http://" + host + ":7001/Agile";
HashMap<Integer, HttpServletRequest> params = new HashMap<Integer, HttpServletRequest>();
params.put(AgileSessionFactory.PX_REQUEST, request);
AgileSessionFactory factory = AgileSessionFactory.getInstance(URL);
IAgileSession s = factory.createSession(params);
String user = request.getParameter("agile.userName");
String num = request.getParameter("agile.1047");
IChange ichg = (IChange) s.getObject(IChange.OBJECT_TYPE, num);
//Do Something
return response;
}
Hope this helps!
- 155 views
- 1 answers
- 0 votes
-
You would need to set this up as a Synchronous, Pre Trigger Update Title Block event. During the Pre-Event, you would need to fetch the IEventDirtyCell for each attribute A1 & A2 and then triage from there. Throw a new Exception if IEventDirtCell for A2 is null (meaning its not updated) which will error the “Save”
IDataObject ido = uEvent.getDataObject();
IAgileClass cls = ido.getAgileClass();IAttribute a1Att = cls.getAttribute(“A1AttributeID”);
IAttribute a2Att= cls.getAttribute(“A2AttributeID”);IEventDirtyCell a1EDC= uEvent.getCell(a1Att.getId());
IEventDirtyCell a2EDC = uEvent.getCell(a2Att.getId());if(a1EDC.getValue().ToString().contains(“OTHERS”) && a2EDC ==null){
//A1 is set to others but A2 is not modified
throw new Exception( “A1 is set to others but A2 is not modified. Please try again”_;
}
- 118 views
- 1 answers
- 0 votes
-
- 391 views
- 3 answers
- 0 votes
-
Here’s how I do it with IUpdateTableEventInfo for attachments but would work similar for Affected Items table. Note the Event Action specifies to do something if its EventConstants.DIRTY_ROW_ADD_ROW. Another UpdateTable event will be triggered when you update the cell you want to set, but I think that would give a DIRTY_ROW_UPDATE_ROW event action
IUpdateTableEventInfo info = (IUpdateTableEventInfo) event;
IObjectEventInfo ioeInfo = (IObjectEventInfo) event;
IEventDirtyTable edt = info.getTable();
Iterator<?> it = edt.iterator();
while (it.hasNext()) {
IEventDirtyRow aRow = (IEventDirtyRow) it.next();
if (aRow.getAction() == EventConstants.DIRTY_ROW_ACTION_ADD_FILE || aRow.getAction() == EventConstants.EVENT_CHECK_IN_FILES) {
IDataObject ido = info.getDataObject();
//Set your cell value here against the ido
} else {
continue;
}
}
- 357 views
- 1 answers
- 0 votes
-
- 417 views
- 1 answers
- 0 votes
-
We’ve set up a custom External URL PX tool for many self-serve custom reports that aren’t handled by out-of-the-box Agile. Its a webapp that houses many custom reports that prompts users for certain report options. One of them us a multiple item where-used report which takes part numbers from a text box (each part number on a different row), parses for unique numbers, and then performs a where used search on each number, and presents the user with a single Excel file of the results. Bit of work to set up but we rely heavily on some of these custom reports.
- 624 views
- 3 answers
- 0 votes
-
Personally, I usually check this by fetching the IAgileClass of the affected item, and then using the isSubclassOf method:
ITable affectedItems = ichg.getTable(ChangeConstants.TABLE_AFFECTEDITEMS);
Iterator it = affectedItems.Iterator();
while(it.hasNext()){
IRow row =(IRow)it.next()
IAgileClass subcls = row.getReferent().getAgileClass();
if(subcls.isSubclassOf("Documents"){
//ignore
else if(subcls.isSubclassOf("Parts"){
//DoSomething
}
}
- 1365 views
- 3 answers
- 0 votes
-
Hi Jackie,
I believe this is an issue with the workflow configuration in the admin client. You would have to check that workflow configuration and then go to the Released status and make sure that there is a criteria there that matches the parts you are trying to release. Its possible your affected items or MCO don’t meet any of the defined criteria and I believe that would be why you encounter that error.
- 460 views
- 1 answers
- 0 votes
-
Hi Sabarish,
We have a PRE event set up with the following. I think it could also be a POST if you aren’t trying to error anything. Should be able to get details from the IFileEventInfo object
IFileEventInfo fEvent = (IFileEventInfo) event;
IEventDirtyFile[] files = fEvent.getFiles();
String fileName = new String();
for (IEventDirtyFile edf : files) {
fileName += edf.getFilename();
}
- 843 views
- 1 answers
- 0 votes
-
Hi AJ,
I’ve had the best luck mapping the dashboard to a Saved Search and using the out of the box “Workflow Routings”. There should be one called “Changes that require my approval” which should capture any pending approval. There is also another one called “Changes that require my acknowledgment”. I believe the “Workflow Routings” upper tab (beside the dashboard tab) is driven off these non-editable searches. Access to the “Workflow Routings” searches is controlled via each user’s profile “Searches” attribute.
Would that work?
dmcdonald01
- 1171 views
- 2 answers
- 0 votes