cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to compile model

subash
Champ in-the-making
Champ in-the-making
Hi,
I am using alfresco 3.3 version.
I am doing the custom workflow using the tutorial 'Packt publishing' alfresco development tutorial.
While creating the model  by enabling 'Model active option '   i am getting the following error.
————————————————————————————————————
Please correct the errors below then click OK.

    * A system error happened during the operation: 05160037 Failed to compile model global:model
—————————————————————————————————————-
My workflow xm l file is given below.
<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="global:model"
xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!– Optional meta-data about the model –>
<description>Someco Workflow Model</description>
<author>Optaros</author>
<version>1.0</version>
<!– Imports are required to allow references to
definitions in other models –>
<imports>
<import uri=
"http://www.alfresco.org/model/dictionary/1.0"
prefix="dz" />
<import uri="http://www.alfresco.org/model/bpm/1.0"
prefix="bpm" />
</imports>
<!– Introduction of new namespaces defined by this model –>
<namespaces>
<namespace uri="my.new.model"
prefix="global" />
</namespaces>
<types>
<type name="global:reviewTask">
<parent>bpm:startTask</parent>
<properties>
<property name="global:nurse_id">
<title>Nurse No.</title>
<type>d:int</type>
</property>
</properties>
</type>
</types>
</model>


Please tell me where the problem is.

Thanks in Advance
Subash
27 REPLIES 27

subash
Champ in-the-making
Champ in-the-making
Hi,

After adding the above line also ,it is not creating the space named 'approved';
Any restriction in the space where we are starting the process ie starting location of the content ?


Thanks
Subash

rajanigupta
Champ in-the-making
Champ in-the-making
well I run my wrkflow without these lines and it worked…
well tell me one thing if ur workflow is wrking correctly without these lines or not??

Because there is no mystery in only these two lines…
SO first tell me this….

subash
Champ in-the-making
Champ in-the-making
Hi,
  My code is same that u given,
<task-node name="approved">
        <task name="wf:approvedParallelTask" swimlane="initiator" />
        <transition to="end" >
      
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<runas>admin</runas>
<script>
<variable name="bpm_package" access="read" />
<expression>
var origin = bpm_package.children[0].parent;
var root = origin.parent;
var destination = root.childByNamePath("approved");
for (var i=0; i &lt; bpm_package.children.length; i++)
{
bpm_package.children.move(destination);
}
</expression>
 
</script>
</action>
</transition>

    </task-node>
Not working in my case.
After approving by all approvers it should move to 'approved' space rt?
Other than adding this any other changes ?
Help Smiley Surprisedops:
Subash

rajanigupta
Champ in-the-making
Champ in-the-making
have u approved the task by going in admin's "task to do list"?

because only after that the document moves.

well my full def is as below:
<?xml version="1.0" encoding="UTF-8"?>

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wfSmiley Tonguearallelgroupreview">

    <swimlane name="initiator"></swimlane>

    <start-state name="start">
        <task name="wf:submitGroupReviewTask" swimlane="initiator" />
        <transition name="" to="startreview"/>
    </start-state>

    <node name="startreview">
        <action class="org.alfresco.repo.workflow.jbpm.ForEachFork">
            <foreach>#{people.getMembers(bpm_groupAssignee)}</foreach>
            <var>reviewer</var>
        </action>
        <event type="node-enter">
            <script>
                <variable name="wf_approveCount" access="write" />
                <expression>
                    wf_approveCount = 0;
                </expression>
            </script>
        </event>
        <transition name="review" to="review" />
    </node>

    <task-node name="review">
        <task name="wf:reviewTask">
            <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
               <actor>#{reviewer}</actor>
            </assignment>
            <event type="task-create">
                <script>
                    if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
                    if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
                </script>
            </event>
        </task>
        <transition name="reject" to="endreview" />
        <transition name="approve" to="endreview">
            <script>
                <variable name="wf_approveCount" access="read,write" />
                <expression>
                    wf_approveCount = wf_approveCount +1;
                 </expression>
            </script>
        </transition>
    </task-node>

    <join name="endreview">
        <transition to="isapproved" />
    </join>

    <decision name="isapproved">
        <event type="node-enter">
           <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
              <script>
                 <variable name="wf_reviewerCount" access="write"/>
                 <expression>people.getMembers(bpm_groupAssignee).length;</expression>
              </script>
           </action>
           <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
              <script>
                 <variable name="wf_requiredPercent" access="write"/>
                 <expression>wf_requiredPercent = wf_requiredApprovePercent;</expression>
              </script>
           </action>
           <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
              <script>
                 <variable name="wf_actualPercent" access="write"/>
                 <expression>wf_actualPercent = ((wf_approveCount * 100) / people.getMembers(bpm_groupAssignee).length);</expression>
              </script>
           </action>
        </event>
        <transition name="reject" to="rejected" />
        <transition name="approve" to="approved">
            <condition>#{wf_actualPercent >= wf_requiredApprovePercent}</condition>
        </transition>
    </decision>
              
    <task-node name="rejected">
        <task name="wf:rejectedParallelTask" swimlane="initiator" />
        <transition to="end" />
    </task-node>

    <task-node name="approved">
        <task name="wf:approvedParallelTask" swimlane="initiator" />
       <transition to="end">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<runas>admin</runas>
<script>
<variable name="bpm_package" access="read" />
<expression>
var origin = bpm_package.children[0].parent;
var root = origin.parent;
var destination = root.childByNamePath("approved");
                                               
for (var i=0; i &lt; bpm_package.children.length; i++)
{
     bpm_package.children.move(destination);
}  
</expression>
</script>
</action>
</transition>

    </task-node>

    <end-state name="end"/>

</process-definition>



Now tell…

subash
Champ in-the-making
Champ in-the-making
hi,

Yes i am approving through My Alfresco –> My Tasks To Do  option.

After all the approval(Approvers say a,b,c),We need to update the status (Task Done button) by login as the workflow initiater(say d)?

How i can debug on my javascript code ?
Subash

rajanigupta
Champ in-the-making
Champ in-the-making
yes u must have to approve the task by the initiator using this script

subash
Champ in-the-making
Champ in-the-making
Hi,

  How can i ensure that my javascript code is executing ? ie below code is executing properly or not ?
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<runas>admin</runas>
<script>
<variable name="bpm_package" access="read" />
<expression>
var origin = bpm_package.children[0].parent;
var root = origin.parent;
var destination = root.childByNamePath("approved");
for (var i=0; i &lt; bpm_package.children.length; i++)
{
bpm_package.children.move(destination);
}

</expression>
 
</script>
</action>
Subash

subash
Champ in-the-making
Champ in-the-making
Hi ,

I solved my issue,the pblm is we have to define our script definition under transtion name=approve.

Thanks for your time.
Thanks…
Subash