Idea

Mischa Spelt avatar image
0 Likes"
Mischa Spelt suggested

Make popups in List expressions a bit more flexible

I ran into the problem today where I had a token with an "item" label, that references an object in the model.

I also had an Operator resource with a direct reference and multiplicity, so no Group. I wanted to create a "distance" field on the Resource, to determine the distance from puller.item (instead of puller) to the operator. However, the code assumes that the physical object is the puller, and when acquiring a resource I cannot specify another puller, so I ended up rewriting the default code to the below, which gives me a nice popup straight in the List window.

Perhaps it is a simple but useful extension if some of the pre-defined options supported this (either with the simple popup or a more complex popup where I can also enter "Label: item")

  1. treenode value = param(1);
  2. treenode puller = param(2);
  3. treenode entry = param(3);
  4. double pushTime = param(4);
  5.  
  6. /**First Travel Destination of Task Sequence */
  7. treenode taskSequence = /**/puller/**/;
  8. /**\n Or Travel Distance to */
  9. treenode travelDistanceToDirect = /**/getlabel(puller, "item")/**/;
  10.  
  11. if (!objectexists(puller))
  12. return GLOBAL_UNREACHABLE;
  13. treenode destObject = NULL;
  14. if (isclasstype(puller, "TaskSequence")) {
  15. int travelTask = findmatch(getnroftasks(taskSequence), gettasktype(taskSequence, count) == TASKTYPE_TRAVEL);
  16. if (travelTask) {
  17. destObject = gettaskinvolved(taskSequence, travelTask, 1);
  18. }
  19. } else {
  20. updatelocations(travelDistanceToDirect);
  21. destObject = travelDistanceToDirect;
  22. }
  23. if (objectexists(destObject)) {
  24. updatelocations(value);
  25. return distancetotravel(value, destObject);
  26. }
  27. return GLOBAL_UNREACHABLE;
process flowresourceslist entriespullerexpression field
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

No Comments

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.