cancel
Showing results for 
Search instead for 
Did you mean: 

Property Not Defined

rock_tu
Champ on-the-rise
Champ on-the-rise
Hi All
I have gone through advanced-workflow-tutorial second edition,Now I starting the Publish WihtePaper to Web(activiti) workflow,but there are some error,anyone can help me please?thenk you!
First,When a user edit the task and try to save it,but not success,appear errors as follows:
"org.activiti.engine.ActivitiException: Exception while invoking TaskListener: Exception while invoking TaskListener: 00160039 Failed to execute supplied script: 00160038 ReferenceError: "scwf_approveCount" is not defined. (AlfrescoJS#2)" and
"org.activiti.engine.ActivitiException: Unknown property used in expression: ${scwf_approveCount < 2}",I found that the property scwf_approveCount exists in the publishWhitepaper.bpmn20.xml file,why like that?
Second,I feel confused that in this workflow have been defined two groups,GROUP_Operations and GROUP_Marketing,there are some users in them,when I started the Publish WhitePaper to Web(activiti),at last,the users in the two groups don't have the task,why?anyone can help me?
Thanks in advances
9 REPLIES 9

rock_tu
Champ on-the-rise
Champ on-the-rise
Anyone can help me?thank you!

abarisone
Star Contributor
Star Contributor
Hi,
on page 32 the tutorial states that variables inside a script task (and the whole Javascript code snippet) should be written between !CDATA:

<scriptTask id="scripttask1" name="Submit" scriptFormat="javascript">
<script><![CDATA[var scwf_approveCount = 0; var scwf_tpApproved =
false;]]></script>
</scriptTask>


In the workflow definition you attached the CDATA section is missing.
Hope this helps.

Rgeards,
Andrea

rock_tu
Champ on-the-rise
Champ on-the-rise
Hi abarisone
First,thank you for your answer,I have modify like that
"<scriptTask id="scripttask1" name="Submit" scriptFormat="javascript">
<script><![CDATA[var scwf_approveCount = 0; var scwf_tpApproved =
false;]]></script>
</scriptTask>"
but it's sorry to tell you that doesn't work,do you know another reason cases this trouble?thank you very much!

Hi,
but are you receiving the same error?
If not, please provide the new stacktrace.

Regards,
Andrea

rock_tu
Champ on-the-rise
Champ on-the-rise
HI abarisone
I have got the same error like that "org.activiti.engine.ActivitiException: Exception while invoking TaskListener: Exception while invoking TaskListener: 00160060 Failed to execute supplied script: 00160059 ReferenceError: "scwf_approveCount" is not defined. (AlfrescoJS#2)",do you know why?
thank you in advances!

abarisone
Star Contributor
Star Contributor
Hi,
according to ecmarchitect page http://ecmarchitect.com/alfresco-developer-series, if you're using an alfresco version equal (or higher I think) than 4.2.c, you should use the code linked at this address http://ecmarchitect.com/images/articles/alfresco-workflow/alfresco-workflow-tutorial-42c.zip

Rgeards,
Andrea

rock_tu
Champ on-the-rise
Champ on-the-rise
Hi abarisone
Thank you for your suggestion,I have downloaded version 4.2.c,I running versioin 4.2.e,But I Got same error too,
"org.activiti.engine.ActivitiException: Exception while invoking TaskListener: Exception while invoking TaskListener: 00160048 Failed to execute supplied script: 00160047 ReferenceError: "scwf_approveCount" is not defined. (AlfrescoJS#2)" and "org.activiti.engine.ActivitiException: Unknown property used in expression: ${scwf_approveCount < 2}" anybody can help me?thank you in advances!

seifb
Champ in-the-making
Champ in-the-making
I have the same problem !!!
when i try to approve the workflow from marketing user show me this error message :
  org.activiti.engine.ActivitiException: Exception while invoking TaskListener: Exception while invoking TaskListener: 09120013 Failed to execute supplied script: 09120012 ReferenceError: "fowf_approveCount" n'est pas défini (AlfrescoJS#2) 


and if i chose reject it pass correctly but when i try to approve or reject the workflow from operations user show me that error message:
 org.activiti.engine.ActivitiException: Unknown property used in expression: ${fowf_approveCount == 2} 

drisschelouati
Champ on-the-rise
Champ on-the-rise
Same exact issue, i opened a new thread since this one looks a bit outdated and didnt solve the issue.

EDIT: i found a way to solve the problem. PLease see https://forums.alfresco.com/forum/developer-discussions/workflow/property-error-javascript-variables....