I'm unsuccessfully trying to find out whether a variable is defined or not. Is there a simple way to do this?Context:I'm inside a workflow.jbpm.AlfrescoJavaScript action (defined in a workflow) and am trying to check whether bpm_workflowDueDate is set or not.The following two
bpm_workflowDueDate === undefined
typeof bpm_workflowDueDate == 'undefined'
throws the following Exception
16:09:22,203 ERROR [graph.def.GraphElement] action threw exception: Failed to execute supplied script: ReferenceError: "bpm_workflowDueDate" is not defined. (AlfrescoScript#1)
org.alfresco.service.cmr.repository.ScriptException: Failed to execute supplied script: ReferenceError: "bpm_workflowDueDate" is not defined. (AlfrescoScript#1)
at org.alfresco.repo.jscript.RhinoScriptService.executeScriptString(RhinoScriptService.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:116)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
Thanks in advance for a hint on this one