cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED] Can't View Workflow Details

ldziedzic
Champ in-the-making
Champ in-the-making
Hi,

I have succesfully deployed an advanced workflow and everything works fine. There is only one thing left, when I go to Workflows I've Started and then View Workflow I get a prompt with "Failure".

My process definition looks like that:



<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process isExecutable="true" id="invoice" name="Faktury">
    <extensionElements>
      <activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
        <activiti:field name="script">
          <activiti:string>execution.setVariable('wf_financialControlGroup', groups.getGroup('Kontrola_finansowa').getFullName());
                     execution.setVariable('wf_managementGroup', groups.getGroup('Management').getFullName());
                     execution.setVariable('wf_ConaccGroup', groups.getGroup('Conacc').getFullName());
                     execution.setVariable('wf_invoicePaymentGroup', groups.getGroup('Platnicy_faktur').getFullName());
                     </activiti:string>
        </activiti:field>
      </activiti:executionListener>
    </extensionElements>
    <startEvent id="start" name="Start" activiti:formKey="iwf:invoice">
   </startEvent>
    <userTask id="financialInvoiceApproval" name="Zatwierdzenie finansowe" activiti:candidateGroups="${wf_financialControlGroup}" activiti:formKey="iwf:financialInvoiceApproval">
   <extensionElements>
   <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;
         </activiti:string>
          </activiti:field>
    </activiti:taskListener>
   <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>
         if(task.getVariable('iwf_suma') > 10000 ) {
         var temp = "true"; }
         execution.setVariable('iwf_sprawdzenie', temp);
         execution.setVariable('bpm_dueDate', task.dueDate);
         </activiti:string>
          </activiti:field>
     </activiti:taskListener>
   </extensionElements>
    </userTask>
    <userTask id="mgmtApproval" name="Zatwierdzenie Managment" activiti:candidateGroups="${wf_managementGroup}" activiti:formKey="iwf:mgmtApproval">
   <extensionElements>
   <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_dueDate;</activiti:string>
          </activiti:field>
    </activiti:taskListener>
    <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
      <activiti:field name="script">
          <activiti:string>execution.setVariable('iwf_mgmtReviewOutcome', task.getVariable('iwf_mgmtReviewOutcome'));</activiti:string>
        </activiti:field>
    </activiti:taskListener>
    </extensionElements>
   </userTask>
    <userTask id="invoicePayment" name="Opłacenie faktury" activiti:candidateGroups="${wf_financialControlGroup},${wf_invoicePaymentGroup}" activiti:formKey="iwf:invoicePayment">
   <extensionElements>
   <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_dueDate;</activiti:string>
          </activiti:field>
    </activiti:taskListener>
   <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
      <activiti:field name="runAs"><activiti:string>admin</activiti:string></activiti:field>
     <activiti:field name="script">
          <activiti:string>
        var iwf_suma = task.getVariable('iwf_suma');
        var iwf_sprzedawca = task.getVariable('iwf_sprzedawcap');
        var child = bpm_package.children[0];   
        child.properties["cm:description"] = "Data płatności: " + bpm_dueDate + "\n" + "Suma: " + iwf_suma + "\n" + "Sprzedawca: " + iwf_sprzedawca;
        child.addTags([iwf_suma,iwf_sprzedawca]);
        child.save();
        var dest = companyhome.childByNamePath("Sites/zatwierdzone-faktury/documentLibrary/ZatwierdzoneFaktury");
        child.move(dest);
        </activiti:string>
        </activiti:field>
    </activiti:taskListener>
   </extensionElements>
   </userTask>
    <exclusiveGateway id="kDecision" name="10k decision"></exclusiveGateway>
    <sequenceFlow id="flow1" sourceRef="start" targetRef="financialInvoiceApproval"></sequenceFlow>
   <sequenceFlow id="flow2" sourceRef="financialInvoiceApproval" targetRef="kDecision"></sequenceFlow>
    <sequenceFlow id="flow3" sourceRef="kDecision" targetRef="mgmtApproval"><conditionExpression xsi:type="tFormalExpression"><![CDATA[${iwf_sprawdzenie == "true"}]]></conditionExpression></sequenceFlow>
   <sequenceFlow id="flow4" sourceRef="kDecision" targetRef="invoicePayment"></sequenceFlow>
    <sequenceFlow id="flow5" sourceRef="mgmtApproval" targetRef="invoicePayment"><conditionExpression xsi:type="tFormalExpression"><![CDATA[${iwf_mgmtReviewOutcome == "Zatwierdź"}]]></conditionExpression></sequenceFlow>                                                   
    <sequenceFlow id="flow6" sourceRef="invoicePayment" targetRef="endevent1"></sequenceFlow>
    <endEvent id="endevent1" name="End"></endEvent>
  </process>
    <bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">
    <bpmndi:BPMNPlane bpmnElement="invoice" id="BPMNPlane_invoice">
      <bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
        <omgdc:Bounds height="35.0" width="35.0" x="70.0" y="270.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="financialInvoiceApproval" id="BPMNShape_financialInvoiceApproval">
        <omgdc:Bounds height="55.0" width="105.0" x="170.0" y="260.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="kDecision" id="BPMNShape_kDecision">
        <omgdc:Bounds height="40.0" width="40.0" x="340.0" y="267.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="invoicePayment" id="BPMNShape_invoicePayment">
        <omgdc:Bounds height="55.0" width="105.0" x="450.0" y="260.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="mgmtApproval" id="BPMNShape_mgmtApproval">
        <omgdc:Bounds height="55.0" width="105.0" x="308.0" y="370.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="620.0" y="270.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="105.0" y="287.0"></omgdi:waypoint>
        <omgdi:waypoint x="170.0" y="287.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="275.0" y="287.0"></omgdi:waypoint>
        <omgdi:waypoint x="340.0" y="287.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="360.0" y="307.0"></omgdi:waypoint>
        <omgdi:waypoint x="360.0" y="370.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
        <omgdi:waypoint x="360.0" y="370.0"></omgdi:waypoint>
        <omgdi:waypoint x="502.0" y="315.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
        <omgdi:waypoint x="380.0" y="287.0"></omgdi:waypoint>
        <omgdi:waypoint x="450.0" y="287.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
        <omgdi:waypoint x="555.0" y="287.0"></omgdi:waypoint>
        <omgdi:waypoint x="620.0" y="287.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>



And the process model:



<?xml version="1.0" encoding="UTF-8"?>

<model name="iwf:myworkflowmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <imports>
      <!– Import Alfresco Dictionary Definitions –>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
      <!– Import Alfresco System Definitions –>
      <import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
      <!– Import User Model Definitions –>
      <import uri="http://www.alfresco.org/model/user/1.0" prefix="usr" />
      <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm" />
   </imports>

   <namespaces>
      <namespace uri="http://www.alfresco.org/model/iWorkflow/1.0" prefix="iwf"/>
   </namespaces>

   <types>

      <type name="iwf:invoice">
         <parent>bpm:startTask</parent>
         <overrides>
         </overrides>
         <mandatory-aspects>
            <aspect>iwf:sum</aspect>
            <aspect>iwf:sprzedawca</aspect>
         </mandatory-aspects>
      </type>

      <type name="iwf:financialInvoiceApproval">
         <parent>bpm:activitiOutcomeTask</parent>
         <overrides>
            <property name="bpm:packageActionGroup">
               <default>add_package_item_actions</default>
            </property>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
            <property name="bpm:outcomePropertyName">
               <default>{http://www.alfresco.org/model/workflow/1.0}reviewOutcome</default>
            </property>         
         </overrides>   
         <mandatory-aspects>
            <aspect>iwf:sum</aspect>
            <aspect>iwf:sprzedawca</aspect>
         </mandatory-aspects>
      </type>
      
      <type name="iwf:mgmtApproval">
         <parent>bpm:activitiOutcomeTask</parent>
         <properties>
            <property name="iwf:mgmtReviewOutcome">
               <type>d:text</type>
               <default>Odrzuć</default>
               <constraints>
                  <constraint name="iwf:mgmtReviewOutcomeOptions" type="LIST">
                     <parameter name="allowedValues">
                        <list>
                           <value>Zatwierdź</value>
                           <value>Odrzuć</value>
                        </list>
                     </parameter>
                  </constraint>
               </constraints>
            </property>
         </properties>
         <overrides>
            <property name="bpm:packageActionGroup">
               <default>add_package_item_actions</default>
            </property>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
            <property name="bpm:outcomePropertyName">
               <default>{http://www.alfresco.org/model/workflow/1.0}reviewOutcome
               </default>
            </property>
         </overrides>
         <mandatory-aspects>
            <aspect>iwf:sum</aspect>
            <aspect>iwf:sprzedawca</aspect>
         </mandatory-aspects>
      </type>
   

      <type name="iwf:invoicePayment">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageActionGroup">
               <default>add_package_item_actions</default>
            </property>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
            <property name="bpm:outcomePropertyName">
               <default>{http://www.alfresco.org/model/workflow/1.0}reviewOutcome</default>
            </property>         
         </overrides>   
         <mandatory-aspects>
            <aspect>iwf:sum</aspect>
            <aspect>iwf:sprzedawca</aspect>
         </mandatory-aspects>
      </type>
   
   </types>
   
   <aspects>
      
      <aspect name="iwf:sprzedawca">
         <properties>
            <property name="iwf:sprzedawcap">
               <title>Sprzedawca</title>
               <description>Sprzedawca</description>
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
         </properties>
      </aspect>
      
      <aspect name="iwf:sum">
         <properties>
            <property name="iwf:suma">
               <title>Suma faktury</title>
               <description>Suma faktury</description>
               <type>d:int</type>
               <mandatory>true</mandatory>
            </property>
         </properties>
      </aspect>

      

   </aspects>

</model>



Am I missing something? Is there something more I should configure ?

As an error in catalina.out I'm getting the null pointer, so looks like Alfresco tries to target something that isn't there.

regards
Leszek
6 REPLIES 6

lyles
Champ in-the-making
Champ in-the-making
Look in web-extension/share-config-custom.xml for a section similar to the following:

    <config evaluator="task-type" condition="MYwf:submitMYTask">
        <forms>
            <form id="workflow-details">

If you can't find any errors in that section, post it here.

ldziedzic
Champ in-the-making
Champ in-the-making
Hi,

Thank you for reply. I don't have such section in that file, beacuse I'm keeping all my form configuration in share-workflow-form-config.xml. However after your suggestion I moved it all to share-config-custom.xml, but still nothing, "Failure" prompt. I also don't have

  <form id="workflow-details"> 


configured as I thought this is only for customization of the View Details page. At the beginning, I followed some tutorials, and the View Workflow page worked like a charm. I used those tutorial to built something more complex, and changed the name space in the process from "wf" which is not recommended to a custom one, and this is currently the only diference I can spot.

regards
Leszek

lyles
Champ in-the-making
Champ in-the-making
Yes, I believe the workflow-details configuration is optional, so if you haven't specified one then the problem must be elsewhere.

If all you can do is start the workflow, then maybe your execution listener is doing something wrong - but it looks fine to me.
Can you view the task page for the first user task?

I doubt this has anything to do with your error, but I noticed the workflow has no condition for flow4. It should probably be set to
${iwf_sprawdzenie == "false"}

ldziedzic
Champ in-the-making
Champ in-the-making
I can start the workflow, and it works all the way, I can view all tasks pages, and I can see that it ends properly (by checking the Workflows I've Started). I left the condition for flow4 blank, so the gateway always has an option, even if something goes wrong with the drop down list (I can't imagine what can go wrong with it, but this is just a precaution).

As per the listeners, they don't generate any errors (at least non in catalina.out), and I had increased debug levels for workflows.

Just to make sure that all options are covered I've checked by adding:

${iwf_sprawdzenie == "false"}


and unfortunately still the same.

UPDATE:

There is one more thing that is odd. When I click on View Workflow, I see the "Failure" prompt, but in the back there is a name of the whole process (iwf:invoice), and when I try the same with build in workflows I can see the name of the Start Task.

Thanks for trying to help
Leszek

ldziedzic
Champ in-the-making
Champ in-the-making
Hi,

I've tried almost everything (at least from my point of view), and still nothing:

- tried to switch to namespace wf:, it's not recommended and it didn't helped,
- tried to deploy the workflow on clean installation of Alfresco both on 4.2c and 4.2b,
- tried changing the order of bootstrap file,
- compared all files with working examples, can't spot any difference in the pieces of xml's that are constant for all workflows
- deployed one more workflow, similar to the one that is presented above, but I tried a different namespace, and build if from scratch, without using code from examples to avoid simple mistakes

Did anybody had similar problem to this ? Maybe someone has an idea, I'm willing to test anything at this point.

regards
Leszek

ldziedzic
Champ in-the-making
Champ in-the-making
Hi,

I managed to start the Workflow Details page, changed three things and it finally worked:

- installed the Alfresco 4.2d
- change the name of model to iwf:workflowmodel instead of iwf:myworkflowmodel
- change the namespace URI to an actual URI: http://example.org/iwf

Most probably the clean installation helped here, but still all other ideas are worth trying.

regards
Leszek