Topic
  • 3 replies
  • Latest Post - ‏2013-12-30T06:22:50Z by Alexander_Zinovin
AndrewatFindel
AndrewatFindel
43 Posts

Pinned topic Linking workflows

‏2013-11-18T16:49:33Z |

We have a workflow to update products, if the product has certain attribute values and not other values then we want to automatically check it out to another workflow (another Collaboration Area) where the missing attribute values can be added. We want this to happpen when the item has been updated with the collaboration area changes currently in progress and not beforehand.

If I use some of the catalog options to put in code I'm dealing with the old version and the check out sends the old version to the other Collaboration Area.

If I use the Item save with a save event of CA_WORKFLOW any time a product is checked in (DONE) in any workflow associated with that catalog it does the checkout. I really want the automatic checkout to be done only on Save from the one Collaboration Area.

I do all my code in Java and try to avoid WPC Script where possible as we have more skilled Java coders in our business than WPC Script.

Any ideas?  

 

Updated on 2013-11-18T16:52:02Z at 2013-11-18T16:52:02Z by AndrewatFindel
  • Alexander_Zinovin
    Alexander_Zinovin
    117 Posts

    Re: Linking workflows

    ‏2013-12-24T12:27:42Z  

    Hi,

    check a catalog name of saved item and if it is required colarea name - make checkout.

  • AndrewatFindel
    AndrewatFindel
    43 Posts

    Re: Linking workflows

    ‏2013-12-27T13:50:44Z  

    Hi,

    check a catalog name of saved item and if it is required colarea name - make checkout.

    hello

        public void postsave(PostItemSaveFunctionArguments arg0) {
          
            final String METHODNAME = "postsave(PostItemSaveFunctionArguments arg0):";
            String saveEvent = arg0.getSaveEvent();
            if( saveEvent.equals("CA_WORKFLOW") ) {

    on the none CA method I do not know the CA it has come from, if I use the CA method 

        public void postsave(PostCollaborationItemSaveFunctionArguments arg0) {

    then when I do my test and check it out to the other CA/workflow it seems to check out the item without the latest changes made in the CA, because it is the other method that is called after the CA changes have been merged into the catalog, I presumme.

    I also tested using moveItemsToOtherCollaborationArea
    like
    prodColArea.moveItemsToOtherCollaborationArea(colCAItems, webEnrichProdColArea);
    Everywhere I tried putting this code I get an error CWPAP0197E:The collaboration object is not in this collaboration step.
     
    2013-12-13 17:33:44,627 [jsp_35: moveEntriesToNextStep.wpc] ERROR com.ibm.ccd.common.error.AustinException - CWPCM0002E:Generic error / Exception: Generic Error, Exception:CWPAP0197E:The collaboration object is not in this collaboration step
    java.lang.UnsupportedOperationException: CWPAP0197E:The collaboration object is not in this collaboration step
                   at com.ibm.ccd.api.collaboration.ItemCollaborationAreaImpl.moveItemsToOtherCollaborationArea(Unknown Source)

     

     

  • Alexander_Zinovin
    Alexander_Zinovin
    117 Posts

    Re: Linking workflows

    ‏2013-12-30T06:22:50Z  

    hello

        public void postsave(PostItemSaveFunctionArguments arg0) {
          
            final String METHODNAME = "postsave(PostItemSaveFunctionArguments arg0):";
            String saveEvent = arg0.getSaveEvent();
            if( saveEvent.equals("CA_WORKFLOW") ) {

    on the none CA method I do not know the CA it has come from, if I use the CA method 

        public void postsave(PostCollaborationItemSaveFunctionArguments arg0) {

    then when I do my test and check it out to the other CA/workflow it seems to check out the item without the latest changes made in the CA, because it is the other method that is called after the CA changes have been merged into the catalog, I presumme.

    I also tested using moveItemsToOtherCollaborationArea
    like
    prodColArea.moveItemsToOtherCollaborationArea(colCAItems, webEnrichProdColArea);
    Everywhere I tried putting this code I get an error CWPAP0197E:The collaboration object is not in this collaboration step.
     
    2013-12-13 17:33:44,627 [jsp_35: moveEntriesToNextStep.wpc] ERROR com.ibm.ccd.common.error.AustinException - CWPCM0002E:Generic error / Exception: Generic Error, Exception:CWPAP0197E:The collaboration object is not in this collaboration step
    java.lang.UnsupportedOperationException: CWPAP0197E:The collaboration object is not in this collaboration step
                   at com.ibm.ccd.api.collaboration.ItemCollaborationAreaImpl.moveItemsToOtherCollaborationArea(Unknown Source)

     

     

    Hi,

    I don't know the Java API, but in script I can get the name of item's catalog. If the item is in a Colarea, the function return the name of the colarea. So you need to try get Item from arg0 parameter and check it's catalog name