Activiti Task Not Created in Alfresco - alfresco

I'm building a review and approve workflow where the reviewer and the task assignee should be able to exchange message from the tasks' forms, the problem is that when the task is not being recreated if the reviewer hits the reject button, the create listener is not being called when the execution is returned to this task, is there any way to force alfresco to recreate a task every time it is reached?
Update:
the problem happens in the following embedded sub-process,
<subProcess id="subprocess3" name="Sub Process">
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${swwf_splitAssignees}" activiti:elementVariable="splitAssignee"></multiInstanceLoopCharacteristics>
<userTask id="splittedDelegatedTask" name="DelegatedTask" activiti:assignee="${splitAssignee.properties.userName}" activiti:formKey="swwf:splittedDelegatedTask">
<extensionElements>
<activiti:taskListener event="create" class="com.smartway_me.translation_amp.listeners.delegatedTaskCreatedListener"></activiti:taskListener>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
execution.setVariableLocal('swwf_messageToSplitter',task.getVariable('swwf_messageToSplitter'))
execution.setVariableLocal('swwf_delegatedMessage',task.getVaraible('swwf_messageToSplitter'))
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
<sequenceFlow id="flow5" sourceRef="splittedDelegatedTask" targetRef="splitterReview"></sequenceFlow>
<userTask id="splitterReview" name="SplitterReview" activiti:assignee="${inAssignee.properties.userName}" activiti:formKey="swwf:splitterReview">
<extensionElements>
<activiti:taskListener event="create" class="com.smartway_me.translation_amp.listeners.DelegatorReviewTaskCreateListener"></activiti:taskListener>
<activiti:taskListener event="complete" class="com.smartway_me.translation_amp.listeners.DelegatorReviewTaskCompleteListener"></activiti:taskListener>
</extensionElements>
</userTask>
<sequenceFlow id="flow6" sourceRef="splitterReview" targetRef="exclusivegateway2"></sequenceFlow>
<exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow7" sourceRef="exclusivegateway2" targetRef="splittedDelegatedTask">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${swwf_splitterReviewOutcome=='Reject'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow20" sourceRef="exclusivegateway2" targetRef="endevent3">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${swwf_splitterReviewOutcome=='Approve'}]]></conditionExpression>
</sequenceFlow>
<endEvent id="endevent3" name="End"></endEvent>
<startEvent id="startevent3" name="Start"></startEvent>
<sequenceFlow id="flow36" sourceRef="startevent3" targetRef="splittedDelegatedTask"></sequenceFlow>
</subProcess>

Related

stenciljs webcomponents : ion-router for a simple step-by-step wizard?

my stencil app is a step-by-step wizard. In app-root.tsx I have
render() {
return (
<ion-app>
<ion-router useHash={false}>
<ion-route component="app-home" >
<ion-route url="/" component="step-one" />
<ion-route url="/two/:data" component="step-two" />
<ion-route url="/three/:data" component="step-three" />
</ion-route>
</ion-router>
<ion-nav />
</ion-app>
);
}
in app-home.tsx I have
<ion-navbar>
<ion-tabs>
<ion-tab tab="tab1" component="step-one" />
<ion-tab tab="tab2" component="step-two" />
<ion-tab tab="tab3" component="step-three" />
<ion-tab-bar slot="top" selectedTab={this.selectedTab)}>
<ion-tab-button tab="tab1">Step One</ion-tab-button>
<ion-tab-button tab="tab2">Step Two</ion-tab-button>
<ion-tab-button tab="tab3">Step Three</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
</ion-navbar>
at some point I would like to diable the ion-tab-buttons and use them only to display the active tab, but now they are active since I have several problems :
the app doesn't start with the content of "step-one" (a form). I see the tabs at the top and I can click on any tab to select it, but how to make it start at step-one ? ( this.selectedTab = 'tab1' in componentWillLoad)
in step-one I put a <ion-button disabled={!this.valid} routerDirection = 'forward'>Next</ion-button> that shows up, is enabled when the form is filled, but when I click on it, nothing happens (I tried href="/two" without success...)
how to pass the form data to the next steps, by the way ?
Any help appreciated... Thanks !
In the route definitions the component should be the name of the tab (the tab property) and not the component inside of the tab (see Router integration in the ion-tabs docs).
<ion-route component="app-home">
<ion-route url="/" component="tab1" />
<ion-route url="/two/:data" component="tab2" />
<ion-route url="/three/:data" component="tab3" />
</ion-route>
The reason that the button doesn't work with the href attribute is probably the missing :data parameter.
I suggest not passing the data through the URL but to use a central data store, for example Stencil Store. That way you don't have to worry about URL encoding etc.

Alfresco share - Tags not displayed in Tag Management

When creating a folder rule with rule criteria 'Has tag', the Select Tag panel doesn't display all tags
I have tried creating a tag by adding a tag in the file properties but it's still not showing
I checked the tag management, it's not showing there either!
I'm using activiti for managing workflows, and I tried adding tags like it shows in the code below:
<userTask id="reviewTask" name="Review Task"
activiti:formKey="wfa:activitiReviewTaskk">
<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
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
</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('wfa_reviewOutcome', task.getVariable('wfa_reviewOutcome'));
if (task.getVariable('wfa_reviewOutcome') == 'Approve')
{
bpm_package.children[0].addTag("Approved");
}
else
{
if (task.getVariable('wfa_reviewOutcome') == 'Reject')
{
bpm_package.children[0].addTag("Rejected");
}
}
</activiti:string>
</activiti:field>
<activiti:field name="runAs">
<activiti:string>admin</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${bpm_assignee.properties.userName}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
</userTask>
The tags are added but still not showing in the tags management!
I fixed the problem by performing a reindex of SOLR by following the steps in this link, http://docs.alfresco.com/5.0/tasks/solr-reindex.html :
Delete the content of the directories
..\alf_data\solr4\index\workspace\SpacesStore\ and
..\alf_data\solr4\index\archive\SpacesStore\
Delete all the files in ..\alf_data\solr4\model

xmlstarlet Update Value Same Element value

I would like to update the second value of the element block.
The problem that I'm having the two blocks with same element structure.
My goal is to update the second block of
1. /job/input/audio_selector/track
2. /job/stream_assembly/audio_description/language_code
Here is what I tried.
xmlstarlet edit -L \
--update "//job/input//audio_selector/audio_selector/track" \
--value "3,4" \
--update "//job/stream_assembly//audio_description/audio_description/language_code" \
--value "french" payload.xml
Here is my xml:
<?xml version="1.0" encoding="UTF-8"?>
<job href="/jobs/24883">
<input>
<deblock_enable>Auto</deblock_enable>
<deblock_strength>0</deblock_strength>
<no_psi>false</no_psi>
<order>1</order>
<timecode_source>zerobased</timecode_source>
<file_input>
<certificate_file nil="true"/>
<password>xxx</password>
<uri>source</uri>
<username>xxx</username>
</file_input>
<name>input_1</name>
<video_selector>
<color_space>follow</color_space>
<order>1</order>
<program_id nil="true"/>
<name>input_1_video_selector_0</name>
</video_selector>
<audio_selector>
<default_selection>true</default_selection>
<infer_external_filename>false</infer_external_filename>
<order>1</order>
<program_selection>1</program_selection>
<selector_type>track</selector_type>
<track>1</track>
<unwrap_smpte337>true</unwrap_smpte337>
<name>input_1_audio_selector_0</name>
</audio_selector>
<audio_selector>
<default_selection>false</default_selection>
<infer_external_filename>false</infer_external_filename>
<order>2</order>
<program_selection>1</program_selection>
<selector_type>track</selector_type>
<track>UPDATE THIS</track>
<unwrap_smpte337>true</unwrap_smpte337>
<name>input_1_audio_selector_1</name>
</audio_selector>
</input>
<timecode_config>
<require_initial_timecode>false</require_initial_timecode>
<source>zerobased</source>
<sync_threshold nil="true"/>
</timecode_config>
<ad_trigger>scte35_splice_insert</ad_trigger>
<ad_avail_offset>0</ad_avail_offset>
<priority>100</priority>
<user_data/>
<avsync_enable>true</avsync_enable>
<avsync_pad_trim_audio>true</avsync_pad_trim_audio>
<stream_assembly>
<name>stream_assembly_0</name>
<video_description>
<afd_signaling>None</afd_signaling>
<anti_alias>true</anti_alias>
<drop_frame_timecode>true</drop_frame_timecode>
<fixed_afd nil="true"/>
<force_cpu_encode>false</force_cpu_encode>
<height>1080</height>
<insert_color_metadata>false</insert_color_metadata>
<respond_to_afd>None</respond_to_afd>
<sharpness>50</sharpness>
<stretch_to_output>false</stretch_to_output>
<timecode_passthrough>false</timecode_passthrough>
<vbi_passthrough>false</vbi_passthrough>
<width>1920</width>
<h264_settings>
<adaptive_quantization>medium</adaptive_quantization>
<bitrate>14000000</bitrate>
<buf_fill_pct nil="true"/>
<buf_size nil="true"/>
<cabac>true</cabac>
<flicker_reduction>off</flicker_reduction>
<force_field_pictures>false</force_field_pictures>
<framerate_denominator nil="true"/>
<framerate_follow_source>true</framerate_follow_source>
<framerate_numerator nil="true"/>
<gop_b_reference>false</gop_b_reference>
<gop_closed_cadence>1</gop_closed_cadence>
<gop_markers>false</gop_markers>
<gop_num_b_frames>2</gop_num_b_frames>
<gop_size>50.0</gop_size>
<gop_size_units>frames</gop_size_units>
<interpolate_frc>false</interpolate_frc>
<look_ahead_rate_control>medium</look_ahead_rate_control>
<max_bitrate nil="true"/>
<max_qp nil="true"/>
<min_buf_occ nil="true"/>
<min_i_interval>0</min_i_interval>
<min_qp nil="true"/>
<num_ref_frames>1</num_ref_frames>
<par_denominator nil="true"/>
<par_follow_source>true</par_follow_source>
<par_numerator nil="true"/>
<passes>1</passes>
<qp nil="true"/>
<repeat_pps>false</repeat_pps>
<rp2027_syntax>false</rp2027_syntax>
<scd>true</scd>
<sei_timecode>false</sei_timecode>
<slices>1</slices>
<slow_pal>false</slow_pal>
<softness nil="true"/>
<svq>0</svq>
<telecine>None</telecine>
<level>4.1</level>
<profile>High</profile>
<rate_control_mode>CBR</rate_control_mode>
<gop_mode>fixed</gop_mode>
<interlace_mode>progressive</interlace_mode>
</h264_settings>
<selected_gpu nil="true"/>
<codec>h.264</codec>
</video_description>
<audio_description>
<audio_type>0</audio_type>
<follow_input_audio_type>false</follow_input_audio_type>
<follow_input_language_code>false</follow_input_language_code>
<language_code>English</language_code>
<order>1</order>
<stream_name nil="true"/>
<timecode_passthrough>false</timecode_passthrough>
<aac_settings>
<ad_broadcaster_mix>false</ad_broadcaster_mix>
<bitrate>192000</bitrate>
<coding_mode>2_0</coding_mode>
<latm_loas>false</latm_loas>
<mpeg2>false</mpeg2>
<sample_rate>48000</sample_rate>
<profile>LC</profile>
<rate_control_mode>CBR</rate_control_mode>
</aac_settings>
<codec>aac</codec>
<audio_source_name>Audio Selector 1</audio_source_name>
</audio_description>
<audio_description>
<audio_type>0</audio_type>
<follow_input_audio_type>false</follow_input_audio_type>
<follow_input_language_code>false</follow_input_language_code>
<language_code>UPDATE THIS</language_code>
<order>2</order>
<stream_name nil="true"/>
<timecode_passthrough>false</timecode_passthrough>
<aac_settings>
<ad_broadcaster_mix>false</ad_broadcaster_mix>
<bitrate>192000</bitrate>
<coding_mode>2_0</coding_mode>
<latm_loas>false</latm_loas>
<mpeg2>false</mpeg2>
<sample_rate>48000</sample_rate>
<profile>LC</profile>
<rate_control_mode>CBR</rate_control_mode>
</aac_settings>
<codec>aac</codec>
<audio_source_name>Audio Selector 2</audio_source_name>
</audio_description>
</stream_assembly>
<output_group>
<custom_name>file_group_4</custom_name>
<name nil="true"/>
<order>1</order>
<file_group_settings>
<rollover_interval nil="true"/>
<destination>
<password>xxx</password>
<username>xxx</username>
<uri>destination</uri>
</destination>
</file_group_settings>
<type>file_group_settings</type>
<output>
<description nil="true"/>
<extension>mov</extension>
<log_edit_points>false</log_edit_points>
<name_modifier/>
<order>1</order>
<mov_settings>
<growing_reference>false</growing_reference>
<include_clap>false</include_clap>
<include_cslg>true</include_cslg>
<omneon_padding>true</omneon_padding>
<reference>self_contained</reference>
<write_xdcam>false</write_xdcam>
</mov_settings>
<stream_assembly_name>stream_assembly_0</stream_assembly_name>
<container>mov</container>
</output>
</output_group>
</job>
I'm new using xmlstarlet I tried everything but still I can't get it right.
I hope somebody will help.
Thank you very much
xmlstarlet solution:
xmlstarlet ed -L -u "//job/input/audio_selector[2]/track" -v "3,4" \
-u "//job/stream_assembly/audio_description[2]/language_code" -v "french" payload.xml
...audio_selector[2] - select the 2nd node among audio_selector tags

Population data xquery

For the XML data below I am trying to get the output shown here: I.e I want to see the names of the countries having a population greater than 20000 , with the conditions that the number of cities displayed should only be for those with a population more than 3500. Also, For some countries the city is within a province.
<result>
<country name="B">
<num_cities>3</num_cities>
</country>
<country name="C">
<num_cities>2</num_cities>
</country>
</result>
---------------------------This is the XML data----------------------
<country id="1" name="A" population="12000">
<name>A</name>
<city id="c1" country="1">
<name>T1</name>
<population>5000</population>
</city>
<city id="c2" country="1">
<name>T2</name>
<population>3000</population>
</city>
<city id="c3" country="1">
<name>T3</name>
<population>4000</population>
</city>
</country>
<country id="3" name="B" population="80000">
<name>B</name>
<city id="c4" country="2">
<name>T4</name>
<population>6000</population>
</city>
<city id="c5" country="2">
<name>T5</name>
<population>2000</population>
</city>
<city id="c6" country="2">
<name>T6</name>
<population>60000</population>
</city>
<city id="c7" country="2">
<name>T7</name>
<population>12000</population>
</city>
</country>
<country id="3" name="C" population="68000">
<name>C</name>
<province>P1</province>
<city id="c8" country="3">
<name>T8</name>
<population>51000</population>
</city>
<city id="c9" country="3">
<name>T9</name>
<population>3000</population>
</city>
<city id="c10" country="3">
<name>T10</name>
<population>14000</population>
</city>
</country>
I wrote this xquery but i don't know how to exclude the cities having a population > 3500. I might not have written to code correctly either...Please assist.
for $c in doc("abc")//country
let $city:= count($c/city/name)
let $citypr:= count($c/province/city/name)
where $c/#population>1000000
return
<result>
<country name='{data($c/name) }'></country>
<num_of_cities>
{
if (exists ($c/city/name)) then
$city
else
$citypr
}
</num_of_cities>
</result>
Some hints:
Don't bother with where clauses where you can filter down earlier, in a specifier retrieving your content.
If you want to have only one <result>, rather than one per datum, you need to start it before the FLWOR expression; whatever you 'return' will be returned once per item.
This is an example of something closer:
<result>{
for $large-country in doc("abc")//country[#population > 20000]
let $large-cities := $country/city[population > 3500]
return
<country name="{$large-country/#name}">
<num_cities>{count($large-cities)}</num_cities>
</country>
}</result>

iOpus iMacro webscraping loop

I am using the Opus iMacros add-on with Internet Explorer. The following Macro takes a variable from the first line of my excel CSV File and performs a search on a website. The search results from the website may be anywhere from 10 to 200 records, which are grouped 20 per page (1-10 pages). The macro then extracts each page to a text file for future reference.
SET !ERRORIGNORE YES
SET !EXTRACT_TEST_POPUP NO
TAB T=1
TAB CLOSEALLOTHERS
SET !DATASOURCE 7Digits.csv
SET !DATASOURCE_Columns 1
SET !DATASOURCE_LINE {{!LOOP}}
'Login
URL GOTO=https://SomeWebsite.com/login
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:USER_NAME CONTENT=ABC123
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:form1 ATTR=NAME:PASSWORD CONTENT=XXX
'set search criteria on multiple search page
TAG POS=1 TYPE=TEXTAREA FORM=NAME:form1 ATTR=NAME: NUMBER CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:IMAGE FORM=NAME:form1 ATTR=ID:SEARCH
‘Extract results and SAVE
TAG POS=1 TYPE=A ATTR=TXT:1
TAG POS=2 TYPE=TABLE ATTR=TXT:*location* EXTRACT=TXT
SAVEAS TYPE=txt FOLDER=* FILE=mytable_{{!NOW:yymmdd_hhnnss}}
TAG POS=1 TYPE=A ATTR=TXT:2
TAG POS=2 TYPE=TABLE ATTR=TXT:*location* EXTRACT=TXT
SAVEAS TYPE=txt FOLDER=* FILE=mytable_{{!NOW:yymmdd_hhnnss}}
TAG POS=1 TYPE=A ATTR=TXT:3
TAG POS=2 TYPE=TABLE ATTR=TXT:*location* EXTRACT=TXT
SAVEAS TYPE=txt FOLDER=* FILE=mytable_{{!NOW:yymmdd_hhnnss}}
TAG POS=1 TYPE=A ATTR=TXT:4
TAG POS=2 TYPE=TABLE ATTR=TXT:*location* EXTRACT=TXT
SAVEAS TYPE=txt FOLDER=* FILE=mytable_{{!NOW:yymmdd_hhnnss}}
TAG POS=1 TYPE=A ATTR=TXT:5
TAG POS=2 TYPE=TABLE ATTR=TXT:*location* EXTRACT=TXT
SAVEAS TYPE=txt FOLDER=* FILE=mytable_{{!NOW:yymmdd_hhnnss}}
TAG POS=1 TYPE=A ATTR=TXT:6
TAG POS=2 TYPE=TABLE ATTR=TXT:*location* EXTRACT=TXT
SAVEAS TYPE=txt FOLDER=* FILE=mytable_{{!NOW:yymmdd_hhnnss}}
TAG POS=1 TYPE=A ATTR=TXT:7
TAG POS=2 TYPE=TABLE ATTR=TXT:*location* EXTRACT=TXT
SAVEAS TYPE=txt FOLDER=* FILE=mytable_{{!NOW:yymmdd_hhnnss}}
TAG POS=1 TYPE=A ATTR=TXT:8
TAG POS=2 TYPE=TABLE ATTR=TXT:*location* EXTRACT=TXT
SAVEAS TYPE=txt FOLDER=* FILE=mytable_{{!NOW:yymmdd_hhnnss}}
TAG POS=1 TYPE=A ATTR=TXT:9
TAG POS=2 TYPE=TABLE ATTR=TXT:*location* EXTRACT=TXT
SAVEAS TYPE=txt FOLDER=* FILE=mytable_{{!NOW:yymmdd_hhnnss}}
TAG POS=1 TYPE=A ATTR=TXT:10
TAG POS=2 TYPE=TABLE ATTR=TXT:*location* EXTRACT=TXT
SAVEAS TYPE=txt FOLDER=* FILE=mytable_{{!NOW:yymmdd_hhnnss}}
'END
My challenge is to figure out a way to cancel the “SAVEAS” if there are less than 10 pages of search results. For instance, if the search only returns 60 results, the Macro only needs to perform the SAVEAS command 3 times (20 x 3). How can I move to the next {{!LOOP}} without saving the same text file 7 more times?
I have tried the “!FAIL_ON_ALL_NAVIGATEERRORS” command, but the macro stops entirely. I would like to move to the next record instead of stopping the macro.
This is how you convert iMacros code to JavaScript.
How to invoke an iMacro from JavaScript?
Also your question holds an answer because you asked " if there are less then ". So you have to convert to code to JS and use if clauses.
You can do it by imacro javascript if formula.
if(search result<10) {
perform your script
}else { go to next page }

Resources