Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ice-dev] [triquetrum-dev] ice-triquetrum fork : we have lift-off!

Awesome! :-D Great work!

Jay

On Fri, Feb 26, 2016 at 2:51 AM, erwindl0 <erwindl0@xxxxxxxxx> wrote:



that worked!

the technical setup is ready now to go for real workflows working on a sample ICE data file.

erwin


Op 26/02/2016 om 03:26 schreef Jay Jay Billings:
Erwin,

Looks like you have done this right, but the NPE is the result of a bit of missing documentation on my part.

We only use a second Form in the case where ICE runs an Action in process() and that Action needs to request information not part of the original Form. This would be something like requesting a user name and password, if required. Checkout JobLauncher for an example.

FormStatus.NeedsInfo is specifically reserved for this case, so I've entered a bug to update that documentation. Your Model needs to use different values of FormStatus. Line 108 should be FormStatus.InfoError since there should be no good reason for that value to be null (the Entry won't even return that). At line 124, you can just return FormStatus.ReadyToProcess since the default configuration of the data component is technically valid for processing.

We typically cheat a little bit on implementing this and do something like:

FormStatus retStatus = FormStatus.ReadyToProcess;

if (someConditionBasedOnTheForm) {
   // ... do some work
} else {
   retStatus = FormStatus.InfoError;
}

This exploits the fact that an Entry will never return null and that however you configure the data component, the first selection will always be valid to process.

Jay


On Thu, Feb 25, 2016 at 4:47 PM, Erwin de Ley <erwin.de.ley@xxxxxxxxxx> wrote:
Hi Jay, ICE team,

I'm trying to implement a "2-step"-form on an ICE Item, as explained below. I.e. :
1. the user should get a list of available workflows (the list is now mocked with 2 painfully simple in-memory constructed model instances)
2. the user picks one model and then
3. the Item form should be replaced/extended with a form that shows dynamically generated workflow configuration entries
(based on the parameters that the workflow has defined in its model)
4. the user can optionally change parameter values and then launch the workflow

So I'm trying to add a datacomponent with on-the-fly generation of a variable set of form entries after giving the user the opportunity to pick a workflow.
But I can not get this working, although I think I'm close...

It seems the form and the included datacomponents of an item must be created in setupForm() that is already invoked during the base-class constructor invocation?
And that it should be possible to add entries to one of those datacomponents dynamically later on?
I've tried that, cfr attached source. Is someone able to review that?

I also hit an NPE, e.g. when trying to save the form after selecting a workflow or when clicking Go! for an incomplete form and then returning a FormStatus.NeedsInfo from inside process().

It seems the Item base class has an action property that is null. Do I need to set that one at some point? I could not see that being done in those examples though...

E.g. when saving :




!ENTRY org.eclipse.ui 2 0 2016-02-25 22:13:38.071
!MESSAGE Save Failed
!STACK 0
java.lang.NullPointerException
    at org.eclipse.ice.item.Item.getForm(Item.java:795)
    at org.eclipse.ice.core.internal.itemmanager.ItemManager.retrieveItem(ItemManager.java:315)
    at org.eclipse.ice.core.internal.Core.getItem(Core.java:448)
    at org.eclipse.ice.client.internal.Client.formUpdated(Client.java:607)
    at org.eclipse.ice.client.widgets.ICEFormEditor.notifyUpdateListeners(ICEFormEditor.java:1069)
    at org.eclipse.ice.client.widgets.ICEFormEditor.doSave(ICEFormEditor.java:710)
    at org.eclipse.ui.internal.SaveableHelper$2.run(SaveableHelper.java:156)
    at org.eclipse.ui.internal.SaveableHelper$5.run(SaveableHelper.java:285)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:463)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:371)
    at org.eclipse.ui.internal.WorkbenchWindow$14.run(WorkbenchWindow.java:2156)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2152)
    at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:293)
    at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:271)
    at org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelper.java:161)
    at org.eclipse.ui.internal.WorkbenchPage.saveSaveable(WorkbenchPage.java:3874)
    at org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:3888)


And when trying to Go! :

Exception in thread "Thread-73" java.lang.NullPointerException
    at org.eclipse.ice.item.Item.getForm(Item.java:795)
    at org.eclipse.ice.core.internal.itemmanager.ItemManager.retrieveItem(ItemManager.java:315)
    at org.eclipse.ice.core.internal.Core.getItem(Core.java:448)
    at org.eclipse.ice.client.internal.ItemProcessor.run(ItemProcessor.java:473)
    at java.lang.Thread.run(Thread.java:745)


regards
erwin

...

_______________________________________________
ice-dev mailing list
ice-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/ice-dev



--
Jay Jay Billings
Oak Ridge National Laboratory
Twitter Handle: @jayjaybillings

Back to the top