cancel
Showing results for 
Search instead for 
Did you mean: 

custom workflow

tonizz
Champ in-the-making
Champ in-the-making
Hi everybody,

I only have a user, admin, in my site to publish web contents from web forms. So up to now this user has to create and submit the contents and after this, he has to "auto-review" and "auto-approve" the contents that he created. I would like to publish without having to approve or regret. In other words I would like to release directly to the main sandbox.

could be a solution creating a new custom workflow?In this case, how can I do it. More or less I know what I migth do but I dont know which files I have to edit o which are the tasks I have to modify.

Thanks in advance!
18 REPLIES 18

bmui
Champ in-the-making
Champ in-the-making
Just noticed that after I submitted content, a task appears in the My Alfresco dashboard.  When clicking 'task done', this error shows:



A system error happened during the operation: Mandatory task properties have not been provided: {http://www.alfresco.org/model/wcmworkflow/1.0}approveCnt,{http://www.alfresco.org/model/wcmworkflow/...



I'm not sure why this task appears since I'm tyring to bypass the review and approval.  I'm guessing since I havent found a way to skip the submit details page(in which i have to enter a label and description), thats the cause..  i think i have to figure out wat the submit items page does after you submit it and combine it with my customized action that took place of the functionality that was used at the 'finish button' when creating web content…

i might have to modify/refer to these files, not completely sure:

web-client-config-wcm-actions.xml, web-client-config-dialogs.xml, submit-dialog.jsp…

d_mon
Champ in-the-making
Champ in-the-making
A system error happened during the operation: Mandatory task properties have not been provided: {http://www.alfresco.org/model/wcmworkflow/1.0}approveCnt,{http://www.alfresco.org/model/wcmworkflow/...

So is it possible to avoid task creation or at least provide these missing mandatory properties somehow?
What is needed to be changed for that: process definition, workflow model or something else?

quartilan
Champ in-the-making
Champ in-the-making
I have got the custom workflow thingy working. But I would like to remove the staging sandbox. Is this possible?

The idea would be that my user would work directly on the staging sandbox.

quartilan
Champ in-the-making
Champ in-the-making
I have found something on the auto-deployement. This should be available in version 2.2. Is this version allready available or is there any way I can get this to work in 2.1?

d_mon
Champ in-the-making
Champ in-the-making
I have got the custom workflow thingy working. But I would like to remove the staging sandbox. Is this possible?

The idea would be that my user would work directly on the staging sandbox.

Could you please provide the information about how to do it?

quartilan
Champ in-the-making
Champ in-the-making
I took the adhoc workflow definition and modified it.

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

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

        <swimlane name="initiator"/>

      <swimlane name="assignee">
         <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
            <actor>#{bpm_assignee}</actor>
         </assignment>
      </swimlane>
      
        <start-state name="start"
>
            <task name="wcmwf:startTask" swimlane="assignee"/>
            <transition name="launch" to="submitted"/>
        </start-state>
      
      
      
        <task-node name="submitted">
            <event type="node-enter">
               <action class="org.alfresco.repo.avm.wf.AVMSubmitPackageHandler"/>
            </event>
            <task name="wcmwf:submittedTask" swimlane="assignee" />
            <transition name="submit" to="end" />
        </task-node>

        <end-state name="end"/>
      
        <event type="process-end">
            <action class="org.alfresco.repo.avm.wf.AVMClearSubmittedHandler"/>
            <action class="org.alfresco.repo.avm.wf.AVMRemoveWFStoreHandler"/>
        </event>
</process-definition>




I added some text in workflow-messages.properties


wf_test.workflow.title=Workflow title
wf_test.workflow.description=Workflow description

You also need to add the workflow in bootstrap-context.xml
<property name="workflowDefinitions">
         <list>
            <props>
               <prop key="engineId">jbpm</prop>
               <prop key="location">alfresco/workflow/review_processdefinition.xml</prop>
               <prop key="mimetype">text/xml</prop>
               <prop key="redeploy">false</prop>
            </props>
            <props>
               <prop key="engineId">jbpm</prop>
               <prop key="location">alfresco/workflow/test_processdefinition.xml</prop>
               <prop key="mimetype">text/xml</prop>
               <prop key="redeploy">false</prop>
            </props>
            <props>
               <!– WCM workflow definition –>
                <prop key="engineId">jbpm</prop>
                <prop key="location">alfresco/workflow/submit_processdefinition.xml</prop>
                <prop key="mimetype">text/xml</prop>
                <prop key="redeploy">false</prop>
            </props>
           

            <props>
               <!– WCM workflow definition –>
               <prop key="engineId">jbpm</prop>
               <prop key="location">alfresco/workflow/changerequest_processdefinition.xml</prop>
               <prop key="mimetype">text/xml</prop>
               <prop key="redeploy">false</prop>
            </props>
         
         </list>
      </property>


Then you need to add the workflow in web-client-config-wcm.xml. I just added the wf:test after the wcmwf:submit.

<workflows>
            wcmwf:submit, wf:test
         </workflows>

I believe that that did the trick.

Still have a task assigned when in overvieuw but it is submitted in de staging sandbox without any need for further approval. I'm looking for a solution for this but no luck yet.

Hope this helped. (looks almost the same as what is described above but this worked for me)

d_mon
Champ in-the-making
Champ in-the-making
But can you close that assigned task or not?

kvc
Champ in-the-making
Champ in-the-making
Couple of items:

*  Auto-promote to Staging from Web Content Wizard
   -  Unfortunately, the Submit to Staging checkbox option is only available from the Summary screen in the Wizard.  If you click finish in the content editing form, you bypass the Summary screen
      and your content just saves to your user sandbox.  

*  Auto-deploy
   -  The auto-deploy option was added to our default WCM workflow and is settable by an end-user at time of Submit.  This was put in primarily for "hot fixes" to www sites or basic publishing to
      an intranet site where the latest version of Staging is may very well always be the current version of your site.

   -  This capability is available only in our recently available 2.2.0 Enterprise release for subscribing customers.  It rolls into the next 2.9 Community update in June.

*  Edit direct in Staging
   -  As noted elsewhere, WCM follows a change management model:  dev –> stage –> live.  All changes must always be made in a user sandbox; staging sandboxes are marked as special read-only
      repositories for any user other than the system user (our app).  Other reasons for enforcing this are that (a) in order to ensure Staging is indexed, we snapshot Staging upon submit - snapshots
      trigger indexing - meaning, the new version of your site is up-to-date for querying (b) in order to ensure you have a rollback point - a verifiable audit trail and back-up of every version of your
      site for compliance purposes - snapshots are baked in part of the system - I think our own www site for example is up to snapshot 1900 or something along those lines.

Cheers.


Kevin

jackzhaojin
Champ in-the-making
Champ in-the-making
Reply to quartilan's post -

Thanks for the detailed code posting, I've integrated exactly what you've entered, but I have a few issues, and I'm wondering if anyone has resolved it.

1) If I invoke the workflow, the workflow gets submitted without any reviewers and type of review, and this causes an error when you submit the workflow.
A system error happened during the operation: Mandatory task properties have not been provided: {http://www.alfresco.org/model/bpm/1.0}assignees

2) Auto-deploy functionality doesn't seem to work with this submission.

So far I have the following in my test_processdefinition.xml

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

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

    <swimlane name="initiator"/>

    <swimlane name="assignee">
        <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
            <actor>#{bpm_assignee}</actor>
        </assignment>
    </swimlane>

    <start-state name="start">
        <task name="wcmwf:startTask" swimlane="assignee"/>
        <transition name="launch" to="submitted"/>
    </start-state>


    <task-node name="submitted">
        <event type="node-enter">
            <action class="org.alfresco.repo.avm.wf.AVMSubmitPackageHandler"/>
        </event>
        <task name="wcmwf:submittedTask" swimlane="assignee"/>
        <transition name="submit" to="end"/>
    </task-node>

    <end-state name="end"/>

    <event type="process-end">
        <action class="org.alfresco.repo.avm.wf.AVMClearSubmittedHandler"/>
        <action class="org.alfresco.repo.avm.wf.AVMRemoveWFStoreHandler"/>
    </event>
</process-definition>

Any suggestions on either of these two issues?

Thanks a bunch ahead of time,

Jack

Alfresco version: 2.9c